Commands/function

Runs a function.


 * Syntax


 * Java Edition


 * Arguments


 * function


 * May be of the format, or.
 * The format without the  prefix, , runs a single function.
 * The format with the  prefix, , runs all functions included in the function tag specified.


 * Result


 * Fails if the argument is not specified correctly.


 * If successful, runs a function through the command sender which ran the /function command.


 * Examples


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


 * See also


 * Tag – To run function in batch, every tick, or on server (re)load.