Interface Audience
- All Known Subinterfaces:
StructuredConsoleAudience
public interface Audience
Minimal recipient abstraction for platform-agnostic messaging.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanhasPermission(String permission) Checks whether this audience has the given permission.default booleanhasPermission(String permission, int fallbackOpLevel) Checks whether this audience has the given permission with a custom op-level fallback.default UUIDid()Optional unique id for audience (e.g., player UUID).default Stringname()Optional display name for this audience (e.g., player username).voidsend(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
Optional unique id for audience (e.g., player UUID).- Returns:
- audience identifier or null if not applicable
-
hasPermission
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
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 nodefallbackOpLevel- op level to treat as granted when no permission backend answers- Returns:
- true when allowed
-
name
Optional display name for this audience (e.g., player username).- Returns:
- audience name or null if not applicable
-