GetMonsterData

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 18:40, 3 September 2026 by QCherry (talk | contribs) (Document Lua APIs available or improved from G1R:MP 0.1.2)
Jump to navigation Jump to search

getMonsterData

IMPROVED FROM UPDATE 0.1.2
This function is available in earlier releases and has corrected or expanded behavior in G1R:MP 0.1.2 and later. The contract below describes the updated behavior.

Returns the complete authoritative state of a server-owned monster.

Syntax

table|false getMonsterData(string monsterId)

Parameters

Name Type Required Description
monsterId string yes The opaque decimal monster identifier returned by spawnMonster or getMonsters.

Returns

Returns a table containing id, type, name, nameplateIdVisible, x, y, z, yaw, health, maxHealth, attackDamage, state, targetPlayerId, aggressive, alive, and navigationMode; otherwise returns false.

Examples

Inspect a monster:

local monster = getMonsterData(monsterId)
if monster then
    outputDebugString(monster.type .. " HP: " .. monster.health .. "/" .. monster.maxHealth)
end

Notes

  • Available only in server-side resource scripts.
  • Position values use metres and yaw uses degrees. navigationMode is "builtin" or "scripted".