☄️Command Builder
Create commands faster and easier
Overview
The CommandBuilder class simplifies the creation and management of custom commands in a Minecraft Bukkit server environment. It provides methods for setting command properties such as cooldown, permission, aliases, arguments, command function, and messages, allowing for flexible and customizable command behavior.
Constructor
CommandBuilder
CommandBuilderprivate CommandBuilder(JavaPlugin plugin)Initializes a new instance of the CommandBuilder class with the specified JavaPlugin instance.
Parameters
plugin: The JavaPlugin instance associated with the command builder.
Static Factory Method
create
createpublic static CommandBuilder create(JavaPlugin plugin, String commandName)Creates a new CommandBuilder instance with the specified JavaPlugin instance and command name.
Parameters
plugin: The JavaPlugin instance associated with the command builder.commandName: The name of the command to be created.
Methods
setCooldown
setCooldownSets the cooldown (in seconds) for the command.
setPermission
setPermissionSets the permission required to execute the command.
setArguments
setArgumentsSets the names of the arguments expected by the command.
setArgumentMapper
setArgumentMapperSets the function to map command arguments to a result message.
setCommandFunction
setCommandFunctionSets the function to execute when the command is executed.
setMessages
setMessagesSets the messages to be sent in response to various command conditions.
addAliases
addAliasesAdds aliases for the command.
build
buildBuilds and registers the command with the Bukkit server.
Notes
The
CommandBuilderclass allows for the creation of custom commands with configurable properties and behavior.Developers can specify cooldown, permission, arguments, command function, and messages to tailor the command to their specific requirements.
Custom commands created using this builder pattern can enhance server functionality and provide players with additional gameplay features and interactions.
Last updated