Class Equipment
GameAPI; obtain via api.equipment().
Equipment slots have fixed semantic meaning (head, body, legs, ...)
unlike a free-form inventory grid. The InventoryContainer read
methods still work over the raw slot index; the Equipment.Slot enum exposes
the semantic names. Slot indices are the game-engine values (the equipment
inv has gaps at index 6, 8, 11, 15, 16 — those are not real slots).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSemantic equipment slot names paired with their in-game inventory indices. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSlot(Equipment.Slot slot) Item worn in the given semantic slot, ornullwhen nothing is equipped there.booleaninteract(Equipment.Slot slot, int optionIndex) Click the given semantic slot with a 1-based right-click option index.booleaninteract(Equipment.Slot slot, String option) Click the given semantic slot with the named right-click option.booleanisEquipped(int itemId) True whenitemIdis in any equipment slot.booleanunequip(Equipment.Slot slot) Convenience: try the standard unequip options ("Remove" / "Unequip") on the slot.Methods inherited from class InventoryContainer
clearDefinitionCache, componentId, contains, contains, contains, containsAll, containsAny, containsGameval, count, count, countGameval, definitionCacheSize, findFirst, findFirst, findFirstGameval, freeSlots, getAll, getAllSlots, getAllSlotVars, getFirst, getFirst, getFirstGameval, getItems, getSlot, getSlotVars, interact, interact, interactFirst, interactFirst, interactFirstGameval, interactFirstGameval, interfaceId, invId, isEmpty, isFull, isNotEmpty, isNotFull, occupiedSlots, slotCount
-
Field Details
-
INVENTORY_ID
public static final int INVENTORY_ID- See Also:
-
INTERFACE_ID
public static final int INTERFACE_ID- See Also:
-
COMPONENT_ID
public static final int COMPONENT_ID- See Also:
-
-
Constructor Details
-
Equipment
-
-
Method Details
-
getSlot
Item worn in the given semantic slot, ornullwhen nothing is equipped there. -
interact
Click the given semantic slot with a 1-based right-click option index. Option indices are stable per slot and verifiable in-game via the mini-menu (right-click → count from the top, starting at 1). -
interact
Click the given semantic slot with the named right-click option.Caveat: option lookup goes through
ItemType.inventoryOptions()because the producer-sidegetComponentOptions(iface, comp)RPC was removed in the Slice 3 cull. Equipment-context options that aren't in the inventory-option list (e.g."Teleport"on a worn slayer cape,"Castle Wars"on a ring of duelling) therefore won't resolve here —interact(Slot, int)with a verified option index is the working path for those. -
unequip
Convenience: try the standard unequip options ("Remove" / "Unequip") on the slot. -
isEquipped
public boolean isEquipped(int itemId) True whenitemIdis in any equipment slot.
-