Class GroundItem

java.lang.Object
com.botwithus.bot.api.entities.GroundItem
All Implemented Interfaces:
EntityContext

public final class GroundItem extends Object implements EntityContext
Rich wrapper around GroundItemInfo with lazy ItemType resolution and option-keyed interact.

Obtained through GroundItems.query() — don't construct directly.

  • Method Details

    • raw

      public GroundItemInfo raw()
    • handle

      public int handle()
    • itemId

      public int itemId()
    • quantity

      public int quantity()
    • name

      public String name()
    • tileX

      public int tileX()
      Description copied from interface: EntityContext
      Absolute world tile X.
      Specified by:
      tileX in interface EntityContext
    • tileY

      public int tileY()
      Description copied from interface: EntityContext
      Absolute world tile Y.
      Specified by:
      tileY in interface EntityContext
    • plane

      public int plane()
      Description copied from interface: EntityContext
      Plane / height level (0-3).
      Specified by:
      plane in interface EntityContext
    • getType

      public ItemType getType()
    • getOptions

      public List<String> getOptions()
    • hasOption

      public boolean hasOption(String option)
    • interact

      public void interact(int optionIndex)
      Queue an action by 1-based right-click option index.
      Throws:
      IllegalArgumentException - for optionIndex outside [1, 6]
    • interact

      public boolean interact(String option)
      Queue an action by option text. False if option isn't on the menu.
    • toString

      public String toString()
      Overrides:
      toString in class Object