Package me.hsgamer.hscore.bukkit.command
Class CommandBuilder
java.lang.Object
me.hsgamer.hscore.bukkit.command.CommandBuilder
A simple Command builder with command executor, tab completer and more
-
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.command.Commandbuild()Build the final Commandstatic @NotNull CommandBuildernewCommand(@NotNull String name) Create a new command builder@NotNull CommandBuildersetDescription(@Nullable String description) Set the description@NotNull CommandBuildersetExecutor(@NotNull org.bukkit.command.CommandExecutor executor) Set the command executor@NotNull CommandBuildersetPermission(@Nullable String permission) Set the permission of the command@NotNull CommandBuildersetPermissionMessage(@Nullable String permissionMessage) Set the message when the sender doesn't have the permission@NotNull CommandBuildersetPlayerMessage(@Nullable String playerMessage) Set the message when the sender is not a player@NotNull CommandBuilderEnable player-only mode@NotNull CommandBuildersetTabCompleter(@Nullable org.bukkit.command.TabCompleter tabCompleter) Set the tab completer@NotNull CommandBuilderSet the usage
-
Method Details
-
newCommand
Create a new command builder- Parameters:
name- the command name- Returns:
- the command builder
-
build
@NotNull public @NotNull org.bukkit.command.Command build()Build the final Command- Returns:
- the final Command
-
setDescription
Set the description- Parameters:
description- the description- Returns:
- the command builder
-
setUsage
Set the usage- Parameters:
usage- the usage- Returns:
- the command builder
-
setExecutor
@NotNull public @NotNull CommandBuilder setExecutor(@NotNull @NotNull org.bukkit.command.CommandExecutor executor) Set the command executor- Parameters:
executor- the executor- Returns:
- the command builder
-
setTabCompleter
@NotNull public @NotNull CommandBuilder setTabCompleter(@Nullable @Nullable org.bukkit.command.TabCompleter tabCompleter) Set the tab completer- Parameters:
tabCompleter- the tab completer- Returns:
- the command builder
-
setPermission
Set the permission of the command- Parameters:
permission- the permission- Returns:
- the command builder
-
setPermissionMessage
@NotNull public @NotNull CommandBuilder setPermissionMessage(@Nullable @Nullable String permissionMessage) Set the message when the sender doesn't have the permission- Parameters:
permissionMessage- the message- Returns:
- the command builder
-
setPlayerMessage
Set the message when the sender is not a player- Parameters:
playerMessage- the message- Returns:
- the command builder
-
setPlayerOnly
Enable player-only mode- Returns:
- the command builder
-