Interface ILocalPlayerAPI


  • public interface ILocalPlayerAPI
    • Method Detail

      • getId

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

        java.lang.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

        java.lang.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
      • 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:
        Direction
      • 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
      • getSelfInteracting

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

        Model getModel()
        Gets the model.
        Returns:
        Model
      • getModelHeight

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

        int getHeight()
        Gets the height of the player.
        Returns:
        int
      • getHitsplatValues

        int[] getHitsplatValues()
      • getHitsplatTypes

        int[] getHitsplatTypes()
      • getHitsplatCycles

        int[] getHitsplatCycles()
      • getSpecialHitsplatValues

        int[] getSpecialHitsplatValues()
      • 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.
      • 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
      • isFemale

        boolean isFemale()
        Gets whether or not this player is a female character.
        Returns:
        true if female, otherwise false
      • isMale

        default boolean isMale()
        Gets whether or not this player is a male character.
        Returns:
        true if male, otherwise false
      • 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()