Class PlayerSnapshots
java.lang.Object
eu.mrapik.minecraftservermcp.builtin.player.PlayerSnapshots
Serializes live
Player data into ordered maps and JSON strings for the players_list and
player_get MCP resources.
Field names and types are stable enough for MCP clients to parse; they mirror common server state (position, health, game mode) and intentionally avoid NBT or deep inventory data.
-
Method Summary
-
Method Details
-
map
Flat map suitable for Jackson; keys use camelCase consistent with JSON conventions.- Parameters:
p- online player- Returns:
- ordered map of snapshot fields
-
toJson
Serializes snapshot data to a JSON string using the sharedJSONmapper.- Parameters:
value- map frommap(Player)or a list of such maps- Returns:
- JSON string
- Throws:
IOException- if serialization fails
-