SetMonsterIdVisible
setMonsterIdVisible
AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.
Shows or hides the numeric identifier in a resource-owned monster's nameplate.
Syntax
bool setMonsterIdVisible(string monsterId, bool visible)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
monsterId |
string |
yes | The opaque decimal monster identifier returned by spawnMonster or getMonsters.
|
visible |
bool |
yes | True to show the numeric monster ID or false to hide it. |
Returns
Returns true when the visibility change is accepted and replicated; otherwise returns false.
Examples
Keep a monster's display name but hide its technical identifier:
setMonsterName(monsterId, "Cave Guardian")
setMonsterIdVisible(monsterId, false)
Notes
- Available only in server-side resource scripts.
- Only the resource that created the monster may change this field.
- The state is exposed as
getMonsterData(monsterId).nameplateIdVisibleand replayed during relevance entry and late join. - When the value changes, the server emits
onMonsterIdVisibilityChange(monsterId, previousVisible, visible, sourceResource). Repeating the current value remains a successful no-op and does not emit the event. setMonsterNameplateIdVisibleis a compatibility alias for this function; usesetMonsterIdVisiblein new resources.