Interface NPCHologramSkin

All Superinterfaces:
BukkitEntitySkin, DamageableSkin, EquippableSkin, HologramSkin

public interface NPCHologramSkin extends HologramSkin, DamageableSkin, EquippableSkin, BukkitEntitySkin
Represents an "NPC"
  • Method Details

    • setSkin

      @Deprecated void setSkin(String texture, String signature)
      Deprecated.
      Use setSkin(Skin) instead
      Applies a skin to the NPC
      Parameters:
      texture - The base64 texture data
      signature - The base64 signature data
    • setSkin

      void setSkin(Skin skin)
      Applies a skin to the NPC
      Parameters:
      skin - The skin to apply.
    • resetSkin

      void resetSkin()
      Removes the current skin of the NPC and causes it by that to look like Alex/Steve
    • hasSkin

      boolean hasSkin()
      Returns whether the skin has a skin (whether he looks like Alex or Steve)
      Returns:
      true when a skin has been applied using setSkin(String, String)
    • getSkinTexture

      @Deprecated @Nullable @Nullable String getSkinTexture()
      Deprecated.
      Use getSkin() instead
      Returns the skin texture that has been passed using setSkin(String, String).

      Might be null when no skin has been set.

      Returns:
      The skin texture in base64. Possibly null
    • getSkinSignature

      @Deprecated @Nullable @Nullable String getSkinSignature()
      Deprecated.
      Use getSkin() instead
      Returns the skin signature that has been passed using setSkin(String, String).

      Might be null when no skin has been set.

      Returns:
      The skin signature in base64. Possibly null
    • getSkin

      @Nullable @Nullable Skin getSkin()
      Returns the skin that has been passed using setSkin(Skin).

      Might be null when no skin has been set.

      Returns:
      The skin. Possibly null
      See Also:
    • setPlayerSpecificSkinSupplier

      void setPlayerSpecificSkinSupplier(@Nullable @Nullable NPCHologramSkin.PlayerSpecificSkinSupplier supplier)
      Set the (optional) supplier if you want to display skins specific to a player.

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

      Parameters:
      supplier - The new supplier. null if you want to have static skins
    • hasPlayerSpecificSkinSupplier

      boolean hasPlayerSpecificSkinSupplier()
      Returns whether a skin supplier has been set.
      Returns:
      true if one is set
    • updatePlayerSpecificSkins

      void updatePlayerSpecificSkins()
      Forcefully updates all lines provided by the skin-supplier (setPlayerSpecificSkinSupplier(PlayerSpecificSkinSupplier)) for all players
    • updatePlayerSpecificSkin

      boolean updatePlayerSpecificSkin(Player player)
      Forcefully updates all lines provided by the skin-supplier (setPlayerSpecificSkinSupplier(PlayerSpecificSkinSupplier) (de.marcely.bedwars.api.world.hologram.skin.HolographicHologramSkin.PlayerSpecificLinesSupplier)}) only for a specific player
      Parameters:
      player - The player who whom the skin shall be updated
      Returns:
      false if it failed (because he's either not seeing the NPC or there's no skin-supplier), otherwise true
    • getPlayerSpecificSkinSupplier

      @Nullable @Nullable NPCHologramSkin.PlayerSpecificSkinSupplier getPlayerSpecificSkinSupplier()
      Returns the current skin supplier.
      Returns:
      The current skin supplier, null when there's none
    • setSelfSkinSupplier

      void setSelfSkinSupplier()
      Sets the NPC to use its own skin (the skin of the player).

      Uses setPlayerSpecificSkinSupplier(PlayerSpecificSkinSupplier) internally.

    • setSneaking

      void setSneaking(boolean sneaking)
      Sets whether the NPC is sneaking or not.
      Parameters:
      sneaking - true when the NPC should be sneaking
    • isSneaking

      boolean isSneaking()
      Returns whether the NPC is sneaking or not.
      Returns:
      true when the NPC is sneaking
    • getInternalType

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