Commands/function

Runs a function.


 * Syntax


 * Java Edition


 * Arguments


 * function


 * Must be of the format.


 * Result


 * Fails if the argument is not specified correctly.
 * Fails if the selector was not found using.
 * Fails if the selector was found using.


 * If successful, runs a function through the entity or commandblock which ran the /function command.


 * Examples


 * To run a function located at 'data/functions/custom/example/test.mcfunction':
 * To run a function if there is a sheep within a radius of 2 blocks:  or
 * To run a function unless the executor is a player:  or


 * See also


 * gamerule gameLoopFunction – Runs a function every tick.