Features In-Depth 🔎 ​
This page details some of the core functionalities of Tub's Status Plugin.
1. Setting and Displaying Statuses ​
- Player Command: Players use
/status <your message>
to set their status. - Admin Command: Admins can use
/status <player> <message>
to set another player's status. - Formatting:
- Players can use standard Minecraft color codes (e.g.,
&c
for red,&l
for bold) in their status messages if they have the correspondingStatusPlugin.formatting.<type>
permissions. - The plugin uses a
ColourUtils
helper to translate these&
codes into actual display colors. - Spaces can be included by typing
&_
where a space is desired, as normal spaces might be trimmed by command argument parsing.
- Players can use standard Minecraft color codes (e.g.,
- Length Limit: The
maxStatusLength
inconfig.yml
defines the maximum number of displayable characters. Color codes and PlaceholderAPI placeholders do not count towards this limit. - Display Locations:
- Tab List: If
changeTablistNames: true
, the status appears before the player's name in the tab list (e.g.,[Status] PlayerName
). - Above Head: The status is also displayed as part of the player's display name, visible above their head in-game.
- Chat: If
chatFormatter: true
, chat messages are prefixed with the player's status (e.g.,[Status] PlayerName: Hello!
).
- Tab List: If
- Formatting Characters: The
openingCharacter
andclosingCharacter
fromconfig.yml
(default[
and]
) are used to wrap the status text.
2. Group Mode ​
- Activation: Set
groupMode: true
inconfig.yml
. - Functionality: When enabled, players cannot set arbitrary custom statuses with
/status <message>
. Instead, they must choose from a list of predefined groups using/group <groupname>
(or/status group <groupname>
). - Defining Groups: Status groups are defined in
config.yml
under thestatusGroups
section:yamlstatusGroups: afk: status: "&eAFK" pvping: status: "&cIn Combat!" trusted: # Example group key status: "&aTrusted Member"
- Permissions for Groups: To use a specific group, a player needs the permission
StatusPlugin.group.set.<groupKey>
. For example, to use theafk
group above, they'd needStatusPlugin.group.set.afk
. The base permissionStatusPlugin.group.set
(default: true) allows usage of the/group
command itself. - Admin Override: Administrators with
StatusPlugin.admin.setStatus
can still set custom statuses for players even when group mode is active.
3. PlaceholderAPI Integration ​
- Detection: The plugin automatically detects if PlaceholderAPI (PAPI) is installed on the server.
- Registration: If PAPI is found, Tub's Status Plugin registers its own expansion:
tubsstatusplugin
. - Provided Placeholders:
%tubsstatusplugin_status%
: Displays the status of the player viewing the placeholder.%tubsstatusplugin_status_<playerName>%
: Displays the status of the specified<playerName>
. Replace<playerName>
with an actual online player's name.- Example:
%tubsstatusplugin_status_Notch%
- Example:
- Usage in Statuses: If PAPI is present and a player has the
StatusPlugin.placeholders
permission, they can use other PAPI placeholders within their own status message. These placeholders will be parsed and updated.- Example status:
/status Playing on %server_name%
- Example status:
- Automatic Refresh: The plugin periodically (every 30 seconds by default) updates player display names in the tab list, which helps refresh any PAPI placeholders used within statuses.
4. LuckPerms Integration ​
- Detection: The plugin checks if LuckPerms is installed.
- Functionality: If LuckPerms is present and a player has the
StatusPlugin.placeholders
permission (this permission seems to gate both PAPI and LP placeholder usage in statuses based onStatusManager.updateDisplayName
), the plugin can incorporate the player's LuckPerms prefix and suffix into their displayed status. - Placeholders for Statuses: Players can use these specific strings in their status message:
%LP_prefix%
: Will be replaced by the player's LuckPerms prefix.%LP_suffix%
: Will be replaced by the player's LuckPerms suffix.
- Example Status:
/status %LP_prefix% &7MyRole &f%LP_suffix%
- Note: The actual prefix/suffix content is managed by LuckPerms. This plugin simply provides a way to display them as part of the status.
5. Status Persistence ​
- Storage: Player statuses are saved in the
plugins/TubsStatusPlugin/statuses.yml
file. - Format: The file stores player UUIDs mapped to their raw status string (including
&
color codes). - Saving: Statuses are saved whenever a player sets or removes their status.
- Loading: When the plugin enables (server start/reload), it loads all statuses from this file, ensuring players retain their status across sessions.
- Reloading: The
/status reload
command reloads bothconfig.yml
andstatuses.yml
.
6. Update Checking ​
- If
checkUpdate: true
inconfig.yml
, the plugin contacts the Modrinth API on server startup to check for new versions. - Notifications are logged to the console.
- For updates marked as
CRITICAL
orHIGH
urgency by the developer on Modrinth, players with theStatusPlugin.admin
permission (this seems to be the intended permission fromPlayerJoinListener.java
, though not explicitly inplugin.yml
for this purpose) will receive an in-game notification upon joining.