Interface CommandSender

All Superinterfaces:
Audience, PermissionHandler, Pointered, Taggable, TagReadable, TagWritable
All Known Implementing Classes:
ConsoleSender, FakePlayer, Player, ServerSender

public interface CommandSender extends PermissionHandler, Audience, Taggable
Represents something which can send commands to the server.

Main implementations are Player and ConsoleSender.

  • Method Details

    • sendMessage

      default void sendMessage(@NotNull @NotNull String message)
      Sends a raw string message.
      Parameters:
      message - the message to send
    • sendMessage

      default void sendMessage(@NotNull @NotNull String @NotNull [] messages)
      Sends multiple raw string messages.
      Parameters:
      messages - the messages to send
    • isPlayer

      @Deprecated default boolean isPlayer()
      Deprecated.
      Gets if the sender is a Player.

      Consider using instanceof instead.

      Returns:
      true if 'this' is a player, false otherwise
    • isConsole

      @Deprecated default boolean isConsole()
      Deprecated.
      Gets if the sender is a ConsoleSender.

      Consider using instanceof instead.

      Returns:
      true if 'this' is the console, false otherwise
    • asPlayer

      @Deprecated default Player asPlayer()
      Deprecated.
      Casts this object to a Player. No checks are performed, ClassCastException can very much happen.
      Throws:
      ClassCastException - if 'this' is not a player
      See Also:
    • asConsole

      @Deprecated default ConsoleSender asConsole()
      Deprecated.
      Casts this object to a ConsoleSender. No checks are performed, ClassCastException can very much happen.
      Throws:
      ClassCastException - if 'this' is not a console sender
      See Also: