Class Equipment

java.lang.Object
net.storm.sdk.items.Equipment

public class Equipment extends Object
Static utility class for accessing and interacting with the player's equipped items.

Equipment refers to items worn in equipment slots such as head, cape, amulet, weapon, body, shield, legs, gloves, boots, ring, and ammunition. This class provides methods to query equipped items and check what the player is wearing.

Example usage:


 // Check if player has a weapon equipped
 IItem weapon = Equipment.fromSlot(EquipmentSlot.WEAPON);
 if (weapon != null) {
     System.out.println("Wielding: " + weapon.getName());
 }

 // Check if wearing specific armor
 if (Equipment.contains("Dragon platebody")) {
     // Player is wearing dragon platebody
 }

 // Get all equipped items
 List<IItem> equipped = Equipment.getAll();

 // Check if wearing full set
 if (Equipment.containsAll("Dragon helm", "Dragon platebody", "Dragon platelegs")) {
     // Player has full dragon armor
 }
 

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    contains(int... id)
    Checks if the player has any equipped item matching any of the specified IDs.
    static boolean
    contains(String... name)
    Checks if the player has any equipped item matching any of the specified names.
    static boolean
    contains(Predicate<? super IItem> filter)
    Checks if the player has any equipped item matching the specified filter.
    static boolean
    containsAll(int... ids)
    Checks if the player has all items with the specified IDs equipped.
    static boolean
    containsAll(String... names)
    Checks if the player has all items with the specified names equipped.
    static boolean
    containsAll(Predicate<? super IItem> filter)
    Checks if all equipped items match the specified filter.
    static IItem
    Gets the item equipped in the specified equipment slot.
    static IItem
    get(int slot)
    Gets the equipped item at the specified slot index.
    static List<IItem>
    Gets all currently equipped items.
    static List<IItem>
    getAll(int... ids)
    Gets all equipped items matching any of the specified IDs.
    static List<IItem>
    getAll(String... names)
    Gets all equipped items matching any of the specified names.
    static List<IItem>
    getAll(Predicate<? super IItem> filter)
    Gets all equipped items matching the specified filter.
    static int
    getCount(boolean stacks, int... ids)
    Counts equipped items matching any of the specified IDs.
    static int
    getCount(boolean stacks, String... names)
    Counts equipped items matching any of the specified names.
    static int
    getCount(boolean stacks, Predicate<? super IItem> filter)
    Counts equipped items matching the filter.
    static int
    getCount(int... ids)
    Counts the number of equipment slots occupied by items matching any of the specified IDs.
    static int
    getCount(String... names)
    Counts the number of equipment slots occupied by items matching any of the specified names.
    static int
    getCount(Predicate<? super IItem> filter)
    Counts the number of equipment slots occupied by items matching the filter.
    static IItem
    getFirst(int... ids)
    Gets the first equipped item matching any of the specified IDs.
    static IItem
    getFirst(String... names)
    Gets the first equipped item matching any of the specified names.
    static IItem
    getFirst(Predicate<? super IItem> filter)
    Gets the first equipped item matching the specified filter.
    static IItem
    getLast(int... ids)
    Gets the last equipped item matching any of the specified IDs.
    static IItem
    getLast(String... names)
    Gets the last equipped item matching any of the specified names.
    static IItem
    getLast(Predicate<? super IItem> filter)
    Gets the last equipped item matching the specified filter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Equipment

      public Equipment()
  • Method Details

    • fromSlot

      public static IItem fromSlot(EquipmentSlot slot)
      Gets the item equipped in the specified equipment slot.
      Parameters:
      slot - the equipment slot to check
      Returns:
      the item in the slot, or null if the slot is empty
    • getAll

      public static List<IItem> getAll(Predicate<? super IItem> filter)
      Gets all equipped items matching the specified filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      a list of matching equipped items
    • getAll

      public static List<IItem> getAll(int... ids)
      Gets all equipped items matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      a list of matching equipped items
    • getAll

      public static List<IItem> getAll(String... names)
      Gets all equipped items matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      a list of matching equipped items
    • getAll

      public static List<IItem> getAll()
      Gets all currently equipped items.
      Returns:
      a list of all equipped items
    • get

      public static IItem get(int slot)
      Gets the equipped item at the specified slot index.
      Parameters:
      slot - the slot index
      Returns:
      the item at the slot, or null if empty
    • getFirst

      public static IItem getFirst(Predicate<? super IItem> filter)
      Gets the first equipped item matching the specified filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the first matching equipped item, or null if none found
    • getFirst

      public static IItem getFirst(int... ids)
      Gets the first equipped item matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      the first matching equipped item, or null if none found
    • getFirst

      public static IItem getFirst(String... names)
      Gets the first equipped item matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      the first matching equipped item, or null if none found
    • getLast

      public static IItem getLast(Predicate<? super IItem> filter)
      Gets the last equipped item matching the specified filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the last matching equipped item, or null if none found
    • getLast

      public static IItem getLast(int... ids)
      Gets the last equipped item matching any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      the last matching equipped item, or null if none found
    • getLast

      public static IItem getLast(String... names)
      Gets the last equipped item matching any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      the last matching equipped item, or null if none found
    • getCount

      public static int getCount(boolean stacks, Predicate<? super IItem> filter)
      Counts equipped items matching the filter.
      Parameters:
      stacks - if true, counts the total quantity (e.g., arrows); if false, counts number of slots
      filter - the predicate to match items against
      Returns:
      the count of matching items
    • getCount

      public static int getCount(boolean stacks, int... ids)
      Counts equipped items matching any of the specified IDs.
      Parameters:
      stacks - if true, counts the total quantity (e.g., arrows); if false, counts number of slots
      ids - the item IDs to count
      Returns:
      the count of matching items
    • getCount

      public static int getCount(boolean stacks, String... names)
      Counts equipped items matching any of the specified names.
      Parameters:
      stacks - if true, counts the total quantity (e.g., arrows); if false, counts number of slots
      names - the item names to count
      Returns:
      the count of matching items
    • getCount

      public static int getCount(Predicate<? super IItem> filter)
      Counts the number of equipment slots occupied by items matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      the number of matching slots
    • getCount

      public static int getCount(int... ids)
      Counts the number of equipment slots occupied by items matching any of the specified IDs.
      Parameters:
      ids - the item IDs to count
      Returns:
      the number of matching slots
    • getCount

      public static int getCount(String... names)
      Counts the number of equipment slots occupied by items matching any of the specified names.
      Parameters:
      names - the item names to count
      Returns:
      the number of matching slots
    • contains

      public static boolean contains(Predicate<? super IItem> filter)
      Checks if the player has any equipped item matching the specified filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      true if at least one matching item is equipped, false otherwise
    • contains

      public static boolean contains(int... id)
      Checks if the player has any equipped item matching any of the specified IDs.
      Parameters:
      id - the item IDs to search for
      Returns:
      true if at least one matching item is equipped, false otherwise
    • contains

      public static boolean contains(String... name)
      Checks if the player has any equipped item matching any of the specified names.
      Parameters:
      name - the item names to search for
      Returns:
      true if at least one matching item is equipped, false otherwise
    • containsAll

      public static boolean containsAll(int... ids)
      Checks if the player has all items with the specified IDs equipped.
      Parameters:
      ids - the item IDs that must all be equipped
      Returns:
      true if all items are equipped, false if any are missing
    • containsAll

      public static boolean containsAll(String... names)
      Checks if the player has all items with the specified names equipped.
      Parameters:
      names - the item names that must all be equipped
      Returns:
      true if all items are equipped, false if any are missing
    • containsAll

      public static boolean containsAll(Predicate<? super IItem> filter)
      Checks if all equipped items match the specified filter.
      Parameters:
      filter - the predicate that all equipped items must match
      Returns:
      true if all equipped items match the filter, false otherwise