Package net.minestom.server.command
Interface CommandSender
- All Superinterfaces:
Audience
,Identified
,PermissionHandler
,Pointered
,Taggable
,TagReadable
,TagWritable
- All Known Implementing Classes:
ConsoleSender
,Player
,ServerSender
Represents something which can send commands to the server.
Main implementations are Player
and ConsoleSender
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConsoleSender
Deprecated.default Player
asPlayer()
Deprecated.default boolean
Deprecated.default boolean
isPlayer()
Deprecated.default void
sendMessage
(@NotNull String message) Sends a raw string message.default void
sendMessage
(@NotNull String @NotNull [] messages) Sends multiple raw string messages.Methods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface net.kyori.adventure.identity.Identified
identity
Methods inherited from interface net.minestom.server.permission.PermissionHandler
addPermission, getAllPermissions, getPermission, hasPermission, hasPermission, hasPermission, removePermission, removePermission
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
Methods inherited from interface net.minestom.server.tag.Taggable
getAndSetTag, getAndUpdateTag, getTag, hasTag, removeTag, setTag, tagHandler, updateAndGetTag, updateTag
-
Method Details
-
sendMessage
Sends a raw string message.- Parameters:
message
- the message to send
-
sendMessage
Sends multiple raw string messages.- Parameters:
messages
- the messages to send
-
isPlayer
Deprecated.Gets if the sender is aPlayer
.Consider using
instanceof
instead.- Returns:
- true if 'this' is a player, false otherwise
-
isConsole
Deprecated.Gets if the sender is aConsoleSender
.Consider using
instanceof
instead.- Returns:
- true if 'this' is the console, false otherwise
-
asPlayer
Deprecated.Casts this object to aPlayer
. No checks are performed,ClassCastException
can very much happen.- Throws:
ClassCastException
- if 'this' is not a player- See Also:
-
asConsole
Deprecated.Casts this object to aConsoleSender
. No checks are performed,ClassCastException
can very much happen.- Throws:
ClassCastException
- if 'this' is not a console sender- See Also:
-