Package org.bukkit.command
Interface MessageCommandSender
- All Superinterfaces:
Audience
,CommandSender
,Permissible
,Pointered
,ServerOperator
- All Known Implementing Classes:
BufferedCommandSender
,TimingsReportListener
For when all you care about is just messaging
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.command.CommandSender
CommandSender.Spigot
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull PermissionAttachment
addAttachment
(@NotNull Plugin plugin) Adds a new emptyPermissionAttachment
to this objectdefault @NotNull PermissionAttachment
addAttachment
(@NotNull Plugin plugin, int ticks) Temporarily adds a new emptyPermissionAttachment
to this objectdefault @NotNull PermissionAttachment
addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value) Adds a newPermissionAttachment
with a single permission by name and valuedefault @NotNull PermissionAttachment
addAttachment
(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) Temporarily adds a newPermissionAttachment
with a single permission by name and valuedefault @NotNull Set<PermissionAttachmentInfo>
Gets a set containing all of the permissions currently in effect by this objectgetName()
Gets the name of this command senderReturns the server instance that this command is running ondefault boolean
hasPermission
(@NotNull String name) Gets the value of the specified permission, if set.default boolean
hasPermission
(@NotNull Permission perm) Gets the value of the specified permission, if set.default boolean
isOp()
Checks if this object is a server operatordefault boolean
isPermissionSet
(@NotNull String name) Checks if this object contains an override for the specified permission, by fully qualified namedefault boolean
Checks if this object contains an override for the specifiedPermission
name()
Gets the name of this command senderdefault void
Recalculates the permissions for this object, if the attachments have changed values.default void
removeAttachment
(@NotNull PermissionAttachment attachment) Removes the givenPermissionAttachment
from this objectdefault void
sendMessage
(@NotNull String[] messages) Sends this sender multiple messagesdefault void
sendMessage
(@Nullable UUID sender, @NotNull String message) Sends this sender a messagedefault void
sendMessage
(@Nullable UUID sender, @NotNull String[] messages) Sends this sender multiple messagesdefault void
setOp
(boolean value) Sets the operator status of this objectdefault @NotNull CommandSender.Spigot
spigot()
Methods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessage
Methods inherited from interface org.bukkit.permissions.Permissible
permissionValue, permissionValue
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
-
Method Details
-
sendMessage
Description copied from interface:CommandSender
Sends this sender multiple messages- Specified by:
sendMessage
in interfaceCommandSender
- Parameters:
messages
- An array of messages to be displayed- See Also:
-
sendMessage
Description copied from interface:CommandSender
Sends this sender a message- Specified by:
sendMessage
in interfaceCommandSender
- Parameters:
sender
- The sender of this messagemessage
- Message to be displayed- See Also:
-
sendMessage
Description copied from interface:CommandSender
Sends this sender multiple messages- Specified by:
sendMessage
in interfaceCommandSender
- Parameters:
sender
- The sender of this messagemessages
- An array of messages to be displayed- See Also:
-
getServer
Description copied from interface:CommandSender
Returns the server instance that this command is running on- Specified by:
getServer
in interfaceCommandSender
- Returns:
- Server instance
-
name
Description copied from interface:CommandSender
Gets the name of this command sender- Specified by:
name
in interfaceCommandSender
- Returns:
- Name of the sender
-
getName
Description copied from interface:CommandSender
Gets the name of this command sender- Specified by:
getName
in interfaceCommandSender
- Returns:
- Name of the sender
-
isOp
default boolean isOp()Description copied from interface:ServerOperator
Checks if this object is a server operator- Specified by:
isOp
in interfaceServerOperator
- Returns:
- true if this is an operator, otherwise false
-
setOp
default void setOp(boolean value) Description copied from interface:ServerOperator
Sets the operator status of this object- Specified by:
setOp
in interfaceServerOperator
- Parameters:
value
- New operator value
-
isPermissionSet
Description copied from interface:Permissible
Checks if this object contains an override for the specified permission, by fully qualified name- Specified by:
isPermissionSet
in interfacePermissible
- Parameters:
name
- Name of the permission- Returns:
- true if the permission is set, otherwise false
-
isPermissionSet
Description copied from interface:Permissible
Checks if this object contains an override for the specifiedPermission
- Specified by:
isPermissionSet
in interfacePermissible
- Parameters:
perm
- Permission to check- Returns:
- true if the permission is set, otherwise false
-
hasPermission
Description copied from interface:Permissible
Gets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned.
- Specified by:
hasPermission
in interfacePermissible
- Parameters:
name
- Name of the permission- Returns:
- Value of the permission
-
hasPermission
Description copied from interface:Permissible
Gets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned
- Specified by:
hasPermission
in interfacePermissible
- Parameters:
perm
- Permission to get- Returns:
- Value of the permission
-
addAttachment
@NotNull default @NotNull PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, boolean value) Description copied from interface:Permissible
Adds a newPermissionAttachment
with a single permission by name and value- Specified by:
addAttachment
in interfacePermissible
- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledname
- Name of the permission to attachvalue
- Value of the permission- Returns:
- The PermissionAttachment that was just created
-
addAttachment
Description copied from interface:Permissible
Adds a new emptyPermissionAttachment
to this object- Specified by:
addAttachment
in interfacePermissible
- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabled- Returns:
- The PermissionAttachment that was just created
-
addAttachment
@NotNull default @NotNull PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, @NotNull @NotNull String name, boolean value, int ticks) Description copied from interface:Permissible
Temporarily adds a newPermissionAttachment
with a single permission by name and value- Specified by:
addAttachment
in interfacePermissible
- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledname
- Name of the permission to attachvalue
- Value of the permissionticks
- Amount of ticks to automatically remove this attachment after- Returns:
- The PermissionAttachment that was just created
-
addAttachment
@NotNull default @NotNull PermissionAttachment addAttachment(@NotNull @NotNull Plugin plugin, int ticks) Description copied from interface:Permissible
Temporarily adds a new emptyPermissionAttachment
to this object- Specified by:
addAttachment
in interfacePermissible
- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledticks
- Amount of ticks to automatically remove this attachment after- Returns:
- The PermissionAttachment that was just created
-
removeAttachment
Description copied from interface:Permissible
Removes the givenPermissionAttachment
from this object- Specified by:
removeAttachment
in interfacePermissible
- Parameters:
attachment
- Attachment to remove
-
recalculatePermissions
default void recalculatePermissions()Description copied from interface:Permissible
Recalculates the permissions for this object, if the attachments have changed values.This should very rarely need to be called from a plugin.
- Specified by:
recalculatePermissions
in interfacePermissible
-
getEffectivePermissions
Description copied from interface:Permissible
Gets a set containing all of the permissions currently in effect by this object- Specified by:
getEffectivePermissions
in interfacePermissible
- Returns:
- Set of currently effective permissions
-
spigot
- Specified by:
spigot
in interfaceCommandSender
-