EquippableComponentHelper
com.jsmacrosce.jsmacros.client.api.helper.inventory.EquippableComponentHelper
Describes where a stack can be equipped, how it looks when worn, and its equipment rules.
js
const stack = Player.getPlayer()?.getMainHand();
const slot = stack?.getComponents().getEquippable()?.getSlot();
if (slot === "body") Chat.log("This item goes in an animal's body slot.");Methods
canEquipOnInteract
canEquipOnInteract(): boolean#Returns: whether interacting with a compatible entity can equip the item onto it
getAllowedEntityTypeIds
Lists the entity types currently included in the restriction. Tags whose members are not loaded have an empty list; use getAllowedEntityTypeTagId() to read the tag itself. Entity types in the list still need to support the equipment slot.
Returns: allowed entity type IDs, or
null if unrestricted by this componentgetAllowedEntityTypeTagId
getCameraOverlayId
getEquipmentAssetId
getEquipSoundId
getSlot
isDispensable
isDispensable(): boolean#Returns: whether a dispenser is allowed to equip this item
isSwappable
isSwappable(): boolean#Returns: whether using the item can swap it with equipment in the target slot
takesDamageOnHurt
takesDamageOnHurt(): boolean#Returns: whether the item is configured to take durability damage when the wearer is hurt