Commands Registry
The CommandsRegistryManager is a singleton class responsible for managing the registration of commands across different platforms.
CoreCommand interface
Section titled “CoreCommand interface”package com.example.command;
public class MyCommand implements CoreCommand { @Override public void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext registry, Commands.CommandSelection context) { // Implement the command registration logic here }}Command Registration
Section titled “Command Registration”package com.example.command;
public class MyRegistrationExample { public static void register() { // If your mod extends AbstractCommonMod, you can use your mod's instance to access the CommandsRegistryManager MatthiesenCoreCommon.INSTANCE.getCommandsRegistryManager().registerCommand(new MyCommand()); }}