Interface ITileItems

All Superinterfaces:
EntityProvider<ITileItem>, SceneEntityProvider<ITileItem>, TileEntityProvider<ITileItem>

public interface ITileItems extends TileEntityProvider<ITileItem>
Provides access to all ground items (tile items) in the loaded scene.

This interface extends TileEntityProvider to provide ground item-specific querying capabilities. Ground items are items that have been dropped on the ground or spawned by the game, and are visible on specific tiles in the game world.

Ground items can include:

  • Items dropped by players
  • Items dropped by NPCs upon death
  • Static item spawns placed by the game
  • Items from various game mechanics (e.g., bird nests falling from trees)

The provider maintains a cache that is updated when items spawn or despawn, allowing efficient queries for ground items at specific locations or matching certain criteria.

Example usage:

 
 ITileItems tileItems = Static.getTileItems();

 // Find the nearest valuable item
 ITileItem bones = tileItems.getNearest("Bones");

 // Get all items at a specific tile
 List<ITileItem> items = tileItems.getAt(tile, item -> true);

 // Find items within 5 tiles
 List<ITileItem> nearby = tileItems.getSurrounding(myLocation, 5, item -> true);

 // Get items in a specific area
 List<ITileItem> areaItems = tileItems.getIn(bankArea, "Coins");
 
 

See Also: