Commands/function

Runs a function or all functions in a tag from loaded data packs. Runs a function from add-ons.


 * Syntax




 * Arguments


 * function


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


 * Bedrock Edition
 * May be of the format
 * Runs the function located at


 * Result


 * Fails if the argument is not specified correctly.


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


 * Examples


 * Java Edition
 * To run a function located at  in a loaded data pack:
 * To run all functions in a function tag located at :
 * 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.