Interface NPCHologramSkin
- All Superinterfaces:
BukkitEntitySkin, DamageableSkin, EquippableSkin, HologramSkin
public interface NPCHologramSkin
extends HologramSkin, DamageableSkin, EquippableSkin, BukkitEntitySkin
Represents an "NPC"
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe internal entity type used to represent the NPC.static interfaceDisplays a specific skins that varies to each player. -
Method Summary
Modifier and TypeMethodDescriptionstatic NPCHologramSkin.InternalTypeReturns the internal entity type used to represent the NPC.Returns the current skin supplier.@Nullable SkingetSkin()Returns the skin that has been passed usingsetSkin(Skin).@Nullable StringDeprecated.@Nullable StringDeprecated.UsegetSkin()insteadbooleanReturns whether a skin supplier has been set.booleanhasSkin()Returns whether the skin has a skin (whether he looks like Alex or Steve)booleanReturns whether the NPC is sneaking or not.voidRemoves the current skin of the NPC and causes it by that to look like Alex/StevevoidsetPlayerSpecificSkinSupplier(@Nullable NPCHologramSkin.PlayerSpecificSkinSupplier supplier) Set the (optional) supplier if you want to display skins specific to a player.voidSets the NPC to use its own skin (the skin of the player).voidApplies a skin to the NPCvoidDeprecated.UsesetSkin(Skin)insteadvoidsetSneaking(boolean sneaking) Sets whether the NPC is sneaking or not.booleanupdatePlayerSpecificSkin(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 playervoidForcefully updates all lines provided by the skin-supplier (setPlayerSpecificSkinSupplier(PlayerSpecificSkinSupplier)) for all playersMethods inherited from interface BukkitEntitySkin
getBukkitEntity, updateBukkitMetadataMethods inherited from interface DamageableSkin
attack, getDamageSound, getDeathSound, getHealth, setHealthMethods inherited from interface EquippableSkin
getEquipmentMethods inherited from interface HologramSkin
getEntityId, getEntityType, getHologram, getNMSEntity, getType
-
Method Details
-
setSkin
Deprecated.UsesetSkin(Skin)insteadApplies a skin to the NPC- Parameters:
texture- The base64 texture datasignature- The base64 signature data
-
setSkin
-
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:
truewhen a skin has been applied usingsetSkin(String, String)
-
getSkinTexture
Deprecated.UsegetSkin()insteadReturns the skin texture that has been passed usingsetSkin(String, String).Might be
nullwhen no skin has been set.- Returns:
- The skin texture in base64. Possibly
null
-
getSkinSignature
Deprecated.UsegetSkin()insteadReturns the skin signature that has been passed usingsetSkin(String, String).Might be
nullwhen no skin has been set.- Returns:
- The skin signature in base64. Possibly
null
-
getSkin
Returns the skin that has been passed usingsetSkin(Skin).Might be
nullwhen 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.nullif you want to have static skins
-
hasPlayerSpecificSkinSupplier
boolean hasPlayerSpecificSkinSupplier()Returns whether a skin supplier has been set.- Returns:
trueif one is set
-
updatePlayerSpecificSkins
void updatePlayerSpecificSkins()Forcefully updates all lines provided by the skin-supplier (setPlayerSpecificSkinSupplier(PlayerSpecificSkinSupplier)) for all players -
updatePlayerSpecificSkin
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:
falseif it failed (because he's either not seeing the NPC or there's no skin-supplier), otherwisetrue
-
getPlayerSpecificSkinSupplier
Returns the current skin supplier.- Returns:
- The current skin supplier,
nullwhen 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-truewhen the NPC should be sneaking
-
isSneaking
boolean isSneaking()Returns whether the NPC is sneaking or not.- Returns:
truewhen the NPC is sneaking
-
getInternalType
Returns the internal entity type used to represent the NPC.- Returns:
- The internal entity type
-
getSkin()instead