Package net.minecraft.server.function
Class CommandFunctionManager
java.lang.Object
net.minecraft.server.function.CommandFunctionManager
The command function manager implements execution of functions, like that from
 the 
function command.- Mappings:
- Namespace - Name - official - abo- intermediary - net/minecraft/class_2991- named - net/minecraft/server/function/CommandFunctionManager
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classprivate classAn active execution of functions.static interfaceA tree-visitor-like tracer, useful for gaining insights on function execution.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe active execution within this manager.private booleanWhether this command function manager has just loaded and should run all functions in theminecraft:loadfunction tag.private static final Identifierprivate FunctionLoaderThe source of functions for this command function manager.private static final TextA localized piece of text indicating that calling the debug command to debug functions from within a function is not supported.(package private) final MinecraftServerprivate static final Identifierprivate List<CommandFunction>A list ofminecraft:ticktag functions to run on every tick.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintexecute(CommandFunction function, ServerCommandSource source) Executes a function.intexecute(CommandFunction function, ServerCommandSource source, @Nullable CommandFunctionManager.Tracer tracer) Executes a function.private voidexecuteAll(Collection<CommandFunction> functions, Identifier label) com.mojang.brigadier.CommandDispatcher<ServerCommandSource>intReturns the command source to execute scheduled functions.getTag(Identifier id) private voidload(FunctionLoader loader) voidsetFunctions(FunctionLoader loader) Sets the functions that this command function manager will use in executions.voidtick()
- 
Field Details- 
NO_TRACE_IN_FUNCTION_TEXTA localized piece of text indicating that calling the debug command to debug functions from within a function is not supported.- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a:Lrq;- intermediary - field_33542- Lnet/minecraft/class_2991;field_33542:Lnet/minecraft/class_2561;- named - NO_TRACE_IN_FUNCTION_TEXT- Lnet/minecraft/server/function/CommandFunctionManager;NO_TRACE_IN_FUNCTION_TEXT:Lnet/minecraft/text/Text;
 
- 
TICK_TAG_ID- Mappings:
- Namespace - Name - Mixin selector - official - b- Labo;b:Labb;- intermediary - field_13417- Lnet/minecraft/class_2991;field_13417:Lnet/minecraft/class_2960;- named - TICK_TAG_ID- Lnet/minecraft/server/function/CommandFunctionManager;TICK_TAG_ID:Lnet/minecraft/util/Identifier;
 
- 
LOAD_TAG_ID- Mappings:
- Namespace - Name - Mixin selector - official - c- Labo;c:Labb;- intermediary - field_13412- Lnet/minecraft/class_2991;field_13412:Lnet/minecraft/class_2960;- named - LOAD_TAG_ID- Lnet/minecraft/server/function/CommandFunctionManager;LOAD_TAG_ID:Lnet/minecraft/util/Identifier;
 
- 
server- Mappings:
- Namespace - Name - Mixin selector - official - d- Labo;d:Lnet/minecraft/server/MinecraftServer;- intermediary - field_13419- Lnet/minecraft/class_2991;field_13419:Lnet/minecraft/server/MinecraftServer;- named - server- Lnet/minecraft/server/function/CommandFunctionManager;server:Lnet/minecraft/server/MinecraftServer;
 
- 
executionThe active execution within this manager.- Mappings:
- Namespace - Name - Mixin selector - official - e- Labo;e:Labo$a;- intermediary - field_33543- Lnet/minecraft/class_2991;field_33543:Lnet/minecraft/class_2991$class_6345;- named - execution- Lnet/minecraft/server/function/CommandFunctionManager;execution:Lnet/minecraft/server/function/CommandFunctionManager$Execution;
 
- 
tickFunctionsA list ofminecraft:ticktag functions to run on every tick. Set up on load, this is more efficient than polling the tag from theloaderevery tick.- Mappings:
- Namespace - Name - Mixin selector - official - f- Labo;f:Ljava/util/List;- intermediary - field_13418- Lnet/minecraft/class_2991;field_13418:Ljava/util/List;- named - tickFunctions- Lnet/minecraft/server/function/CommandFunctionManager;tickFunctions:Ljava/util/List;
 
- 
justLoadedprivate boolean justLoadedWhether this command function manager has just loaded and should run all functions in theminecraft:loadfunction tag.- Mappings:
- Namespace - Name - Mixin selector - official - g- Labo;g:Z- intermediary - field_13422- Lnet/minecraft/class_2991;field_13422:Z- named - justLoaded- Lnet/minecraft/server/function/CommandFunctionManager;justLoaded:Z
 
- 
loaderThe source of functions for this command function manager.- Mappings:
- Namespace - Name - Mixin selector - official - h- Labo;h:Labn;- intermediary - field_25333- Lnet/minecraft/class_2991;field_25333:Lnet/minecraft/class_5349;- named - loader- Lnet/minecraft/server/function/CommandFunctionManager;loader:Lnet/minecraft/server/function/FunctionLoader;
 
 
- 
- 
Constructor Details- 
CommandFunctionManager- Mappings:
- Namespace - Name - Mixin selector - official - <init>- Labo;<init>(Lnet/minecraft/server/MinecraftServer;Labn;)V- intermediary - <init>- Lnet/minecraft/class_2991;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/class_5349;)V- named - <init>- Lnet/minecraft/server/function/CommandFunctionManager;<init>(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/server/function/FunctionLoader;)V
 
 
- 
- 
Method Details- 
getMaxCommandChainLengthpublic int getMaxCommandChainLength()- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a()I- intermediary - method_12902- Lnet/minecraft/class_2991;method_12902()I- named - getMaxCommandChainLength- Lnet/minecraft/server/function/CommandFunctionManager;getMaxCommandChainLength()I
 
