📜
Advanced
/function
Run a list of commands stored in a datapack function file.
At a glance
Syntax
Syntax
/function <namespace:path>commandtargetcoordsvaluerequiredoptional
See it
What it does
/
Command executed
Anatomy
Every part, explained
- 1
CommandRequired/functionRuns a datapack function.
- 2
Function IDRequired<namespace:path>The pack and path, like mypack:setup.
Your turn
Try it yourself
Playground
2 tokens · press Enter to run
Copy & paste
Examples
/function mypack:setupRun the setup function.
/function mypack:loopTrigger a loop function.
/function minecraft:tickCall the built-in tick function.
Avoid these
Common mistakes
✕
/function setup✓
/function mypack:setupAlways include the namespace before the colon.
✕
/function mypack/setup✓
/function mypack:setupUse a colon between pack and path.
Keep going