OnPlayerSkinChange
onPlayerSkinChange
Triggered after a validated authoritative player appearance preset has changed.
Availability
This event is available in server-side scripts.
Callback signature
onPlayerSkinChange(playerId, previousSkin, newSkin, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
playerId |
int |
The affected connected player ID. |
previousSkin |
string |
The previous stable skin key. |
newSkin |
string |
The new stable skin key. |
sourceResource |
string |
The resource that requested the change. |
Examples
Handle the event:
addEventHandler("onPlayerSkinChange", root, function(playerId, previousSkin, newSkin, sourceResource)
outputDebugString(getPlayerName(playerId) .. " skin: " .. previousSkin .. " -> " .. newSkin)
end)
Notes
- For players this compatibility event reports the Mutable skin-surface preset; authoritative body and head changes have separate events.
- The corresponding visual state is reliably synchronized and replayed to late joiners.