- 
getDispatcher- Mappings:
- Namespace - Name - Mixin selector - official - b- Labo;b()Lcom/mojang/brigadier/CommandDispatcher;- intermediary - method_12900- Lnet/minecraft/class_2991;method_12900()Lcom/mojang/brigadier/CommandDispatcher;- named - getDispatcher- Lnet/minecraft/server/function/CommandFunctionManager;getDispatcher()Lcom/mojang/brigadier/CommandDispatcher;
 
- 
tickpublic void tick()- Mappings:
- Namespace - Name - Mixin selector - official - c- Labo;c()V- intermediary - method_18699- Lnet/minecraft/class_2991;method_18699()V- named - tick- Lnet/minecraft/server/function/CommandFunctionManager;tick()V
 
- 
executeAll- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a(Ljava/util/Collection;Labb;)V- intermediary - method_29460- Lnet/minecraft/class_2991;method_29460(Ljava/util/Collection;Lnet/minecraft/class_2960;)V- named - executeAll- Lnet/minecraft/server/function/CommandFunctionManager;executeAll(Ljava/util/Collection;Lnet/minecraft/util/Identifier;)V
 
- 
executeExecutes a function.This is same as calling execute(function, source, null).- Parameters:
- function- the function
- source- the command source to execute with
- Returns:
- the command output value
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a(Ldm;Ldr;)I- intermediary - method_12904- Lnet/minecraft/class_2991;method_12904(Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;)I- named - execute- Lnet/minecraft/server/function/CommandFunctionManager;execute(Lnet/minecraft/server/function/CommandFunction;Lnet/minecraft/server/command/ServerCommandSource;)I
 
- 
executepublic int execute(CommandFunction function, ServerCommandSource source, @Nullable @Nullable CommandFunctionManager.Tracer tracer) Executes a function. This may have two cases: new or recursive.In a new execution, the execution == null, and a customtracercan be specified. The return value indicates the number of commands and nested functions ran.In a recursive execution, execution != null. It is required thattracer == null, or the execution reports an error and is skipped. The return value is0.- Parameters:
- function- the function
- source- the command source to execute with
- tracer- a tracer for a non-recursive function execution
- Returns:
- a non-zero value for a new execution, or 0for a recursive execution
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a(Ldm;Ldr;Labo$c;)I- intermediary - method_36341- Lnet/minecraft/class_2991;method_36341(Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;Lnet/minecraft/class_2991$class_6346;)I- named - execute- Lnet/minecraft/server/function/CommandFunctionManager;execute(Lnet/minecraft/server/function/CommandFunction;Lnet/minecraft/server/command/ServerCommandSource;Lnet/minecraft/server/function/CommandFunctionManager$Tracer;)I
 
- 
setFunctionsSets the functions that this command function manager will use in executions.- Parameters:
- loader- the new loader functions will be taken from
- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a(Labn;)V- intermediary - method_29461- Lnet/minecraft/class_2991;method_29461(Lnet/minecraft/class_5349;)V- named - setFunctions- Lnet/minecraft/server/function/CommandFunctionManager;setFunctions(Lnet/minecraft/server/function/FunctionLoader;)V
 
- 
load- Mappings:
- Namespace - Name - Mixin selector - official - b- Labo;b(Labn;)V- intermediary - method_29773- Lnet/minecraft/class_2991;method_29773(Lnet/minecraft/class_5349;)V- named - load- Lnet/minecraft/server/function/CommandFunctionManager;load(Lnet/minecraft/server/function/FunctionLoader;)V
 
- 
getScheduledCommandSourceReturns the command source to execute scheduled functions. Scheduled functions are those from the/schedulecommand and those from theminecraft:ticktag.This command source has permission level 2 and is silent compared to the server's command source. - Returns:
- the command source to execute scheduled functions
- Mappings:
- Namespace - Name - Mixin selector - official - d- Labo;d()Ldr;- intermediary - method_12899- Lnet/minecraft/class_2991;method_12899()Lnet/minecraft/class_2168;- named - getScheduledCommandSource- Lnet/minecraft/server/function/CommandFunctionManager;getScheduledCommandSource()Lnet/minecraft/server/command/ServerCommandSource;
 
- 
getFunction- Mappings:
- Namespace - Name - Mixin selector - official - a- Labo;a(Labb;)Ljava/util/Optional;- intermediary - method_12905- Lnet/minecraft/class_2991;method_12905(Lnet/minecraft/class_2960;)Ljava/util/Optional;- named - getFunction- Lnet/minecraft/server/function/CommandFunctionManager;getFunction(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
 
- 
getTag- Mappings:
- Namespace - Name - Mixin selector - official - b- Labo;b(Labb;)Ljava/util/Collection;- intermediary - method_29462- Lnet/minecraft/class_2991;method_29462(Lnet/minecraft/class_2960;)Ljava/util/Collection;- named - getTag- Lnet/minecraft/server/function/CommandFunctionManager;getTag(Lnet/minecraft/util/Identifier;)Ljava/util/Collection;
 
- 
getAllFunctions- Mappings:
- Namespace - Name - Mixin selector - official - e- Labo;e()Ljava/lang/Iterable;- intermediary - method_29463- Lnet/minecraft/class_2991;method_29463()Ljava/lang/Iterable;- named - getAllFunctions- Lnet/minecraft/server/function/CommandFunctionManager;getAllFunctions()Ljava/lang/Iterable;
 
- 
getFunctionTags- Mappings:
- Namespace - Name - Mixin selector - official - f- Labo;f()Ljava/lang/Iterable;- intermediary - method_29464- Lnet/minecraft/class_2991;method_29464()Ljava/lang/Iterable;- named - getFunctionTags- Lnet/minecraft/server/function/CommandFunctionManager;getFunctionTags()Ljava/lang/Iterable;
 
 
-