4

I am trying to make a function in Minecraft 1.14.2, and it just doesn't work. I tried everything and looked for answers everywhere, but it still doesn't work. I did the following:

  • created a .mcfunction file in \<myWorldName>\datapacks\<dataPackName>\data\<nameSpace>\functions;
  • saved it in UTF-8 without BOM (using Notepad++), and later tried ANSI;
  • did /reload and then /function <nameSpace>:<functionName>. It always just writes "Unknown function <functionName>". It didn't work a single time.

My function file is very simple, I just try to test it with something like:

say 123

I really don't know what to do next, please, can you help me?

  • Check that your function's name doesn't have any reserved characters. Try making that example function be named example.mcfunction, because I'm pretty sure capital letters and certain punctuations are off limits. – Nik3141 May 30 at 22:38
  • Name of my function was test.mcfunction so it wasn't because of punctuation or capital letters. – VectorSVK May 31 at 21:25
3

You also need "pack.mcmeta" in your <datapackName> folder. The wiki tells you what that can all contain, but the simplest case is just:

{"pack":{"pack_format":3,"description":""}}
  • I had that file there but it was slightly different. Your version made it work. Thank you very much! – VectorSVK May 31 at 21:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.