Package org.geysermc.geyser.api.command
Interface CommandSource
- All Known Subinterfaces:
GeyserConnection
public interface CommandSource
Represents an instance capable of sending commands.
-
Method Summary
Modifier and TypeMethodDescription@Nullable GeyserConnectionbooleanhasPermission(String permission) Checks if this command source has the given permissionbooleanIf this source is the console.locale()Returns the locale of the command source.name()The name of the command source.@Nullable UUIDvoidsendMessage(@NonNull String message) Sends the given message to the command sourcedefault voidsendMessage(String[] messages) Sends the given messages to the command source
-
Method Details
-
name
String name()The name of the command source.- Returns:
- the name of the command source
-
sendMessage
Sends the given message to the command source- Parameters:
message- the message to send
-
sendMessage
Sends the given messages to the command source- Parameters:
messages- the messages to send
-
isConsole
boolean isConsole()If this source is the console.- Returns:
- true if this source is the console
-
playerUuid
@Nullable UUID playerUuid()- Returns:
- a Java UUID if this source represents a player, otherwise null
-
connection
@Nullable GeyserConnection connection()- Returns:
- a GeyserConnection if this source represents a Bedrock player that is connected to this Geyser instance, otherwise null
-
locale
String locale()Returns the locale of the command source.- Returns:
- the locale of the command source.
-
hasPermission
Checks if this command source has the given permission- Parameters:
permission- The permission node to check- Returns:
- true if this command source has a permission
-