Copy the save aside
save_snapshotCopies a world and its characters to a labeled snapshot before a mutating run, so give, time, weather, and settile changes can be undone later.
Instructions
Copy this world and its characters aside, so a run can be undone.
Args:
label: The snapshot's name: letters, digits, dot, dash, underscore.
world: WINDOWS path to the .wld to copy, as passed to launch.
Defaults to TMODLOADER_WORLD_WIN. Refused without it when the
last session from this server loaded a different world, rather
than copying a world the run never touched.
WHAT THIS IS FOR. The mutating verbs write to a real install and none of
that FAILS — it accumulates. Enemy NPCs do not survive a reload, so spawn
looks harmless, but give writes the character file, time and weather
live in the world, and settile changes it for good. The damage is
invisible when it is done and shows up later as a measurement nobody
doubts.
Take one before a run that mutates, and save_restore after it.
REFUSES WHILE THE GAME IS RUNNING, naming the pids. A running tModLoader owns these files and writes them out on its own schedule, so a copy taken now is mid-write. Stop the session first.
Copies the world's .wld and .twld and every .plr/.tplr —
not the whole Worlds directory, which measured 41MB against 3MB for one
world, and not .bak files, which are the game's own safety net.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"label": "<label>"
},
"name": "save_snapshot"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | ||
| world | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | ||
| files | Yes | ||
| label | Yes | ||
| taken | Yes |