Class GeyserCommand

java.lang.Object
org.geysermc.geyser.command.GeyserCommand
All Implemented Interfaces:
org.geysermc.geyser.api.command.Command
Direct Known Subclasses:
AdvancedTooltipsCommand, AdvancementsCommand, ConnectionTestCommand, DumpCommand, ExtensionsCommand, GeyserExtensionCommand, HelpCommand, ListCommand, OffhandCommand, ReloadCommand, SettingsCommand, StatisticsCommand, StopCommand, VersionCommand

public abstract class GeyserCommand extends Object implements org.geysermc.geyser.api.command.Command
  • Field Details

    • name

      protected final String name
    • description

      protected final String description
      The description of the command - will attempt to be translated.
    • permission

      protected final String permission
  • Constructor Details

    • GeyserCommand

      public GeyserCommand(String name, String description, String permission)
  • Method Details

    • execute

      public abstract void execute(@Nullable GeyserSession session, GeyserCommandSource sender, String[] args)
    • isExecutableOnConsole

      public boolean isExecutableOnConsole()
      If false, hides the command from being shown on the Geyser Standalone GUI.
      Specified by:
      isExecutableOnConsole in interface org.geysermc.geyser.api.command.Command
      Returns:
      true if the command can be run on the server console
    • subCommands

      public @NonNull List<String> subCommands()
      Used in the GUI to know what subcommands can be run
      Specified by:
      subCommands in interface org.geysermc.geyser.api.command.Command
      Returns:
      a list of all possible subcommands, or empty if none.
    • setAliases

      public void setAliases(List<String> aliases)
    • isSuggestedOpOnly

      public boolean isSuggestedOpOnly()
      Used for permission defaults on server implementations.
      Specified by:
      isSuggestedOpOnly in interface org.geysermc.geyser.api.command.Command
      Returns:
      if this command is designated to be used only by server operators.
    • name

      public String name()
      Specified by:
      name in interface org.geysermc.geyser.api.command.Command
    • description

      public String description()
      The description of the command - will attempt to be translated.
      Specified by:
      description in interface org.geysermc.geyser.api.command.Command
    • permission

      public String permission()
      Specified by:
      permission in interface org.geysermc.geyser.api.command.Command
    • aliases

      public List<String> aliases()
      Specified by:
      aliases in interface org.geysermc.geyser.api.command.Command