Interface HolographicHologramSkin

All Superinterfaces:
HologramSkin

public interface HolographicHologramSkin extends HologramSkin
Represents a "holograph" (don't get confused by "holograms").

This one is a holographic hologram that's able to display text.

  • Method Details

    • getDisplayedItem

      @Nullable @Nullable ItemStack getDisplayedItem()
      Get the item that is displayed below the hologram's lines.

      For spawners, this represents the rotating block.

      Returns:
      The displayed item. null if only text is shown
    • setDisplayedItem

      void setDisplayedItem(@Nullable @Nullable ItemStack item)
      Set the item that is displayed below the hologram's lines.

      For spawners, this represents the rotating block.

      Parameters:
      item - The displayed item. null if only text shall be shown
    • getLines

      Collection<String> getLines()
      Returns the lines that are currently being displayed.
      Returns:
      The lines currently shown
    • setLines

      void setLines(String... lines)
      Set the lines that shall be shown
      Parameters:
      lines - The new lines
    • setLines

      void setLines(Collection<String> lines)
      Set the lines that shall be shown
      Parameters:
      lines - The new lines
    • setPlayerSpecificLinesSupplier

      void setPlayerSpecificLinesSupplier(@Nullable @Nullable HolographicHologramSkin.PlayerSpecificLinesSupplier supplier)
      Set the (optional) supplier if you want to display lines specific to a player.

      Doesn't update the lines for players automatically who already see the hologram. You might want to call updatePlayerSpecificLines() after setting a new supplier.

      Parameters:
      supplier - The new supplier. null if you want to have static lines
    • hasPlayerSpecificLinesSupplier

      boolean hasPlayerSpecificLinesSupplier()
      Returns whether a lines supplier has been set.
      Returns:
      true if one is set
    • updatePlayerSpecificLines

      void updatePlayerSpecificLines()
      Forcefully updates all lines provided by the lines-supplier (setPlayerSpecificLinesSupplier(PlayerSpecificLinesSupplier)) for all players
    • updatePlayerSpecificLines

      boolean updatePlayerSpecificLines(Player player)
      Forcefully updates all lines provided by the lines-supplier (setPlayerSpecificLinesSupplier(PlayerSpecificLinesSupplier)) only for a specific player
      Parameters:
      player - The player who whom the params shall be updated
      Returns:
      false if it failed (because he's either not seeing the hologram or there's no lines-supplier), otherwise true
    • getPlayerSpecificLinesSupplier

      @Nullable @Nullable HolographicHologramSkin.PlayerSpecificLinesSupplier getPlayerSpecificLinesSupplier()
      Returns the current lines supplier.
      Returns:
      The current lines supplier, null when there's none
    • getInternalEntities

      Object[] getInternalEntities()
      Returns the internal entities representing this holograph.

      If getInternalType() returns HolographicHologramSkin.InternalType.ARMOR_STANDS, this method returns an array of ArmorStandHologramSkin for each line.

      If getInternalType() returns HolographicHologramSkin.InternalType.DISPLAY, this method returns an array with an org.bukkit.entity.TextDisplay at index 0, and (if set) an org.bukkit.entity.ItemDisplay at index 1.

      Returns:
      An array containing the internal entities used to form the holograph
    • getInternalType

      static HolographicHologramSkin.InternalType getInternalType()
      Returns the internal entity type used to represent the holograph.
      Returns:
      The internal entity type