Interface PlayersApi
-
Method Summary
Modifier and TypeMethodDescriptionLooks up a player by exact, case-insensitive name.Removes a known player's saved custom tag from chat and the tab list.moduleData(PlexModule module, UUID playerUuid) Returns module-scoped data storage for a player.Returns the names of online players.Looks up a player by UUID.resolveCommandPlayer(String name) Resolves an exact name first, then a unique online name prefix, ignoring case.Saves a player's custom tag for chat and the tab list.
-
Method Details
-
player
Looks up a player by UUID.- Parameters:
uuid- player UUID- Returns:
- future containing the player view, if known
-
byName
Looks up a player by exact, case-insensitive name.- Parameters:
name- player name- Returns:
- future containing the player view, if known
-
resolveCommandPlayer
Resolves an exact name first, then a unique online name prefix, ignoring case. Callers that accept UUID input must resolve it withplayer(UUID)first. The future fails withAmbiguousPlayerExceptionwhen multiple online names match. Callbacks can run on a database thread.- Parameters:
name- command player name- Returns:
- future containing the player view, if known
-
setTag
Saves a player's custom tag for chat and the tab list.Works for known online and offline players. Applies Plex's visual formatting rules and configured
chat.max-tag-length. This does not set a rank prefix or an additivePlayerPrefixEventprefix. The caller must enforce its own permissions.Supports text, sprites, and player heads. Removes click and hover actions, insertion text, obfuscated formatting, and right-to-left text. Rejects dynamic component types such as translations, scores, and selectors.
The future completes after persistence and the local cached tag update. It fails for an unknown UUID, an invalid tag, or a storage failure. An overlong tag fails with
TagTooLongException. No player record is created. Callbacks may run on a database thread; do not block a player or region thread waiting for completion.- Parameters:
uuid- player UUIDtag- custom tag component- Returns:
- completion of the saved tag change
-
clearTag
Removes a known player's saved custom tag from chat and the tab list.Uses the same persistence and completion contract as
setTag(UUID, Component). Rank fallback and additivePlayerPrefixEventprefixes remain unchanged.- Parameters:
uuid- player UUID- Returns:
- completion of the saved tag removal
-
onlineNames
-
moduleData
Returns module-scoped data storage for a player.- Parameters:
module- module requesting player dataplayerUuid- player UUID- Returns:
- module-scoped player data storage
-