This is mostly the terraria client thinking it knows better then the server...
How to reproduce, Change a custom monsters life bytes to a high value above the normal range (example blue slime with a hp of 1000), and give it a custom name of AAAAA
When the player dies that is viewing the monster and respawns, the monster on that clients screen will reset / turn invisible
reason Lifebytes gets reset on client respawn for unknown reasons, however any other client still alive is not reset...
possible solutions
track all the players around custom npcs. when someone dies, transform the monster back into itself with the current stats of the server.
note this also happens when the player leaves the area for a period of time.
[ ] Fixed or found a hacky solution
Other problem, Name Resetting
this is due to the same issue above where the client leaves the screen and the monster on the client side reverts back to the normal monsters name.
solution - there is actually a name update packet for npc's that we may be able to use to solve this in real time without hacks... by enfocing the update npc name every ai update.
Update NPC Name [56]
Server <-> Client (Sync)
Size Description Type Notes
2 NPC ID Int16 -
? Name String Only if client is receiving packet
This is mostly the terraria client thinking it knows better then the server...
How to reproduce, Change a custom monsters life bytes to a high value above the normal range (example blue slime with a hp of 1000), and give it a custom name of AAAAA
When the player dies that is viewing the monster and respawns, the monster on that clients screen will reset / turn invisible
possible solutions
track all the players around custom npcs. when someone dies, transform the monster back into itself with the current stats of the server.
note this also happens when the player leaves the area for a period of time.
[ ] Fixed or found a hacky solution
Other problem, Name Resetting
solution - there is actually a name update packet for npc's that we may be able to use to solve this in real time without hacks... by enfocing the update npc name every ai update.