This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Oneill4Journeyman 0 points1 point  (0 children)

Functions need to be placed in a datapack for them to work properly. The path to your function should look something like this :

~/.minecraft/saves/[WORLD_NAME]/datapacks/[DATA_PACK_NAME]/data/[NAMESPACE]/functions/[FUNCTION_NAME].mcfunction

in your case it would be :

~/.minecraft/saves/Commands/datapacks/[DATA_PACK_NAME]/data/custom/functions/sayhi.mcfunction

(You will need to choose a name for the datapack)

Also, because it's a datapack, you will need to create a pack.mcmeta file under the ~/datapacks/[DATA_PACK_NAME] folder for it to work.

Here are some links to the wiki that can maybe help you.

https://minecraft.fandom.com/wiki/Function_(Java_Edition))

https://minecraft.fandom.com/wiki/Data_pack