Interface CommandSource

All Known Subinterfaces:
GeyserConnection

public interface CommandSource
Represents an instance capable of sending commands.
  • Method Details

    • name

      String name()
      The name of the command source.
      Returns:
      the name of the command source
    • sendMessage

      void sendMessage(String message)
      Sends the given message to the command source
      Parameters:
      message - the message to send
    • sendMessage

      default void sendMessage(String[] messages)
      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

      boolean hasPermission(String permission)
      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