Class Items

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

public class Items extends Object
Static utility class for searching items across all item containers.

This class provides a unified interface to search for items across the inventory, equipment, bank, and bank inventory simultaneously. It is useful when you need to find an item regardless of where it is stored.

Example usage:


 // Find an item anywhere (inventory, equipment, bank, bank inventory)
 IItem item = Items.getFirst("Rune pickaxe");

 // Check if player is carrying an item (inventory, equipment, or bank inventory)
 if (Items.isCarrying("Tinderbox")) {
     // Player has tinderbox on them
 }

 // Get all items with a specific name from all containers
 List<IItem> allCoins = Items.getAll("Coins");

 // Check if an item exists anywhere
 if (Items.contains("Dragon bones")) {
     // Item exists somewhere
 }
 

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    contains(int... id)
    Checks if any container has an item with any of the specified IDs.
    static boolean
    contains(String... name)
    Checks if any container has an item with any of the specified names.
    static boolean
    contains(Predicate<? super IItem> filter)
    Checks if any container has an item matching the filter.
    static List<IItem>
    getAll(int... ids)
    Gets all items matching any of the specified IDs from all containers.
    static List<IItem>
    getAll(String... names)
    Gets all items matching any of the specified names from all containers.
    static List<IItem>
    getAll(Predicate<? super IItem> filter)
    Gets all items matching the filter from all containers (inventory, equipment, bank, bank inventory).
    static List<IItem>
    getCarrying(int... ids)
    Gets all items the player is carrying with any of the specified IDs.
    static List<IItem>
    getCarrying(String... names)
    Gets all items the player is carrying with any of the specified names.
    static List<IItem>
    getCarrying(Predicate<? super IItem> filter)
    Gets all items the player is carrying matching the filter (inventory, equipment, bank inventory).
    static IItem
    getFirst(int... ids)
    Gets the first item matching any of the specified IDs from any container.
    static IItem
    getFirst(String... names)
    Gets the first item matching any of the specified names from any container.
    static IItem
    getFirst(Predicate<? super IItem> filter)
    Gets the first item matching the filter from any container.
    static IItem
    getLast(int... ids)
    Gets the last item matching any of the specified IDs from any container.
    static IItem
    getLast(String... names)
    Gets the last item matching any of the specified names from any container.
    static IItem
    getLast(Predicate<? super IItem> filter)
    Gets the last item matching the filter from any container (by slot index).
    static boolean
    isCarrying(int... ids)
    Checks if the player is carrying an item with any of the specified IDs.
    static boolean
    isCarrying(String... names)
    Checks if the player is carrying an item with any of the specified names.
    static boolean
    isCarrying(Predicate<? super IItem> filter)
    Checks if the player is carrying an item matching the filter (inventory or equipment).

    Methods inherited from class java.lang.Object

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

    • Items

      public Items()
  • Method Details

    • getAll

      public static List<IItem> getAll(Predicate<? super IItem> filter)
      Gets all items matching the filter from all containers (inventory, equipment, bank, bank inventory).
      Parameters:
      filter - the predicate to match items against
      Returns:
      a list of all matching items from all containers
    • getAll

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

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

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

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

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

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

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

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

      public static boolean isCarrying(Predicate<? super IItem> filter)
      Checks if the player is carrying an item matching the filter (inventory or equipment).

      This checks if the item is on the player's person, not in the bank.

      Parameters:
      filter - the predicate to match items against
      Returns:
      true if the player is carrying a matching item, false otherwise
    • isCarrying

      public static boolean isCarrying(String... names)
      Checks if the player is carrying an item with any of the specified names.
      Parameters:
      names - the item names to search for
      Returns:
      true if the player is carrying a matching item, false otherwise
    • isCarrying

      public static boolean isCarrying(int... ids)
      Checks if the player is carrying an item with any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      true if the player is carrying a matching item, false otherwise
    • contains

      public static boolean contains(Predicate<? super IItem> filter)
      Checks if any container has an item matching the filter.
      Parameters:
      filter - the predicate to match items against
      Returns:
      true if a matching item exists in any container, false otherwise
    • contains

      public static boolean contains(String... name)
      Checks if any container has an item with any of the specified names.
      Parameters:
      name - the item names to search for
      Returns:
      true if a matching item exists in any container, false otherwise
    • contains

      public static boolean contains(int... id)
      Checks if any container has an item with any of the specified IDs.
      Parameters:
      id - the item IDs to search for
      Returns:
      true if a matching item exists in any container, false otherwise
    • getCarrying

      public static List<IItem> getCarrying(Predicate<? super IItem> filter)
      Gets all items the player is carrying matching the filter (inventory, equipment, bank inventory).

      This includes items on the player's person and in the bank inventory panel (when bank is open), but excludes items stored in the main bank.

      Parameters:
      filter - the predicate to match items against
      Returns:
      a list of all matching items the player is carrying
    • getCarrying

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

      public static List<IItem> getCarrying(int... ids)
      Gets all items the player is carrying with any of the specified IDs.
      Parameters:
      ids - the item IDs to search for
      Returns:
      a list of all matching items the player is carrying