Skip to content

@pumpkin-plugins/apple-skin-pumpkin API / platform/player-sync / PlayerSync

Class: PlayerSync ​

Defined in: packages/apple-skin-pumpkin/src/platform/player-sync.ts:21

Keeps AppleSkin clients in step with the server's hunger values. Vanilla tells a client about saturation only when it reaches zero and never sends exhaustion at all, which leaves the food tooltips AppleSkin draws with both values behind. So the plugin reads every online player once per tick and sends only what moved since the last packet. Every send is logged at debug level, which Pumpkin hides until its log.level is set to debug.

Methods ​

joined() ​

joined(player): void

Defined in: packages/apple-skin-pumpkin/src/platform/player-sync.ts:28

Sends a joining player's values, and whether their world heals them by food.

Parameters ​

player ​

Player

Returns ​

void


left() ​

left(player): void

Defined in: packages/apple-skin-pumpkin/src/platform/player-sync.ts:45

Forgets a player who left, so that their next join starts from scratch.

Parameters ​

player ​

Player

Returns ​

void


tick() ​

tick(server): void

Defined in: packages/apple-skin-pumpkin/src/platform/player-sync.ts:55

Reads every online player's hunger and sends whatever moved since the last tick.

Parameters ​

server ​

Server

The server to read the players from.

Returns ​

void

Pumpkin Plugins documentation