Hi, I'am in a process of making my own "Minecraft minigames" like spleef, parkour etc. and I don't know how to detect that game is started. For example if the game starts I don't know how to get into the first game. I tried to use tick.mcfunction but things like teleporting and giving items are made infinitly and without commands it's really difficult. I also heard about predicates but i don't really know what they can do. Can someone help?
#How to detect something without using commands and tick.mcfunction
1 messages · Page 1 of 1 (latest)
How does the game start?
Just putting stuff in the tick function is the completely wrong way. The tick function should only contain commands that check for certain conditions and then call other functions that handle the actual stuff that happens.
For example, when using floor crafting, in the tick function you check if a specific item exists and if the other ingredience of that recipe are in close proximity of it. If all of that matches, you call the function that handles the crafting. (delete all the ingredients on the ground, and drop the result item.)
If we can we try to avoid the tick function however. We prefer to use Advancements, Enchantments to act as triggers for function execution as they are much more performant than constantly checking stuff in the tick function.