public interface CommandSource
createSource.| Modifier and Type | Method and Description |
|---|---|
default @NotNull org.bukkit.command.BlockCommandSender |
getBlock()
Gets the block executing command
|
default @NotNull com.datasiqn.resultapi.Result<org.bukkit.command.BlockCommandSender,String> |
getBlockChecked()
Same as
getBlock(), except checks if the sender is a command block and returns a Result |
default @NotNull org.bukkit.entity.Entity |
getEntity()
Gets the entity executing command
|
default @NotNull com.datasiqn.resultapi.Result<org.bukkit.entity.Entity,String> |
getEntityChecked()
Same as
getEntity(), except checks if the sender is an entity and returns a Result |
default @NotNull LocatableCommandSender |
getLocatable()
Gets the locatable sender executing command
|
default @NotNull com.datasiqn.resultapi.Result<LocatableCommandSender,String> |
getLocatableChecked()
Same as
getLocatable(), except checks if the sender is locatable and returns a Result |
default @NotNull org.bukkit.entity.Player |
getPlayer()
Gets the player executing command.
|
default @NotNull com.datasiqn.resultapi.Result<org.bukkit.entity.Player,String> |
getPlayerChecked()
Same as
getPlayer(), except checks if the sender is a player and returns a Result |
@NotNull org.bukkit.command.CommandSender |
getSender()
Gets the sender of the command
|
default boolean |
hasPermission(@NotNull org.bukkit.permissions.Permission permission)
Gets whether the source of the command has a permission or not
|
default boolean |
hasPermission(@Nullable String permission)
Gets whether the source of the command has a permission or not
|
default void |
sendMessage(String... messages)
Sends the command source a message
|
@NotNull default @NotNull org.bukkit.entity.Player getPlayer()
requiresPlayer.IllegalStateException - If the sender is not a player@NotNull default @NotNull com.datasiqn.resultapi.Result<org.bukkit.entity.Player,String> getPlayerChecked()
getPlayer(), except checks if the sender is a player and returns a ResultrequiresPlayer, use getPlayer() instead@NotNull default @NotNull org.bukkit.entity.Entity getEntity()
requiresEntity.IllegalStateException - If the sender is not an entity@NotNull default @NotNull com.datasiqn.resultapi.Result<org.bukkit.entity.Entity,String> getEntityChecked()
getEntity(), except checks if the sender is an entity and returns a ResultrequiresEntity, use getEntity() instead@NotNull default @NotNull org.bukkit.command.BlockCommandSender getBlock()
CommandLink.requiresBlock() requiresBlock}.IllegalStateException - If the sender is not a block@NotNull default @NotNull com.datasiqn.resultapi.Result<org.bukkit.command.BlockCommandSender,String> getBlockChecked()
getBlock(), except checks if the sender is a command block and returns a ResultCommandLink.requiresBlock() requiresCommandBlock}, use getBlock() instead@NotNull default @NotNull LocatableCommandSender getLocatable()
requiresLocatable.IllegalStateException - If the sender is not a locatable sender@NotNull default @NotNull com.datasiqn.resultapi.Result<LocatableCommandSender,String> getLocatableChecked()
getLocatable(), except checks if the sender is locatable and returns a ResultCommandLink.requiresLocatable() requiresCommandBlock}, use getLocatable() instead@NotNull @NotNull org.bukkit.command.CommandSender getSender()
default void sendMessage(@NotNull
String... messages)
messages - The messages to senddefault boolean hasPermission(@NotNull
@NotNull org.bukkit.permissions.Permission permission)
permission - The permissiontrue if the source has permission, false otherwisedefault boolean hasPermission(@Nullable
@Nullable String permission)
permission - The permissiontrue if the source has permission, false otherwiseCopyright © 2024. All rights reserved.