Interface VisibilitySettings
public interface VisibilitySettings
Settings to manage the visibility of a hologram to players. Allows to set both a global visibility and an individual
visibility for specific players.
- Since:
- 1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe visibility status of a hologram, which can be set both globally and for individual players. -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves the individual visibility for all players.@NotNull VisibilitySettings.VisibilityReturns the global visibility.booleanisVisibleTo(@NotNull org.bukkit.entity.Player player) Checks if a hologram is visible to a player, taking into account both the global visibility and the individual visibility for the player (if set).voidremoveIndividualVisibility(@NotNull org.bukkit.entity.Player player) Removes the individual visibility for a player.voidsetGlobalVisibility(@NotNull VisibilitySettings.Visibility visibility) Sets the global visibility.voidsetIndividualVisibility(@NotNull org.bukkit.entity.Player player, @NotNull VisibilitySettings.Visibility visibility) Sets the visibility for a specific player, with precedence over the global visibility (getGlobalVisibility()).
-
Method Details
-
getGlobalVisibility
Returns the global visibility. This value only affects player which do not have an individual visibility (seesetIndividualVisibility(Player, Visibility)).The initial value is
VisibilitySettings.Visibility.VISIBLE, which means that all players can see the hologram.- Returns:
- the visibility
- Since:
- 1
-
setGlobalVisibility
Sets the global visibility. This value only affects player which do not have an individual visibility (seesetIndividualVisibility(Player, Visibility)).- Parameters:
visibility- the new visibility- Since:
- 1
-
setIndividualVisibility
void setIndividualVisibility(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull VisibilitySettings.Visibility visibility) Sets the visibility for a specific player, with precedence over the global visibility (getGlobalVisibility()). The individual visibility value can be removed withremoveIndividualVisibility(Player).- Parameters:
player- the player for which to set the individual visibilityvisibility- the new individual visibility to use for the player- Since:
- 1
-
removeIndividualVisibility
void removeIndividualVisibility(@NotNull @NotNull org.bukkit.entity.Player player) Removes the individual visibility for a player. The visibility for the player will then be determined by the global visibility (getGlobalVisibility()).- Parameters:
player- the player for which to remove the individual visibility- Since:
- 1
-
clearIndividualVisibilities
void clearIndividualVisibilities()Removes the individual visibility for all players. The visibility for all players will then be determined by the global visibility (getGlobalVisibility()).- Since:
- 1
-
isVisibleTo
boolean isVisibleTo(@NotNull @NotNull org.bukkit.entity.Player player) Checks if a hologram is visible to a player, taking into account both the global visibility and the individual visibility for the player (if set).- Parameters:
player- the player for which to check the visibility- Returns:
- if the player can see the hologram
- Since:
- 1
-