Class Entity
- java.lang.Object
-
- org.dreambot.api.wrappers.interactive.interact.Interactable
-
- org.dreambot.api.wrappers.interactive.Entity
-
- All Implemented Interfaces:
Identifiable,Locatable,Verified
- Direct Known Subclasses:
Character,GameObject,GroundItem
public abstract class Entity extends Interactable implements Verified, Identifiable, Locatable
The wrapper for all interactable game objects. Ex. Players, NPCs, GameObjects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanReach()Checks if this location is reachable by the local player without obstaclesdoubledistance()doubledistance(Tile tile)Distance (as the crow flies) away from the given tile.doubledistance(Entity entity)Distance away from the given entity.booleanequals(java.lang.Object obj)booleanexists()Determines where or not this object exists in game.abstract java.lang.String[]getActions()java.awt.RectanglegetBoundingBox()Gets the bounding box for the entity's modeljava.awt.PointgetCenterPoint()Gets center point of the object, which is used as a base location.java.awt.PointgetClickablePoint()Gets a clickable point within the object, used for interaction.java.lang.StringgetLeftClickAction()ModelgetModel()Gets the model of the entityabstract java.lang.StringgetName()Gets the name of the entityjava.lang.ObjectgetReference()Gets the object used as the reference.abstract intgetRenderableHeight()AreagetSurroundingArea(int radius)TilegetTile()Gets tile of the object.TileReferencegetTileReference()Gets tile reference of the given object.abstract booleanhasAction(java.lang.String... actions)Checks whether given actions are in the list of menu actions for an entityinthashCode()booleaninteract()Interacts with the given object using a default left click.booleaninteract(java.lang.String action)Interacts with the given object using an action.booleaninteract(java.lang.String action, boolean rightClick, boolean forceRightClick)booleaninteract(java.lang.String action, boolean rightClick, boolean forceRightClick, Condition interrupt)booleaninteract(Filter<java.lang.String> filter)Interacts with the given object using the first matching action.booleaninteractForceLeft(java.lang.String action)Interacts with current object by forcing a left click.booleaninteractForceRight(java.lang.String action)Interacts with current object by forcing a right click and interacting with menu (Interact using Menus)booleanisOnScreen()Checks whether the entity is visible on the game screendoublewalkingDistance(Tile tile)Walking distance based on pathfinding to the given tile.-
Methods inherited from class org.dreambot.api.wrappers.interactive.interact.Interactable
hover, rightClick
-
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, getID
-
Methods inherited from interface org.dreambot.api.wrappers.interactive.Locatable
canReach, getGridX, getGridY, getRegionId, getX, getY, getZ, tileDistance
-
-
-
-
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:LocatableGets tile reference of the given object.- Specified by:
getTileReferencein interfaceLocatable- 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:
getNamein interfaceIdentifiable- 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
-
distance
public double distance(Tile tile)
Description copied from interface:LocatableDistance (as the crow flies) away from the given tile.
-
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:LocatableWalking 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:
walkingDistancein interfaceLocatable- 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:InteractableGets a clickable point within the object, used for interaction.- Specified by:
getClickablePointin classInteractable- Returns:
- a clickable point within the object.
-
getCenterPoint
public java.awt.Point getCenterPoint()
Description copied from class:InteractableGets center point of the object, which is used as a base location.- Specified by:
getCenterPointin classInteractable- Returns:
- the center point of the given object.
-
interact
public boolean interact(Filter<java.lang.String> filter)
Description copied from class:InteractableInteracts with the given object using the first matching action.- Overrides:
interactin classInteractable- 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:InteractableInteracts with the given object using a default left click.- Overrides:
interactin classInteractable- 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:InteractableInteracts 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:
interactin classInteractable- 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:InteractableInteracts with current object by forcing a right click and interacting with menu (Interact using Menus)- Overrides:
interactForceRightin classInteractable- 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:InteractableInteracts with current object by forcing a left click. (Interact without using Menus)- Overrides:
interactForceLeftin classInteractable- 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:
interactin classInteractable
-
interact
public boolean interact(java.lang.String action, boolean rightClick, boolean forceRightClick, Condition interrupt)- Overrides:
interactin classInteractable
-
exists
public boolean exists()
Description copied from interface:VerifiedDetermines where or not this object exists in game.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getSurroundingArea
public Area getSurroundingArea(int radius)
-
canReach
public boolean canReach()
Description copied from interface:LocatableChecks if this location is reachable by the local player without obstacles
-
getActions
public abstract java.lang.String[] getActions()
-
-