CLASS net/minecraft/class_2991 net/minecraft/server/function/CommandFunctionManager COMMENT The command function manager implements execution of functions, like that from COMMENT the {@code function} command. FIELD field_13412 LOAD_TAG_ID Lnet/minecraft/class_2960; FIELD field_13417 TICK_TAG_ID Lnet/minecraft/class_2960; FIELD field_13418 tickFunctions Ljava/util/List; COMMENT A list of {@code minecraft:tick} tag functions to run on every tick. Set up on COMMENT load, this is more efficient than polling the tag from the {@link #loader} COMMENT every tick. FIELD field_13419 server Lnet/minecraft/server/MinecraftServer; FIELD field_13422 justLoaded Z COMMENT Whether this command function manager has just {@linkplain #load(FunctionLoader) COMMENT loaded} and should run all functions in the {@code minecraft:load} function tag. FIELD field_25333 loader Lnet/minecraft/class_5349; COMMENT The source of functions for this command function manager. FIELD field_33542 NO_TRACE_IN_FUNCTION_TEXT Lnet/minecraft/class_2561; COMMENT A localized piece of text indicating that calling the debug command to debug COMMENT functions from within a function is not supported. FIELD field_33543 execution Lnet/minecraft/class_2991$class_6345; COMMENT The active execution within this manager. METHOD (Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/class_5349;)V ARG 1 server ARG 2 loader METHOD method_12899 getScheduledCommandSource ()Lnet/minecraft/class_2168; COMMENT {@return the command source to execute scheduled functions} Scheduled functions COMMENT are those from the {@code /schedule} command and those from the {@code COMMENT minecraft:tick} tag. COMMENT COMMENT

This command source {@linkplain ServerCommandSource#hasPermissionLevel(int) COMMENT has permission level 2} and is {@linkplain ServerCommandSource#withSilent() COMMENT silent} compared to the server's {@linkplain MinecraftServer#getCommandSource() COMMENT command source}. METHOD method_12900 getDispatcher ()Lcom/mojang/brigadier/CommandDispatcher; METHOD method_12902 getMaxCommandChainLength ()I METHOD method_12904 execute (Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;)I COMMENT Executes a function. COMMENT COMMENT

This is same as calling {@link #execute(CommandFunction, ServerCommandSource, COMMENT Tracer) execute(function, source, null)}. COMMENT COMMENT @return the command output value COMMENT @see #execute(CommandFunction, ServerCommandSource, Tracer) ARG 1 function COMMENT the function ARG 2 source COMMENT the command source to execute with METHOD method_12905 getFunction (Lnet/minecraft/class_2960;)Ljava/util/Optional; ARG 1 id METHOD method_18699 tick ()V METHOD method_29460 executeAll (Ljava/util/Collection;Lnet/minecraft/class_2960;)V ARG 1 functions ARG 2 label METHOD method_29461 setFunctions (Lnet/minecraft/class_5349;)V COMMENT Sets the functions that this command function manager will use in executions. ARG 1 loader COMMENT the new loader functions will be taken from METHOD method_29462 getTag (Lnet/minecraft/class_2960;)Lnet/minecraft/class_3494; ARG 1 id METHOD method_29463 getAllFunctions ()Ljava/lang/Iterable; METHOD method_29464 getFunctionTags ()Ljava/lang/Iterable; METHOD method_29773 load (Lnet/minecraft/class_5349;)V ARG 1 loader METHOD method_36341 execute (Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;Lnet/minecraft/class_2991$class_6346;)I COMMENT Executes a function. This may have two cases: new or recursive. COMMENT COMMENT

In a new execution, the {@link #execution execution == null}, and a custom COMMENT {@code tracer} can be specified. The return value indicates the number of COMMENT commands and nested functions ran. COMMENT COMMENT

In a recursive execution, {@link #execution execution != null}. It is COMMENT required that {@code tracer == null}, or the execution reports an error and is COMMENT skipped. The return value is {@code 0}. COMMENT COMMENT @return a non-zero value for a new execution, or {@code 0} for a recursive COMMENT execution COMMENT @see #execute(CommandFunction, ServerCommandSource) ARG 1 function COMMENT the function ARG 2 source COMMENT the command source to execute with ARG 3 tracer COMMENT a tracer for a non-recursive function execution CLASS class_2992 Entry FIELD field_13424 source Lnet/minecraft/class_2168; FIELD field_13425 element Lnet/minecraft/class_2158$class_2161; FIELD field_33549 depth I METHOD (Lnet/minecraft/class_2168;ILnet/minecraft/class_2158$class_2161;)V ARG 1 source ARG 2 depth ARG 3 element METHOD method_12914 execute (Lnet/minecraft/class_2991;Ljava/util/Deque;ILnet/minecraft/class_2991$class_6346;)V ARG 1 manager ARG 2 entries ARG 3 maxChainLength ARG 4 tracer CLASS class_6345 Execution COMMENT An active execution of functions. It uses two deques to simulate a stack for a COMMENT depth-first expansion of functions, as the function call stack depth may exceed COMMENT the allowed JVM stack size. COMMENT COMMENT @see CommandFunctionManager#execution FIELD field_33545 depth I FIELD field_33546 tracer Lnet/minecraft/class_2991$class_6346; FIELD field_33547 queue Ljava/util/Deque; FIELD field_33548 waitlist Ljava/util/List; METHOD (Lnet/minecraft/class_2991;Lnet/minecraft/class_2991$class_6346;)V ARG 2 tracer METHOD method_36343 recursiveRun (Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;)V COMMENT Handles a recursive case in {@link CommandFunctionManager#execute(CommandFunction, COMMENT ServerCommandSource, CommandFunctionManager.Tracer)}. COMMENT COMMENT

This effectively swaps an entry with a command element with {@code /function} COMMENT command at the head of the deque with another entry with a function element COMMENT containing the actual command elements referenced in that function. ARG 1 function COMMENT the function ARG 2 source COMMENT the command source METHOD method_36344 reportError (Ljava/lang/String;)V ARG 1 message METHOD method_36346 run (Lnet/minecraft/class_2158;Lnet/minecraft/class_2168;)I COMMENT Handles a new case in {@link CommandFunctionManager#execute(CommandFunction, COMMENT ServerCommandSource, CommandFunctionManager.Tracer)}. COMMENT COMMENT @return a value for the command result ARG 1 function COMMENT the function ARG 2 source COMMENT the command source CLASS class_6346 Tracer COMMENT A tree-visitor-like tracer, useful for gaining insights on function execution. METHOD method_36349 traceCommandStart (ILjava/lang/String;)V ARG 1 depth ARG 2 command METHOD method_36350 traceCommandEnd (ILjava/lang/String;I)V ARG 1 depth ARG 2 command ARG 3 result METHOD method_36351 traceFunctionCall (ILnet/minecraft/class_2960;I)V ARG 1 depth ARG 2 function ARG 3 size METHOD method_36352 traceError (ILjava/lang/String;)V ARG 1 depth ARG 2 message