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 ConsoleSenderDeprecated.default PlayerasPlayer()Deprecated.default booleanDeprecated.default booleanisPlayer()Deprecated.default voidsendMessage(@NotNull String message) Sends a raw string message.default voidsendMessage(@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, 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, stopSoundMethods inherited from interface net.kyori.adventure.identity.Identified
identityMethods inherited from interface net.minestom.server.permission.PermissionHandler
addPermission, getAllPermissions, getPermission, hasPermission, hasPermission, hasPermission, removePermission, removePermissionMethods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
-
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
instanceofinstead.- Returns:
- true if 'this' is a player, false otherwise
-
isConsole
Deprecated.Gets if the sender is aConsoleSender.Consider using
instanceofinstead.- Returns:
- true if 'this' is the console, false otherwise
-
asPlayer
Deprecated.Casts this object to aPlayer. No checks are performed,ClassCastExceptioncan very much happen.- Throws:
ClassCastException- if 'this' is not a player- See Also:
-
asConsole
Deprecated.Casts this object to aConsoleSender. No checks are performed,ClassCastExceptioncan very much happen.- Throws:
ClassCastException- if 'this' is not a console sender- See Also:
-