Interface PlexCommand

All Known Implementing Classes:
SimplePlexCommand

public interface PlexCommand
Public Brigadier command contract for Plex and Plex modules.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Supplies the running Plex API to commands that need API helpers.
    default void
    Supplies the owning module to commands that need module-owned resources.
    com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack>
    Builds the Brigadier command tree for this command.
    Returns the command definition.
    default List<String>
    Returns command aliases as a trimmed list.
    default String
    Returns the command description.
    default String
    Returns the primary command name.
    default String
    Returns the permission node required to use the command.
    Returns the command source required to run the command.
    default String
    Returns command usage text.
    static org.bukkit.entity.Player
     
  • Method Details

    • commandSpec

      CommandSpec commandSpec()
      Returns the command definition.
      Returns:
      command definition
    • resolveOnlinePlayer

      static org.bukkit.entity.Player resolveOnlinePlayer(String name)
    • buildCommand

      com.mojang.brigadier.tree.LiteralCommandNode<io.papermc.paper.command.brigadier.CommandSourceStack> buildCommand()
      Builds the Brigadier command tree for this command.
      Returns:
      root literal command node
    • bindApi

      default void bindApi(PlexApi api)
      Supplies the running Plex API to commands that need API helpers.

      The default implementation does not store the API.

      Parameters:
      api - running Plex API
    • bindModule

      default void bindModule(PlexModule module)
      Supplies the owning module to commands that need module-owned resources.
      Parameters:
      module - owning module
    • getName

      default String getName()
      Returns the primary command name.
      Returns:
      primary command name
    • getDescription

      default String getDescription()
      Returns the command description.
      Returns:
      command description
    • getUsage

      default String getUsage()
      Returns command usage text.
      Returns:
      command usage text with <command> replaced by the command name
    • getPermission

      default String getPermission()
      Returns the permission node required to use the command.
      Returns:
      permission node required to use the command
    • getRequiredSource

      default RequiredCommandSource getRequiredSource()
      Returns the command source required to run the command.
      Returns:
      command source required to run the command
    • getAliases

      default List<String> getAliases()
      Returns command aliases as a trimmed list.
      Returns:
      command aliases