Custom Commands (Minecraft)
Description
Create custom commands, either generally or specifically for the client.
Identifier
Refer to this via any of the following:
command/* Used as page default */
Command
minecraft.command
minecraft.Command
Minecraft.command
Minecraft.Command
vanilla.command
vanilla.Command
Vanilla.command
Vanilla.Command
mods.mc.command
mods.mc.Command
mods.vanilla.command
mods.vanilla.Command
mods.minecraft.command
mods.minecraft.Command
Adding Entries
Registers the given command to the client:
groovycommand.registerClientCommand(ICommand)
Registers the given command to the client in the format
name
,command
, withcommand
being a Closure taking 3 parameters,MinecraftServer server
,ICommandSender sender
, andString... args
:groovycommand.registerClientCommand(String, SimpleCommand.ICommand)
Registers the given command to the client in the format
name
,usage
,command
, withcommand
being a Closure taking 3 parameters,MinecraftServer server
,ICommandSender sender
, andString... args
:groovycommand.registerClientCommand(String, String, SimpleCommand.ICommand)
Registers the given command to the given command handler, in the format
handler
,command
:groovycommand.registerCommand(CommandHandler, ICommand)
Registers the given command:
groovycommand.registerCommand(ICommand)
Registers the given command in the format
name
,command
, withcommand
being a Closure taking 3 parameters,MinecraftServer server
,ICommandSender sender
, andString... args
:groovycommand.registerCommand(String, SimpleCommand.ICommand)
Registers the given command in the format
name
,usage
,command
, withcommand
being a Closure taking 3 parameters,MinecraftServer server
,ICommandSender sender
, andString... args
:groovycommand.registerCommand(String, String, SimpleCommand.ICommand)
Example
command.registerCommand('groovy_test', { server, sender, args -> sender.sendMessage('Hello from GroovyScript')})