CommandRegistrationCallback

public interface CommandRegistrationCallback

Callback for when a server registers all commands.

To register some commands, you would register an event listener and implement the callback.

 CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { // For example, this command is only registered on an integrated server if (!dedicated) dispatcher.register(CommandManager.literal("integrated_command").executes(context -> {...})); })}; 

Functions

register
Link copied to clipboard
abstract void register(CommandDispatcher<ServerCommandSource> dispatcher, boolean dedicated)
Called when the server is registering commands.

Sources

jvm source
Link copied to clipboard