OnMonsterDimensionChange: Difference between revisions
Jump to navigation
Jump to search
Document upcoming 0.1.8 character dimensions: six server APIs, three events and creator guide; not a release announcement |
Release 0.1.8 / BUILD210 / Protocol 40: dimensions API availability, loading and UI fixes |
||
| Line 35: | Line 35: | ||
== Notes == | == Notes == | ||
* Available | * Available since 0.1.8 / Protocol 40. Both client and server must update together. | ||
* Register on root. This is a server-local event, not a client rendering or transition-readiness acknowledgement. | * Register on root. This is a server-local event, not a client rendering or transition-readiness acknowledgement. | ||
* Not emitted for an unchanged dimension, rejected setter, initial spawn or ordinary connection. | * Not emitted for an unchanged dimension, rejected setter, initial spawn or ordinary connection. | ||
Latest revision as of 21:03, 11 October 2026
onMonsterDimensionChange
AVAILABLE FROM UPDATE 0.1.8
This event is available in G1R:MP 0.1.8 and later. The contract below includes the compatibility guarantees introduced in that update.
Emitted after an actual successful server-side dimension change of a monster.
Availability
This event is available in server-side scripts.
Callback signature
function(monsterId, oldDimension, newDimension)
Parameters
| Name | Type | Description |
|---|---|---|
monsterId |
string |
Decimal string returned by spawnMonster; preserve it as a string. |
oldDimension |
number |
Previous dimension. |
newDimension |
number |
New dimension accepted by the server. |
Examples
addEventHandler("onMonsterDimensionChange", root,
function(monsterId, oldDimension, newDimension)
outputDebugString("Dimension " .. oldDimension .. " -> " .. newDimension)
end)
Notes
- Available since 0.1.8 / Protocol 40. Both client and server must update together.
- Register on root. This is a server-local event, not a client rendering or transition-readiness acknowledgement.
- Not emitted for an unchanged dimension, rejected setter, initial spawn or ordinary connection.
- See Character dimensions. Avoid unbounded recursive dimension changes inside this handler.