Interface BukkitCommandHandler

All Superinterfaces:
CommandHandler
All Known Implementing Classes:
BukkitHandler

public interface BukkitCommandHandler extends CommandHandler
Represents Bukkit's command handler implementation
  • Method Details

    • getBrigadier

      @NotNull @NotNull Optional<BukkitBrigadier> getBrigadier()
      Returns an optional BukkitBrigadier of this command handler.

      On versions that do not support Brigadier (i.e. 1.12.2 or earlier), this optional will be empty.

      Returns:
      The Brigadier accessor
    • isBrigadierSupported

      boolean isBrigadierSupported()
      Checks to see if the Brigadier command system is supported by the server.
      Returns:
      true if Brigadier is supported.
    • registerBrigadier

      BukkitCommandHandler registerBrigadier()
      Registers commands automatically on Minecraft's 1.13+ command system (so that you would get the colorful command completions!)

      Note that you should call this method after you've registered all your commands.

      This is effectively the same as getBrigadier().register(), and will have no effect when invoked on older versions.

      Returns:
      This command handler
    • enableAdventure

      void enableAdventure()
      Instantiates a BukkitAudiences internally and allows accessing APIs such as BukkitCommandActor.audience()
    • enableAdventure

      void enableAdventure(@NotNull @NotNull net.kyori.adventure.platform.bukkit.BukkitAudiences audiences)
      Uses the given BukkitAudiences for creating audiences for BukkitCommandActors. This allows accessing APIs such as BukkitCommandActor.audience(),
      Parameters:
      audiences - Audiences to use for command actors
    • getPlugin

      @NotNull @NotNull org.bukkit.plugin.Plugin getPlugin()
      Returns the plugin this command handler was registered for.
      Returns:
      The owning plugin
    • create

      @NotNull static @NotNull BukkitCommandHandler create(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Creates a new BukkitCommandHandler for the specified plugin
      Parameters:
      plugin - Plugin to create for
      Returns:
      The newly created command handler