Référence de la Commande
Minecraft /function Command
developerÉdition JavaÉdition Bedrock
Exécute un fichier de fonction (.mcfunction) contenant une séquence de commandes en un seul tick.
Compatibilité des Versions
Édition Java:1.21.4 (1.13+)
Édition Bedrock:1.21.60
Syntaxe de la Commande
Les Deux Éditions
/function <name>Arguments Expliqués
nameResource IDRequisNamespace location of the function (e.g. namespace:function_name).
Exemples Pratiques
/function arena:start_matchExecutes the commands defined in the "start_match" function within the "arena" datapack.
Notes Importantes
Functions are the foundation of custom game loops, mini-games, and map setups. Since they run on the server side in a single tick, they are significantly more efficient than long chains of command blocks.