Custom Commands (Minecraft)
Description
Create custom commands, either generally or specifically for the client.
Identifier
The identifier minecraft.command will be used as the default on this page.
All Identifiers
Any of these can be used to refer to this compat:
mc.command
mc.Command
MC.command
MC.Command
vanilla.command
vanilla.Command
Vanilla.command
Vanilla.Command
minecraft.command/* Used as page default */
minecraft.Command
Minecraft.command
Minecraft.Command
mods.mc.command
mods.mc.Command
mods.MC.command
mods.MC.Command
mods.vanilla.command
mods.vanilla.Command
mods.Vanilla.command
mods.Vanilla.Command
mods.minecraft.command
mods.minecraft.Command
mods.Minecraft.command
mods.Minecraft.CommandAdding Entries
Registers the given command:
groovyminecraft.command.registerCommand(ICommand)Registers the given command to the given command handler, in the format
handler,command:groovyminecraft.command.registerCommand(CommandHandler, ICommand)Registers the given command in the format
name,command, withcommandbeing a Closure taking 3 parameters,MinecraftServer server,ICommandSender sender, andString... args:groovyminecraft.command.registerCommand(String, SimpleCommand.ICommand)Registers the given command in the format
name,usage,command, withcommandbeing a Closure taking 3 parameters,MinecraftServer server,ICommandSender sender, andString... args:groovyminecraft.command.registerCommand(String, String, SimpleCommand.ICommand)Registers the given command to the client:
groovyminecraft.command.registerClientCommand(ICommand)Registers the given command to the client in the format
name,command, withcommandbeing a Closure taking 3 parameters,MinecraftServer server,ICommandSender sender, andString... args:groovyminecraft.command.registerClientCommand(String, SimpleCommand.ICommand)Registers the given command to the client in the format
name,usage,command, withcommandbeing a Closure taking 3 parameters,MinecraftServer server,ICommandSender sender, andString... args:groovyminecraft.command.registerClientCommand(String, String, SimpleCommand.ICommand)
Example
minecraft.command.registerCommand('groovy_test', { server, sender, args -> sender.sendMessage('Hello from GroovyScript')})