Interface ActionSender


public interface ActionSender
Sender of an action, used as a bridge between console and players.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    chat(String message)
    Send a chat message as this sender.
    void
    Perform a command as this sender.
    Get the name of this sender.
    org.bukkit.entity.Player
    Get the Bukkit Player.
    org.bukkit.command.CommandSender
    Get the Bukkit CommandSender.
    Get the name of the world that the player is in.
    boolean
    hasPermission(String permission)
    Check whether the sender has a certain permission.
    boolean
    Get whether the player is an operator.
    boolean
    Check whether the sender is a player.
    void
    Send a message as this sender.
  • Method Details

    • isPlayer

      boolean isPlayer()
      Check whether the sender is a player.
      Returns:
      True if sender is a player, false otherwise.
    • getPlayer

      @Nullable org.bukkit.entity.Player getPlayer()
      Get the Bukkit Player.
      Returns:
      Bukkit Player if player, null otherwise.
    • getSender

      org.bukkit.command.CommandSender getSender()
      Get the Bukkit CommandSender.
      Returns:
      Bukkit CommandSender.
    • sendMessage

      void sendMessage(String message)
      Send a message as this sender.
      Parameters:
      message - Message to send.
    • hasPermission

      boolean hasPermission(String permission)
      Check whether the sender has a certain permission. If the sender is the console, this returns true.
      Parameters:
      permission - Permission to check.
      Returns:
      True when permission, false otherwise.
    • dispatchCommand

      void dispatchCommand(String command)
      Perform a command as this sender.
      Parameters:
      command - Command to perform.
    • chat

      void chat(String message)
      Send a chat message as this sender.
      Parameters:
      message - Message to send.
    • getName

      String getName()
      Get the name of this sender.
      Returns:
      Name of the sender.
    • isOp

      boolean isOp()
      Get whether the player is an operator. If the sender is the console, this returns true.
      Returns:
      True if OP, false otherwise.
    • getWorldName

      String getWorldName()
      Get the name of the world that the player is in.
      Returns:
      World name of the player.