Interface ILocalPlayerAPI


public interface ILocalPlayerAPI
  • Method Details

    • get

      Player get()
    • getId

      int getId()
      Gets the id of this player.
      Returns:
      int
    • getName

      String getName()
      Gets the name of the player.
      Returns:
      String
    • getCombatLevel

      int getCombatLevel()
      Gets the combat level of this player.
      Returns:
      int
    • getTeam

      int getTeam()
      Gets the team id of this player.
      Returns:
      int
    • getPrayerIcon

      int getPrayerIcon()
      Gets the prayer icon above this players head.
      Returns:
      int
    • getOverheadIconType

      default HeadIcon getOverheadIconType()
    • getSkullIcon

      int getSkullIcon()
      Gets the skull icon above this players head.
      Returns:
      int
    • getSkullIconType

      default SkullIcon getSkullIconType()
    • getMessage

      String getMessage()
      Gets the dialogue/message above the players head.
      Returns:
      String or null if no message
    • getX

      int getX()
      Gets the x-coordinate.
      Returns:
      int
    • getY

      int getY()
      Gets the y-coordinate.
      Returns:
      int
    • getPlane

      int getPlane()
      Gets the z-coordinate, also known as the floor or level.
      Returns:
      int
    • getLocation

      Tile getLocation()
      Gets the tile that this player is located on in the world.
      Returns:
      Tile
    • getServerLocation

      Tile getServerLocation()
      Gets the server tile that this player is located on in the world.
      Returns:
      Tile
    • getSceneOffset

      SceneOffset getSceneOffset()
      Gets the scene offset for this player.
      Returns:
      SceneOffset
    • getPathX

      int[] getPathX()
    • getPathY

      int[] getPathY()
    • getPathSize

      int getPathSize()
    • getDestination

      Tile getDestination()
      Gets the walking destination of this player.
      Returns:
      the destination tile or null
    • isMoving

      boolean isMoving()
      Gets whether or not this player is moving.
      Returns:
      true if moving, false otherwise
    • getRotation

      int getRotation()
      Gets the current rotation as an angle.
      Returns:
      the rotation
      See Also:
    • getDirection

      Direction getDirection()
      Gets the current cardinal direction of this player based on getRotation().
      Returns:
      Direction
      See Also:
    • isFacing

      boolean isFacing(Locatable locatable)
      Determines if the player is facing the given locatable.
      Parameters:
      locatable - the locatable
      Returns:
      true if the player is facing towards the locatable, false otherwise
    • getAnimation

      int getAnimation()
      Gets the animation id.
      Returns:
      -1 when we are not animating
    • getIdleAnimation

      int getIdleAnimation()
      Gets the idle animation id.
      Returns:
      int
    • isAnimating

      default boolean isAnimating()
      Determines if the player is animating based on getAnimation().
      Returns:
      true if getAnimation() is not -1, false otherwise
    • getInteracting

      Actor getInteracting()
      Gets the actor that this player is interacting with (e.g. talking or attacking)
      Returns:
      the actor or null if this actor is not interacting
    • getLocalPlayerIndex

      int getLocalPlayerIndex()
      Gets the interacting index in the npc or players array.
      Returns:
      int
    • getModelHeight

      int getModelHeight()
      Gets the height of the model.
      Returns:
      int
    • getHitsplatValues

      int[] getHitsplatValues()
    • getHitsplatTypes

      int[] getHitsplatTypes()
    • getHitsplatCycles

      int[] getHitsplatCycles()
    • getHealthPercent

      int getHealthPercent()
      Gets the health of this player.
      Returns:
      the health percentage. If the health cannot be determined (e.g. not in combat), then 100 is returned.
    • getHealthPercent

      int getHealthPercent(int id)
      Get the health of a healthbar with specified id.
      Parameters:
      id -
      Returns:
      the health percentage or -1
    • isInCombat

      boolean isInCombat()
      Gets whether or not this player is in combat.
      Returns:
      true if in combat, false otherwise
    • isAttacking

      boolean isAttacking()
      Gets whether or not this player is attacking. This is basically a convenience method for the conditions isInCombat() and getInteracting() not being null.
      Returns:
      true if we are attacking, false otherwise
    • getAppearanceIds

      int[] getAppearanceIds()
      Gets the appearance ids of this player.
      Returns:
      int[]
    • getNPCTransformationId

      int getNPCTransformationId()
      Gets the id of this player when in npc-based form. For example when transforming to a monkey on Ape Atoll.
      Returns:
      the npc id
    • getWildernessLevel

      int getWildernessLevel()
      Gets the current wilderness level.
      Returns:
      int
    • isInWilderness

      boolean isInWilderness()
      Gets whether or not we are in the wilderness.
      Returns:
      true if in wilderness, false otherwise
    • getMembershipDays

      int getMembershipDays()
      Gets the membership days on the account.
      Returns:
      int
    • hasMembership

      boolean hasMembership()
      Gets whether or not we have membership.
      Returns:
      true if account has membership, false otherwise
    • isStaminaActive

      boolean isStaminaActive()
    • getSpotAnimationIds

      int[] getSpotAnimationIds()
      Gets the spot animation ids of this player.
      Returns:
      int[]