I try to run a Setblock command using a function with this code
setblock ~ ~-1 ~ minecraft:cobblestone
#say hi
and then do this:
/gamerule gameLoopfunction example:example
And nothing happens. It works when run manually.
I try to run a Setblock command using a function with this code
setblock ~ ~-1 ~ minecraft:cobblestone
#say hi
and then do this:
/gamerule gameLoopfunction example:example
And nothing happens. It works when run manually.
Do not use relative coordinates in functions, which will be run by gameLoopfunction. If you use this gamerule, the function will be executed by the server, not by the executor of the gamerule command. And because the server has no coordinates, relative coordinates will not work. If you want to make this loop working, you have to use execute command.
execute @a ~ ~ ~ /setblock ~ ~-1 ~ minecraft:cobblestone
#say hi
This should work OK