Hackware

Switch to dark theme

presence

The full-state snapshot of a player — whole inventory and vitals — that keeps them visible on the network.

A full-state snapshot of a player: their entire inventory and vital attributes. Part of the IRC schema reference; this is the payload a peer pushes every few seconds per online user to keep them present on the network.

There is no player field — a snapshot is the sender's own by definition, and receivers read who it describes from the meta event's uuid. Coalescing on the mesh keys on that sender too.

{
	"type": "presence",
	"inventory": [
		{
			"slot": 0,
			"item": {
				"id": "minecraft:netherite_sword",
				"count": 1,
				"damage": 12,
				"maxDamage": 2031
			}
		},
		{
			"slot": 1,
			"item": {
				"id": "minecraft:ender_pearl",
				"count": 16
			}
		}
	],
	"attributes": {
		"absorption": 0,
		"health": 20,
		"hunger": 20,
		"oxygen": 300,
		"saturation": 5
	}
}
FieldTypeConstraints
type"presence"Discriminator
inventoryarray of inventory slotsThe whole inventory. May be empty.
attributesobjectAll five fields required — see below
AttributeTypeMeaning
healthnumberHearts × 2 (20 = full)
absorptionnumberAbsorption hearts × 2
hungernumberFood level (20 = full)
saturationnumberHidden saturation reserve
oxygennumberAir supply (300 = full)
Snapshots, not deltas

Presence is idempotent state: each update carries everything, so a newer one strictly replaces an older one. That is what lets the mesh coalesce — of several updates queued for one recipient, only the newest per UUID is written. Never send partial snapshots and rely on earlier ones surviving; between any two frames a recipient sees, any number of yours may have been superseded.

A session whose presence stops arriving is marked stale after 15 seconds; clients age it out visually.