Class AbstractTargetPlayerCommand

Direct Known Subclasses:
ChunkMaxSendRateCommand, ChunkResendCommand, ChunkShapeCommand, ChunkTrackerCommand, HitboxCollisionAddCommand.HitboxCollisionAddSelfCommand, HudManagerTestCommand, MapMarkersHideCommand, MapMarkersListCommand, MapMarkersRevealCommand, MountCheckCommand, PacketStatsCommand, ParticleSpawnCommand, PingCommand, PlayerCameraDemoActivateCommand, PlayerCameraDemoDeactivateCommand, PlayerCameraResetCommand, PlayerCameraSideScrollerCommand, PlayerCameraTopdownCommand, PlayerLivesClearCommand, PlayerLivesGetCommand, PlayerLivesSetCommand, PlayerResetCommand, PlayerStatsAddCommand, PlayerStatsDumpCommand, PlayerStatsGetCommand, PlayerStatsResetCommand, PlayerStatsSetCommand, PlayerStatsSetToMaxCommand, PlayerViewRadiusGetCommand, PlayerViewRadiusSetCommand, PlayerZoneCommand, ReferCommand, RepulsionAddCommand.RepulsionAddSelfCommand, RepulsionRemoveCommand.RepulsionRemoveSelfCommand, ReputationAddCommand, ReputationRankCommand, ReputationSetCommand, ReputationValueCommand, SoundPlay2DCommand, SoundPlay3DCommand, TeleportWorldCommand, WildernessDebugCommand, WorldMapViewRadiusGetCommand, WorldMapViewRadiusRemoveCommand, WorldMapViewRadiusSetCommand

public abstract class AbstractTargetPlayerCommand extends AbstractAsyncCommand
A command base that runs directly on the thread of the player's world. Allows for an optional target player argument.

If a target player argument is provided, the command will target that player. Otherwise, if the sender is a player, the command will target the sender. If neither condition is met, an error message is sent.

This command base ensures thread safety by executing on the world thread, and provides access to the target player's PlayerRef, Store, Ref, and World.

  • Constructor Details

    • AbstractTargetPlayerCommand

      public AbstractTargetPlayerCommand(@Nonnull String name, @Nonnull String description)
      Default Constructor for a AbstractTargetPlayerCommand instance.
      Parameters:
      name - The name of the command.
      description - The description of the command.
    • AbstractTargetPlayerCommand

      public AbstractTargetPlayerCommand(@Nonnull String name, @Nonnull String description, boolean requiresConfirmation)
      Constructor for a AbstractTargetPlayerCommand instance.
      Parameters:
      name - The name of the command.
      description - The description of the command.
      requiresConfirmation - Whether the command requires additional confirmation.
    • AbstractTargetPlayerCommand

      public AbstractTargetPlayerCommand(@Nonnull String description)
      This constructor is specifically only for variant commands, added with AbstractCommand.addUsageVariant(AbstractCommand)
      Parameters:
      description - The description of the command.
  • Method Details