PlayerEx
A player. getLocal() is you.
ClassRLPlugins API
public class PlayerEx extends ActorEx<Player>Every ActorEx method works on it too.
Members
Constructors
- newPlayerEx(Player)
Creates a PlayerEx.
Methods
- String[]getActions()
The right-click actions.
- PlayerCompositiongetComposition()
The player's look: worn items and colours.
- intgetId()
The player's id.
- PlayerExgetLocal()
You, the logged-in player.
- LocalPointgetLocalPoint()
Where it is inside the loaded area, in local units.
- PlayergetPlayer()
The RuneLite
Playerbehind it. - TilegetTile()
The tile it is on.
- WorldAreagetWorldArea()
The tiles it covers.
- WorldPointgetWorldPoint()
The tile the player stands on.
- voidinteract(String...)
Clicks one of its actions.
- voidinteract(int)
Clicks one of its actions.
- voidtransformToNpc(int)
Makes the player look like this NPC, on your screen only.
Inherited from ActorEx
- booleancanAttack()
Check if an actor can be attacked.
- booleanequals(Object)
Whether this and the other object are the same thing.
- ActorEx<?>
- PlayergetActor()
The RuneLite
Actorbehind it. - intgetAnimation()
The animation playing now.
- PointgetCanvasImageLocation(BufferedImage, int)
Projects an image using the actor's native overlay anchor.
- PointgetCanvasTextLocation(Graphics2D, String, int)
Projects a centered actor label using the actor's logical height.
- PolygongetCanvasTilePoly()
Projects this actor's actual footprint, including the native NPC model size.
- intgetCombatLevel()
Its combat level.
- ShapegetConvexHull()
Gets the actor's model outline for an overlay, without substituting its clickbox.
- intgetGraphic()
The id of the graphic that plays on it.
- int[]getGraphicIds()
The ids of all graphics that play on it.
- HeadIcongetHeadIcon()
The overhead prayer icon it shows.
- intgetHealthRatio()
How full its health bar is. -1 when no health bar shows.
- intgetHealthScale()
The full length of its health bar. -1 when no health bar shows.
- intgetIdlePoseAnimation()
The animation it uses when it stands still.
- ActorEx<?>getInCombatWith()
Find the actor currently in combat with the target actor.
- intgetIndex()
Its index in the client. For a player this is the player id.
- ActorEx<?>getInteracting()
The NPC or player it is busy with, or
null. - intgetLogicalHeight()
Its height in game units.
- intgetModelHeight()
Current rendered model height, distinct from the actor's logical height.
- StringgetName()
The name, without color tags.
- OrientationgetOrientation()
The direction it faces.
- intgetOrientationUnits()
Native facing angle, in 0..2047 client units, for projectile prediction.
- StringgetOverheadText()
The text shown above its head.
- intgetPathLength()
Queued step count for this actor, read from the injected movement queue.
- intgetPoseAnimation()
The animation of how it stands or moves right now.
- ShapegetShape()
Its outline on screen.
- WorldViewgetWorldView()
The world view it is in: the main world, or a boat.
- intgetWorldViewId()
Which world view the actor is in.
- booleanhasGraphic(int...)
Whether one of these graphics plays on it.
- inthashCode()
A number Java uses when this is put in a set or a map.
- booleanhasQueuedMovement()
Whether the actor still has steps queued to walk.
- booleanhealthBarVisible()
Whether its health bar shows.
- booleanisDead()
Whether the actor is dead.
- booleanisIdle()
Whether the actor stands in its idle pose with no animation.
- booleanisInteracting()
Whether it is busy with an NPC or a player.
PlayerEx(Player)
public PlayerEx(Player player)Creates a PlayerEx.
Parameters
player- Player.
getActions()
public String[] getActions()The right-click actions.
getComposition()
public PlayerComposition getComposition()The player's look: worn items and colours.
getId()
public int getId()The player's id.
getLocal()static
public static PlayerEx getLocal()You, the logged-in player.
Returns
Your player. Check GameAPI.isLoggedIn() first.
WorldPoint here = PlayerEx.getLocal().getWorldPoint();getLocalPoint()
public LocalPoint getLocalPoint()Where it is inside the loaded area, in local units.
getPlayer()
public Player getPlayer()The RuneLite Player behind it.
getTile()
public Tile getTile()The tile it is on.
getWorldArea()
public WorldArea getWorldArea()The tiles it covers.
getWorldPoint()
public WorldPoint getWorldPoint()The tile the player stands on.
Returns
Its position in the world.
interact(String...)
public void interact(String... actions)Clicks one of its actions.
Parameters
actions- Actions.
interact(int)
public void interact(int action)Clicks one of its actions.
Parameters
action- Action.
transformToNpc(int)
public void transformToNpc(int npcId)Makes the player look like this NPC, on your screen only.
Parameters
npcId- Npc id.
canAttack()from ActorEx
public boolean canAttack()Check if an actor can be attacked.
Returns
True if can be attacked.
equals(Object)from ActorEx
public boolean equals(Object obj)Whether this and the other object are the same thing.
Parameters
obj- Obj.
fromActor(Actor)staticfrom ActorEx
public static ActorEx<?> fromActor(Actor actor)Wraps a RuneLite Actor as an NpcEx or a PlayerEx.
Parameters
actor- Actor.
getActor()from ActorEx
public Player getActor()The RuneLite Actor behind it.
getAnimation()from ActorEx
public int getAnimation()The animation playing now.
Returns
The animation ID, or -1 when none plays.
getCanvasImageLocation(BufferedImage, int)from ActorEx
public Point getCanvasImageLocation(BufferedImage image, int heightOffset)Projects an image using the actor's native overlay anchor.
Parameters
image- Image.
heightOffset- Height offset.
getCanvasTextLocation(Graphics2D, String, int)from ActorEx
public Point getCanvasTextLocation(Graphics2D graphics, String text, int heightOffset)Projects a centered actor label using the actor's logical height.
Parameters
graphics- Graphics used to measure the label.
text- Label text.
heightOffset- Additional height above the actor.
Returns
Canvas text position, or null when unavailable.
getCanvasTilePoly()from ActorEx
public Polygon getCanvasTilePoly()Projects this actor's actual footprint, including the native NPC model size.
getCombatLevel()from ActorEx
public int getCombatLevel()Its combat level.
getConvexHull()from ActorEx
public Shape getConvexHull()Gets the actor's model outline for an overlay, without substituting its clickbox.
Returns
Projected model outline, or null when unavailable.
getGraphic()from ActorEx
public int getGraphic()The id of the graphic that plays on it.
getGraphicIds()from ActorEx
public int[] getGraphicIds()The ids of all graphics that play on it.
getHeadIcon()from ActorEx
public HeadIcon getHeadIcon()The overhead prayer icon it shows.
getHealthRatio()from ActorEx
public int getHealthRatio()How full its health bar is. -1 when no health bar shows.
getHealthScale()from ActorEx
public int getHealthScale()The full length of its health bar. -1 when no health bar shows.
getIdlePoseAnimation()from ActorEx
public int getIdlePoseAnimation()The animation it uses when it stands still.
getInCombatWith()from ActorEx
public ActorEx<?> getInCombatWith()Find the actor currently in combat with the target actor.
Returns
The actor, or null if none found.
getIndex()from ActorEx
public int getIndex()Its index in the client. For a player this is the player id.
getInteracting()from ActorEx
public ActorEx<?> getInteracting()The NPC or player it is busy with, or null.
getLogicalHeight()from ActorEx
public int getLogicalHeight()Its height in game units.
Returns
The actor's native logical height for overhead projections.
getModelHeight()from ActorEx
public int getModelHeight()Current rendered model height, distinct from the actor's logical height.
getName()from ActorEx
public String getName()The name, without color tags.
Returns
The name. It can be null for an NPC the game has not loaded yet.
getOrientation()from ActorEx
public Orientation getOrientation()The direction it faces.
getOrientationUnits()from ActorEx
public int getOrientationUnits()Native facing angle, in 0..2047 client units, for projectile prediction.
getOverheadText()from ActorEx
public String getOverheadText()The text shown above its head.
getPathLength()from ActorEx
public int getPathLength()Queued step count for this actor, read from the injected movement queue.
Returns
Number of steps still queued; zero when the queue is empty.
getPoseAnimation()from ActorEx
public int getPoseAnimation()The animation of how it stands or moves right now.
getShape()from ActorEx
public Shape getShape()Its outline on screen.
getWorldView()from ActorEx
public WorldView getWorldView()The world view it is in: the main world, or a boat.
getWorldViewId()from ActorEx
public int getWorldViewId()Which world view the actor is in.
Boats and other moving areas have their own world view. Compare two IDs to tell whether actors are on the same one.
Returns
The world view ID, or -1 when there is none.
hasGraphic(int...)from ActorEx
public boolean hasGraphic(int... graphicIds)Whether one of these graphics plays on it.
Parameters
graphicIds- Graphic ids.
hashCode()from ActorEx
public int hashCode()A number Java uses when this is put in a set or a map.
hasQueuedMovement()from ActorEx
public boolean hasQueuedMovement()Whether the actor still has steps queued to walk.
Returns
true while steps are queued.
- This only reads the walk queue. Forced movement, such as an agility shortcut, can move an actor with an empty queue.
healthBarVisible()from ActorEx
public boolean healthBarVisible()Whether its health bar shows.
isDead()from ActorEx
public boolean isDead()Whether the actor is dead.
Returns
true once it has died.
isIdle()from ActorEx
public boolean isIdle()Whether the actor stands in its idle pose with no animation.
Returns
true when it is idle.
isInteracting()from ActorEx
public boolean isInteracting()Whether it is busy with an NPC or a player.
Also allowed
Every class has these, as in plain Java.
distanceTo, getInteractionPoint, isInteractable, toString