Class Command

java.lang.Object
org.cloudburstmc.server.command.Command
Direct Known Subclasses:
BanCommand, BanIpCommand, BanListCommand, DebugPasteCommand, DefaultGamemodeCommand, DeopCommand, DifficultyCommand, EffectCommand, EnchantCommand, FormattedCommandAlias, GamemodeCommand, GameruleCommand, GarbageCollectorCommand, GiveCommand, HelpCommand, KickCommand, KillCommand, ListCommand, MeCommand, OpCommand, PardonCommand, PardonIpCommand, ParticleCommand, PluginCommand, PluginsCommand, SaveCommand, SaveOffCommand, SaveOnCommand, SayCommand, SeedCommand, SetBlockCommand, SetWorldSpawnCommand, SimpleCommand, SpawnpointCommand, StatusCommand, StopCommand, TeleportCommand, TellCommand, TimeCommand, TimingsCommand, TitleCommand, VersionCommand, WeatherCommand, WhitelistCommand, XpCommand

public abstract class Command extends Object
Base class for Commands. Plugins should extend PluginCommand and not this class.
Author:
MagicDroidX
  • Field Details

    • commandData

      protected final CommandData commandData
    • timing

      public Timing timing
  • Constructor Details

  • Method Details

    • execute

      public abstract boolean execute(org.cloudburstmc.api.command.CommandSender sender, String commandLabel, String[] args)
    • getName

      public String getName()
    • getRegisteredName

      public String getRegisteredName()
    • setRegisteredName

      public void setRegisteredName(String name)
    • getPermissions

      public List<String> getPermissions()
    • testPermission

      public boolean testPermission(org.cloudburstmc.api.command.CommandSender target)
    • testPermissionSilent

      public boolean testPermissionSilent(org.cloudburstmc.api.command.CommandSender target)
    • getLabel

      public String getLabel()
    • getAliases

      public String[] getAliases()
    • getPermissionMessage

      public String getPermissionMessage()
    • getDescription

      public String getDescription()
    • getUsage

      public String getUsage()
    • getCommandParameters

      public List<CommandParameter[]> getCommandParameters()
    • removeAlias

      public void removeAlias(String alias)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toNetwork

      public com.nukkitx.protocol.bedrock.data.command.CommandData toNetwork(CloudPlayer player)
      Generates the CommandData used in AvailableCommandsPacket which sends the Command data to a client. If the player does not have permission to use this Command, null will be returned.
      Parameters:
      player - Player to have command packet sent
      Returns:
      CommandData|null