Npc

public class Npc extends AbstractCharacter implements Actionable, Identifiable

Represents a non-player-character

See also

Constructors

Npc
Link copied to clipboard
void Npc(RSNPC npc)

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)
getActions
Link copied to clipboard
List<StringgetActions()
Gets the available actions for the entity, usually dependent on their definition.
getAnimation
Link copied to clipboard
int getAnimation()
Gets the character's current animation
getArea
Link copied to clipboard
Area getArea()
Gets the area that this npc occupies.
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.
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
getId
Link copied to clipboard
int getId()
Gets the ID of the entity
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).
getLegacyRSNPC
Link copied to clipboard
RSNPC getLegacyRSNPC()
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.
getNeighboringTiles
Link copied to clipboard
List<TilegetNeighboringTiles()
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()
getOverheadMessage
Link copied to clipboard
String getOverheadMessage()
Gets the message displayed above this character, such as a public chat message
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.
isMoving
Link copied to clipboard
boolean isMoving()
Determines if the character is moving or not.
isValid
Link copied to clipboard
boolean isValid()
Checks if this npc still exists in the game.
isVisible
Link copied to clipboard
boolean isVisible()
Determines if the entity is on the screen and able to be clicked.
toString
Link copied to clipboard
String toString()