Class GroundItems

java.lang.Object
com.botwithus.bot.api.entities.GroundItems

public final class GroundItems extends Object
Ground-item query facade. Singleton per GameAPI; obtain via api.groundItems().

Snapshot-backed (v15+) — reads from api.snapshot().groundItems() each time the source is materialised, mirroring the Npcs and SceneObjects pattern. The producer publishes every alive ground stack within the loaded-scene tile bounds each tick.

GroundItem coins = api.groundItems().query()
    .filter(g -> g.itemId() == 995)
    .nearest();
if (coins != null) coins.interact("Take");
  • Constructor Details

    • GroundItems

      public GroundItems(GameAPI api)
  • Method Details

    • query

      public GroundItems.Query query()
    • nearestByGameval

      public GroundItem nearestByGameval(String gameval)
      Nearest ground stack of the item with the given gameval name (e.g. "COINS"), or null.
    • allByGameval

      public List<GroundItem> allByGameval(String gameval)
      All ground stacks of the item with the given gameval name.
    • clearDefinitionCache

      public void clearDefinitionCache()
    • definitionCacheSize

      public int definitionCacheSize()