Class Equipment

java.lang.Object
com.botwithus.bot.api.inventory.InventoryContainer
com.botwithus.bot.api.inventory.Equipment

public final class Equipment extends InventoryContainer
The local player's worn equipment (inv id 94, equipment iface 1464). Singleton per 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).

  • Field Details

  • Constructor Details

    • Equipment

      public Equipment(GameAPI api)
  • Method Details

    • getSlot

      public InventoryItem getSlot(Equipment.Slot slot)
      Item worn in the given semantic slot, or null when nothing is equipped there.
    • interact

      public boolean interact(Equipment.Slot slot, int optionIndex)
      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

      public boolean interact(Equipment.Slot slot, String option)
      Click the given semantic slot with the named right-click option.

      Caveat: option lookup goes through ItemType.inventoryOptions() because the producer-side getComponentOptions(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

      public boolean unequip(Equipment.Slot slot)
      Convenience: try the standard unequip options ("Remove" / "Unequip") on the slot.
    • isEquipped

      public boolean isEquipped(int itemId)
      True when itemId is in any equipment slot.