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
  • Method Details

    • getGlobalVisibility

      @NotNull @NotNull VisibilitySettings.Visibility getGlobalVisibility()
      Returns the global visibility. This value only affects player which do not have an individual visibility (see setIndividualVisibility(Player, Visibility)).

      The initial value is VisibilitySettings.Visibility.VISIBLE, which means that all players can see the hologram.

      Returns:
      the visibility
      Since:
      1
    • setGlobalVisibility

      void setGlobalVisibility(@NotNull @NotNull VisibilitySettings.Visibility visibility)
      Sets the global visibility. This value only affects player which do not have an individual visibility (see setIndividualVisibility(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 with removeIndividualVisibility(Player).
      Parameters:
      player - the player for which to set the individual visibility
      visibility - 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