Class Entity

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canReach()
      Checks if this location is reachable by the local player without obstacles
      double distance()  
      double distance​(Tile tile)
      Distance (as the crow flies) away from the given tile.
      double distance​(Entity entity)
      Distance away from the given entity.
      boolean equals​(java.lang.Object obj)  
      boolean exists()
      Determines where or not this object exists in game.
      abstract java.lang.String[] getActions()  
      java.awt.Rectangle getBoundingBox()
      Gets the bounding box for the entity's model
      java.awt.Point getCenterPoint()
      Gets center point of the object, which is used as a base location.
      java.awt.Point getClickablePoint()
      Gets a clickable point within the object, used for interaction.
      java.lang.String getLeftClickAction()  
      Model getModel()
      Gets the model of the entity
      abstract java.lang.String getName()
      Gets the name of the entity
      java.lang.Object getReference()
      Gets the object used as the reference.
      abstract int getRenderableHeight()  
      Area getSurroundingArea​(int radius)  
      Tile getTile()
      Gets tile of the object.
      TileReference getTileReference()
      Gets tile reference of the given object.
      abstract boolean hasAction​(java.lang.String... actions)
      Checks whether given actions are in the list of menu actions for an entity
      int hashCode()  
      boolean interact()
      Interacts with the given object using a default left click.
      boolean interact​(java.lang.String action)
      Interacts with the given object using an action.
      boolean interact​(java.lang.String action, boolean rightClick, boolean forceRightClick)  
      boolean interact​(java.lang.String action, boolean rightClick, boolean forceRightClick, Condition interrupt)  
      boolean interact​(Filter<java.lang.String> filter)
      Interacts with the given object using the first matching action.
      boolean interactForceLeft​(java.lang.String action)
      Interacts with current object by forcing a left click.
      boolean interactForceRight​(java.lang.String action)
      Interacts with current object by forcing a right click and interacting with menu (Interact using Menus)
      boolean isOnScreen()
      Checks whether the entity is visible on the game screen
      double walkingDistance​(Tile tile)
      Walking distance based on pathfinding to the given tile.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.dreambot.api.wrappers.interactive.Identifiable

        getID
    • Method Detail

      • isOnScreen

        public boolean isOnScreen()
        Checks whether the entity is visible on the game screen
        Returns:
        true if the entity is visible
      • getBoundingBox

        public java.awt.Rectangle getBoundingBox()
        Gets the bounding box for the entity's model
        Returns:
        bounding box of model
      • getReference

        public java.lang.Object getReference()
        Gets the object used as the reference.
        Returns:
        The object reference passed from the client.
      • getTileReference

        public TileReference getTileReference()
        Description copied from interface: Locatable
        Gets tile reference of the given object.
        Specified by:
        getTileReference in interface Locatable
        Returns:
        the object tile reference.
      • getModel

        public Model getModel()
        Gets the model of the entity
        Returns:
        model of entity
      • getRenderableHeight

        public abstract int getRenderableHeight()
      • getName

        public abstract java.lang.String getName()
        Gets the name of the entity
        Specified by:
        getName in interface Identifiable
        Returns:
        name of entity
      • hasAction

        public abstract boolean hasAction​(java.lang.String... actions)
        Checks whether given actions are in the list of menu actions for an entity
        Parameters:
        actions - actions to check
        Returns:
        true if all actions are in the list of menu actions
      • getTile

        public Tile getTile()
        Description copied from interface: Locatable
        Gets tile of the object.
        Specified by:
        getTile in interface Locatable
        Returns:
        the object tile.
      • distance

        public double distance​(Tile tile)
        Description copied from interface: Locatable
        Distance (as the crow flies) away from the given tile.
        Specified by:
        distance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the distance from the given tile as a double.
      • distance

        public double distance()
      • distance

        public double distance​(Entity entity)
        Distance away from the given entity.
        Parameters:
        entity - the destination target.
        Returns:
        return the distance from the given entities tile as a double.
      • walkingDistance

        public double walkingDistance​(Tile tile)
        Description copied from interface: Locatable
        Walking distance based on pathfinding to the given tile.

        This is a more expensive call than Locatable.distance(Tile), and should be used sparingly.

        Specified by:
        walkingDistance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the path distance movement cost from the given tile as a double. If there isn't a path to the tile, it will return 3 times the as the crow flies distance.
      • getClickablePoint

        public java.awt.Point getClickablePoint()
        Description copied from class: Interactable
        Gets a clickable point within the object, used for interaction.
        Specified by:
        getClickablePoint in class Interactable
        Returns:
        a clickable point within the object.
      • getCenterPoint

        public java.awt.Point getCenterPoint()
        Description copied from class: Interactable
        Gets center point of the object, which is used as a base location.
        Specified by:
        getCenterPoint in class Interactable
        Returns:
        the center point of the given object.
      • interact

        public boolean interact​(Filter<java.lang.String> filter)
        Description copied from class: Interactable
        Interacts with the given object using the first matching action.
        Overrides:
        interact in class Interactable
        Parameters:
        filter - the action filter
        Returns:
        results of interaction, true if interaction with the object was successful, otherwise false.
      • interact

        public boolean interact()
        Description copied from class: Interactable
        Interacts with the given object using a default left click.
        Overrides:
        interact in class Interactable
        Returns:
        results of interaction, true if the object was successfully clicked.
      • getLeftClickAction

        public java.lang.String getLeftClickAction()
      • interact

        public boolean interact​(java.lang.String action)
        Description copied from class: Interactable
        Interacts with the given object using an action. Will choose best click type using menu index.

        Example:

        
         NPC man = NPCs.closest("Man");
        
         if (man != null && man.interact("Attack")) {
             log("We attacked a man successfully!");
         }
         
        Overrides:
        interact in class Interactable
        Parameters:
        action - the action
        Returns:
        results of interaction, true if interaction with the object was successful, otherwise false.
      • interactForceRight

        public boolean interactForceRight​(java.lang.String action)
        Description copied from class: Interactable
        Interacts with current object by forcing a right click and interacting with menu (Interact using Menus)
        Overrides:
        interactForceRight in class Interactable
        Parameters:
        action - the action which to use for interacting.
        Returns:
        the result of the interaction, true if successful, otherwise false.
      • interactForceLeft

        public boolean interactForceLeft​(java.lang.String action)
        Description copied from class: Interactable
        Interacts with current object by forcing a left click. (Interact without using Menus)
        Overrides:
        interactForceLeft in class Interactable
        Parameters:
        action - the action which to check for before clicking.
        Returns:
        the result of the interaction, true if successful, otherwise false.
      • interact

        public boolean interact​(java.lang.String action,
                                boolean rightClick,
                                boolean forceRightClick)
        Overrides:
        interact in class Interactable
      • interact

        public boolean interact​(java.lang.String action,
                                boolean rightClick,
                                boolean forceRightClick,
                                Condition interrupt)
        Overrides:
        interact in class Interactable
      • exists

        public boolean exists()
        Description copied from interface: Verified
        Determines where or not this object exists in game.
        Specified by:
        exists in interface Verified
        Returns:
        true, if the object exist, otherwise false.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getSurroundingArea

        public Area getSurroundingArea​(int radius)
      • canReach

        public boolean canReach()
        Description copied from interface: Locatable
        Checks if this location is reachable by the local player without obstacles
        Specified by:
        canReach in interface Locatable
        Returns:
        true if it can, false otherwise
      • getActions

        public abstract java.lang.String[] getActions()