Player

public class Player extends AbstractCharacter

Represents a player (such as yourself, or another player)

See also

Constructors

Player
Link copied to clipboard
void Player(RSPlayer player)

Types

OverheadIcon
Link copied to clipboard
public enum OverheadIcon
SkullIcon
Link copied to clipboard
public enum SkullIcon

Functions

adjustCameraTo
Link copied to clipboard
boolean adjustCameraTo()
Moves the camera to a position where the given entity or position is in view.
click
Link copied to clipboard
boolean click()
Interacts with the entity, with the first action available.
boolean click(String action)
Interacts with the entity, given a specific action.
distance
Link copied to clipboard
int distance()
Determines the distance between this entity/tile and the local player
distanceTo
Link copied to clipboard
int distanceTo(Positionable position)
Determines the distance between this entity/tile and the given entity/tile
equals
Link copied to clipboard
boolean equals(Object o)
getAnimation
Link copied to clipboard
int getAnimation()
Gets the character's current animation
getCombatLevel
Link copied to clipboard
int getCombatLevel()
Gets the combat level of the character.
getEffects
Link copied to clipboard
List<IntegergetEffects()
Gets the IDs representing the current effects applied to the player, or empty if none exist.
getEquipment
Link copied to clipboard
List<ItemgetEquipment()
Gets the player's equipped items.
getEquippedItem
Link copied to clipboard
Optional<ItemgetEquippedItem(Equipment.Slot slot)
Gets the item equipped in the specific slot.
getHealthBarPercent
Link copied to clipboard
double getHealthBarPercent()
Gets the current percent of the health bar that is green
getHitsplats
Link copied to clipboard
List<HitsplatgetHitsplats()
Gets the hitsplats currently displayed on this character
getIndex
Link copied to clipboard
int getIndex()
Gets the index of the entity.
getInteractingCharacter
Link copied to clipboard
Optional<CharactergetInteractingCharacter()
Gets the Character that this character is interacting with (attacking, following, etc).
getLegacyRSPlayer
Link copied to clipboard
RSPlayer getLegacyRSPlayer()
getModel
Link copied to clipboard
Optional<ModelgetModel()
Gets the entity model
getName
Link copied to clipboard
String getName()
Determines the name of the entity of the object this method is called on.
getNextTile
Link copied to clipboard
Optional<TilegetNextTile()
Gets the next tile this character will be at, if it is moving
getOrientation
Link copied to clipboard
Orientable.Orientation getOrientation()
Gets the orientation of this entity
getOverheadIcon
Link copied to clipboard
Optional<Player.OverheadIcongetOverheadIcon()
Gets the overhead icon on this player, such as protect from melee
getOverheadMessage
Link copied to clipboard
String getOverheadMessage()
Gets the message displayed above this character, such as a public chat message
getSkullIcon
Link copied to clipboard
Optional<Player.SkullIcongetSkullIcon()
Gets the skull icon above this player
getSpotAnimation
Link copied to clipboard
int getSpotAnimation()
Gets the ID representing the current spot animation of the player, or -1 if the player is not performing a spot animation.
getTile
Link copied to clipboard
WorldTile getTile()
Gets the WorldTile of this entity/position
getWalkingDirection
Link copied to clipboard
Gets the direction this character is walking
hashCode
Link copied to clipboard
int hashCode()
hover
Link copied to clipboard
boolean hover()
Moves the mouse to a human-randomized point on the entity.
boolean hover(String action)
Hovers the specified action on this entity.
hoverMenu
Link copied to clipboard
boolean hoverMenu(String action)
Hovers the specified action on this entity, always right-clicking and hovering over the menu
interact
Link copied to clipboard
boolean interact(String action)
Attempts to interact with the entity using the given action.
boolean interact(String action, BooleanSupplier interruptCondition)
Attempts to interact with the entity using the given action.
isAnimating
Link copied to clipboard
boolean isAnimating()
Checks if the character is currently animating
isFacing
Link copied to clipboard
boolean isFacing(Positionable position)
Determines if this character is facing a given position.
isHealthBarVisible
Link copied to clipboard
boolean isHealthBarVisible()
Determines if the health bar interface is appearing over this character's head.
isHovering
Link copied to clipboard
boolean isHovering()
Checks if the mouse is currently over this entity
isInteracting
Link copied to clipboard
boolean isInteracting()
Determines if this character is interacting with any another character.
isInteractingWithMe
Link copied to clipboard
boolean isInteractingWithMe()
Determines if this character is interacting with the player.
isInteractingWithObject
Link copied to clipboard
boolean isInteractingWithObject(GameObject object)
Determines if an object is being interacted with by the player
isMoving
Link copied to clipboard
boolean isMoving()
Determines if the character is moving or not.
isVisible
Link copied to clipboard
boolean isVisible()
Determines if the entity is on the screen and able to be clicked.
lookupStats
Link copied to clipboard
Optional<Hiscores.PlayerlookupStats()
Gets the stats of this player by checking the highscores.
toString
Link copied to clipboard
String toString()