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
- The skin represents one validated body-and-face CharacterDefinition preset; armor remains separate.
- The corresponding visual state is reliably synchronized and replayed to late joiners.