Skip to content

EquippableComponentHelper ​

com.jsmacrosce.jsmacros.client.api.helper.inventory.EquippableComponentHelper

Since2.3.0

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 ​

canBeSheared ​

canBeSheared(): boolean#
Returns: whether the item can be removed from the wearer using shears

canEquipOnInteract ​

canEquipOnInteract(): boolean#
Returns: whether interacting with a compatible entity can equip the item onto it

getAllowedEntityTypeIds ​

getAllowedEntityTypeIds(): List<String>#
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 component

getAllowedEntityTypeTagId ​

getAllowedEntityTypeTagId(): String#
Returns: the allowed entity type tag ID without "#", or null if no tag is used

getCameraOverlayId ​

getCameraOverlayId(): String#
Returns: the camera overlay ID for the wearer, or null if none is configured

getEquipmentAssetId ​

getEquipmentAssetId(): String#
Returns: the equipment asset ID for the worn item, or null if none is configured

getEquipSoundId ​

getEquipSoundId(): String#
Returns: the configured sound ID for equipping the item

getShearingSoundId ​

getShearingSoundId(): String#
Returns: the configured sound ID for removing the item with shears

getSlot ​

getSlot(): String#
Returns the slot specified by this component. The item can still have restrictions on who can wear it.
Returns: the slot name, such as "head", "body", or "saddle"

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