OSRS Plugin API
    Preparing search index...

    Interface Entity

    interface Entity {
        getName(): string;
        isDead(): boolean;
        isHeadbarEmpty(): boolean;
        isHealthbarRendered(): boolean;
        isInteracting(): number;
        isRendered2D(): boolean;
        isRendered3D(): boolean;
        render2D(shouldRender: boolean): void;
        render3D(shouldRender: boolean): void;
    }

    Implemented by

    Index

    Methods

    • Returns the name of the entity.

      Returns string

      Returns the name of the entity as a string.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      osrs.print(npc:getName())
      end
    • Returns if the entity is dead.

      Returns boolean

      Returns true if the entity is dead, false if not.

      local players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      osrs.printf("player %s isDead=%s", player:getName(), (player:isDead() and "true" or "false") )
      end
    • Returns if the entity has a headbar that is empty.

      Returns boolean

      Returns true if the entity has a headbar that is empty, false if not.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      if npc:isHeadbarEmpty() then
      osrs.printf("npc %d has an empty headbar", npc_id)
      end
      end
    • Returns if the entitys healthbar is rendered.

      Returns boolean

      Returns true if the entitys healthbar is rendered, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isHealthbarRendered() then
      osrs.printf("player %d healthbar is rendered!", player_id)
      end
      end
    • Returns the id of the entity that this entity is interacting with, returns -1 if there is none.

      Returns number

      Returns the id of the entity that this entity is interacting with.

      local npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      local npc = osrs.ClientOp.getNpcObj(npc_id)
      local target_id = npc:isInteracting()
      if target_id ~= -1 then
      local target = osrs.ClientOp.getNpcObj(target_id)
      osrs.printf("NPC %s is interacting with %s", npc:getName(), target:getName())
      end
      end
    • Returns whether or not the entitys 2D elements are rendered.

      Returns boolean

      Returns true if the the entitys 2D elements are rendered, false if not.

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      if npc:isRendered2D() == 1540 then
      osrs.printf("NPC %d 2D elements are rendered!", npc_id)
      end
      end
    • Returns whether or not the entitys 3D elements are rendered.

      Returns boolean

      Returns true if the the entitys 3D elements are rendered, false if not.

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      if player:isRendered3D() then
      osrs.print("player %d is rendered!", player_id)
      end
      end
    • Changes the rendering of the entitys 2D elements based on the given boolean.

      Parameters

      • shouldRender: boolean

        Boolean that will render 2D elements when true, and does not when false.

      Returns void

      npcs = osrs.ClientOp.getNpcIdAll()
      for index, npc_id in pairs(npcs) do
      npc = osrs.ClientOp.getNpcObj(npc_id)
      -- npcs will no longer have 2D elements rendered
      npc:render2D(false)
      end
    • Changes the rendering of the entitys 3D elements based on the given boolean.

      Parameters

      • shouldRender: boolean

        Boolean that will render 3D elements when true, and does not when false.

      Returns void

      players = osrs.ClientOp.getPlayerIdAll()
      for index, player_id in pairs(players) do
      player = osrs.ClientOp.getPlayerObj(player_id)
      -- all players will no longer be rendered
      player:render3D(false)
      end