Class CommandBuilder

java.lang.Object
me.hsgamer.hscore.bukkit.command.CommandBuilder

public class CommandBuilder extends Object
A simple Command builder with command executor, tab completer and more
  • Method Details

    • newCommand

      @NotNull public static @NotNull CommandBuilder newCommand(@NotNull @NotNull String name)
      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

      @NotNull public @NotNull CommandBuilder setDescription(@Nullable @Nullable String description)
      Set the description
      Parameters:
      description - the description
      Returns:
      the command builder
    • setUsage

      @NotNull public @NotNull CommandBuilder setUsage(@Nullable @Nullable String usage)
      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

      @NotNull public @NotNull CommandBuilder setPermission(@Nullable @Nullable String permission)
      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

      @NotNull public @NotNull CommandBuilder setPlayerMessage(@Nullable @Nullable String playerMessage)
      Set the message when the sender is not a player
      Parameters:
      playerMessage - the message
      Returns:
      the command builder
    • setPlayerOnly

      @NotNull public @NotNull CommandBuilder setPlayerOnly()
      Enable player-only mode
      Returns:
      the command builder