Interface ActionSender
public interface ActionSender
Sender of an action, used as a bridge between console and players.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Send a chat message as this sender.void
dispatchCommand
(String command) Perform a command as this sender.getName()
Get the name of this sender.org.bukkit.entity.Player
Get the BukkitPlayer
.org.bukkit.command.CommandSender
Get the BukkitCommandSender
.Get the name of the world that the player is in.boolean
hasPermission
(String permission) Check whether the sender has a certain permission.boolean
isOp()
Get whether the player is an operator.boolean
isPlayer()
Check whether the sender is a player.void
sendMessage
(String message) 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
Get the BukkitPlayer
.- Returns:
- Bukkit
Player
if player, null otherwise.
-
getSender
org.bukkit.command.CommandSender getSender()Get the BukkitCommandSender
.- Returns:
- Bukkit
CommandSender
.
-
sendMessage
Send a message as this sender.- Parameters:
message
- Message to send.
-
hasPermission
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
Perform a command as this sender.- Parameters:
command
- Command to perform.
-
chat
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.
-