Package net.citizensnpcs.api.trait.trait
Class Equipment
java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.api.trait.trait.Equipment
Represents an NPC's equipment.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumstatic class
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionget(Equipment.EquipmentSlot eslot) Get an NPC's equipment from the given slot.Gets the NPC's cosmetic equipment from the given slot.Get all of an NPC's cosmetic equipment.Get all of an NPC's equipment.Get all of the equipment as aMap.voidLoads a trait.voidonAttach()Called when the trait has been attached to anNPC.voidonSpawn()Called when anNPCis spawned.voidrun()Called every tick if overridden.voidSaves a trait.voidset(Equipment.EquipmentSlot eslot, ItemStack item) Set the armor from the given slot as the given item.voidsetCosmetic(Equipment.EquipmentSlot slot, ItemStack stack) Set the cosmetic equipment in the given slot
- 
Constructor Details- 
Equipmentpublic Equipment()
 
- 
- 
Method Details- 
getGet an NPC's equipment from the given slot.- Parameters:
- slot- Slot where the equipment is located
- Returns:
- ItemStack from the given equipment slot
 
- 
getCosmeticGets the NPC's cosmetic equipment from the given slot. Nullable.- Parameters:
- slot- Equipment slot
- Returns:
- ItemStack or null in the given equipment slot
 
- 
getCosmeticEquipmentGet all of an NPC's cosmetic equipment.- Returns:
- An array of an NPC's cosmetic equipment
 
- 
getEquipmentGet all of an NPC's equipment.- Returns:
- An array of an NPC's equipment
 
- 
getEquipmentBySlotGet all of the equipment as aMap.- Returns:
- A mapping of slot to item
 
- 
loadDescription copied from class:TraitLoads a trait.- Overrides:
- loadin class- Trait
- Parameters:
- key- DataKey to load from
- Throws:
- NPCLoadException- Thrown if this trait failed to load properly
 
- 
onAttachpublic void onAttach()Description copied from class:Trait
- 
onSpawnpublic void onSpawn()Description copied from class:TraitCalled when anNPCis spawned.NPC.getEntity()will return null until this is called. This is also called onAttach when the NPC is already spawned.
- 
runpublic void run()Description copied from class:TraitCalled every tick if overridden.
- 
saveDescription copied from class:TraitSaves a trait.
- 
setSet the armor from the given slot as the given item.- Parameters:
- item- Item to set the armor as
- slot- Equipment slot
 
- 
setCosmeticSet the cosmetic equipment in the given slot- Parameters:
- slot- The equipment slot
- stack- Thew new itemstack
 
 
-