Interface Audience

All Known Subinterfaces:
StructuredConsoleAudience

public interface Audience
Minimal recipient abstraction for platform-agnostic messaging.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    hasPermission(String permission)
    Checks whether this audience has the given permission.
    default boolean
    hasPermission(String permission, int fallbackOpLevel)
    Checks whether this audience has the given permission with a custom op-level fallback.
    default UUID
    id()
    Optional unique id for audience (e.g., player UUID).
    default String
    Optional display name for this audience (e.g., player username).
    void
    send(net.kyori.adventure.text.Component component)
    Sends a formatted component to the audience.
  • Method Details

    • send

      void send(net.kyori.adventure.text.Component component)
      Sends a formatted component to the audience.
      Parameters:
      component - message to deliver
    • id

      default UUID id()
      Optional unique id for audience (e.g., player UUID).
      Returns:
      audience identifier or null if not applicable
    • hasPermission

      default boolean hasPermission(String permission)
      Checks whether this audience has the given permission.

      Implementations that can resolve permissions should override this method. Default behavior only allows empty permission checks.

      Parameters:
      permission - permission node
      Returns:
      true when allowed
    • hasPermission

      default boolean hasPermission(String permission, int fallbackOpLevel)
      Checks whether this audience has the given permission with a custom op-level fallback.

      Implementations that can resolve permissions with platform-specific fallback handling should override this method. The default implementation preserves existing behavior.

      Parameters:
      permission - permission node
      fallbackOpLevel - op level to treat as granted when no permission backend answers
      Returns:
      true when allowed
    • name

      default String name()
      Optional display name for this audience (e.g., player username).
      Returns:
      audience name or null if not applicable