Class BelowName
java.lang.Object
tk.airshipcraft.commonlib.gui.objects.BelowName
A utility class for managing and customizing the below-name scoreboard in Minecraft.
This class facilitates the creation and management of scoreboards that display information below player names,
such as health, scores, or custom text. It provides methods to set up and modify these displays per player.
- Since:
- 2023-04-11
- Version:
- 1.0.0
- Author:
- Locutusque, notzune
-
Constructor Summary
ConstructorsConstructorDescriptionBelowName
(org.bukkit.scoreboard.ScoreboardManager manager) Constructs a new BelowName instance using the provided ScoreboardManager. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.scoreboard.Team
Adds a new team to the scoreboard with a specified name and color.void
setBelowName
(org.bukkit.entity.Player player, String belowName) Sets a custom text to display below the name of a specific player.void
setDisplayName
(org.bukkit.entity.Player player, String displayName) Sets the display name of the below-name scoreboard for a specific player.void
setTeam
(org.bukkit.entity.Player player, org.bukkit.scoreboard.Team team) Assigns a player to a specific team on the below-name scoreboard.
-
Constructor Details
-
BelowName
public BelowName(org.bukkit.scoreboard.ScoreboardManager manager) Constructs a new BelowName instance using the provided ScoreboardManager. Initializes a new scoreboard and sets up the objective for below-name display.- Parameters:
manager
- The ScoreboardManager used for creating and managing scoreboards.
-
-
Method Details
-
setDisplayName
Sets the display name of the below-name scoreboard for a specific player. This display name appears below the player's name in the game.- Parameters:
player
- The player for whom the display name is to be set.displayName
- The display name to be shown below the player's name.
-
addTeam
Adds a new team to the scoreboard with a specified name and color. This team can be used to group players and customize their below-name displays.- Parameters:
name
- The name of the team to be added.color
- The color to be associated with the team, using ChatColor.- Returns:
- The newly created Team object.
-
setTeam
public void setTeam(org.bukkit.entity.Player player, org.bukkit.scoreboard.Team team) Assigns a player to a specific team on the below-name scoreboard. This can be used to group players and apply common display settings.- Parameters:
player
- The player to be added to the team.team
- The team to which the player is to be added.
-
setBelowName
Sets a custom text to display below the name of a specific player. This text appears below the player's name and can be used for various purposes, such as showing scores or statuses.- Parameters:
player
- The player for whom the below-name text is to be set.belowName
- The custom text to display below the player's name.
-