Package net.citizensnpcs.trait
Class SkinTrait
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.trait.SkinTrait
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears skin texture and name.booleanWhether to fetch the Mojang skin using the NPC's name on spawn.voidLoads a trait.voidrun()Called every tick if overridden.voidsetFetchDefaultSkin(boolean fetch) voidsetShouldUpdateSkins(boolean update) voidsetSkinName(String name) Sets the skin name - will respawn NPC if spawned.voidsetSkinName(String name, boolean forceUpdate) Sets the skin name - will respawn NPC if spawned.voidsetSkinPersistent(String skinName, String signature, String data) Sets the skin data directly, respawning the NPC if spawned.voidsetSkinPersistent(Player player) Set skin data copying from aPlayer.voidsetTexture(String value, String signature) boolean
- 
Constructor Details- 
SkinTraitpublic SkinTrait()
 
- 
- 
Method Details- 
clearTexturepublic void clearTexture()Clears skin texture and name.
- 
fetchDefaultSkinpublic boolean fetchDefaultSkin()Whether to fetch the Mojang skin using the NPC's name on spawn.
- 
getSignature- Returns:
- The texture signature, or null
 
- 
getSkinName- Returns:
- The skin name if set, or null (i.e. using the NPC's name)
 
- 
getTexture- Returns:
- The encoded texture data, or null
 
- 
loadDescription copied from class:TraitLoads a trait.
- 
runpublic void run()Description copied from class:TraitCalled every tick if overridden.
- 
setFetchDefaultSkinpublic void setFetchDefaultSkin(boolean fetch) - See Also:
 
- 
setShouldUpdateSkinspublic void setShouldUpdateSkins(boolean update) - See Also:
 
- 
setSkinNameSets the skin name - will respawn NPC if spawned.- Parameters:
- name- The skin name
 
- 
setSkinNameSets the skin name - will respawn NPC if spawned.- Parameters:
- name- The skin name
- forceUpdate- Whether to force update if no data has been fetched yet
- See Also:
 
- 
setSkinPersistentSet skin data copying from aPlayer. Not subject to rate limiting from Mojang.- Parameters:
- player- The player to copy
 
- 
setSkinPersistentSets the skin data directly, respawning the NPC if spawned.- Parameters:
- skinName- Skin name or cache key
- signature-- getSignature()
- data-- getTexture()
 
- 
setTexture
- 
shouldUpdateSkinspublic boolean shouldUpdateSkins()- Returns:
- Whether the skin should be updated from Mojang periodically
 
 
-