Persistent Worlds
Persistent Worlds
Added in v2.2.0.
A persistent world is a dungeon with one world that is kept and saved, like a normal Minecraft world. Everyone who plays it is in the same world, and what they change is still there after a restart. It runs the same functions, triggers, conditions and Mythic Mobs skills as any other dungeon. Use it for a hub, a town, an open zone or a long event.
What is saved
- Saved: blocks and everything else Minecraft keeps in a world (chest contents, item frames, armor stands), dungeon variables with their types, the dungeon status and the elapsed time.
- Also saved: the state of functions and triggers. That covers which players already set off a trigger, kill and death counters, AND/OR gate progress, door locks, hologram and boss bar visibility, the position of sequences and repeaters, revive counts and who looted a reward. A repeater that was running starts again when the world loads.
- Starting fresh at every load: functions with a Dungeon Start trigger, Mob Spawner and NPC Spawner functions and any function that contains one, and triggers with Allow Retrigger on.
- Mobs from Mob Spawner functions and holograms from Hologram functions are removed when the world unloads. Their functions make them again on the next load.
Each saved part can be turned off per world, see Config.
Setup
New dungeon:
- Run
/md create <name> persistent. The world loads right away, still empty. - Run
/md edit <name>, build, add your functions, then/md saveand/leave. - Run
/md world reset <name> confirmto build the world again from what you just made.
Existing dungeon: set General.DungeonType: persistent in its config.yml and run /md reload <name>.
Keep General.Lobby.Enabled: false unless you want a lobby. In an older config without that key the lobby is on. With a lobby, functions only start after a Start Dungeon function runs, and that has to happen again after every load.
Editing
/md edit <name> edits the dungeon's map. The live world is a separate copy of that map, made the first time the world loads, so building in edit mode does not change the live world.
- Functions, triggers, conditions and config: run
/md reload <name>after changing them. The world is saved, players inside are sent out, and it loads again with the changes. Blocks, variables and the state of the functions you did not replace are kept. - The build:
/md world reset <name> confirmdeletes the live world and builds it again from the map. Everything players changed and every saved variable is lost, and there is no backup. Copy the folder first if you might want it back. A world withSave.World: falseneeds no reset for this, because it is built from the map at every load.
The live world's folder is named like the dungeon and sits with the server's other worlds. On Minecraft 26.1 and newer it is in <main world>/dimensions/minecraft/, in lower case. /md world info <name> shows it.
Playing
- Players enter like any dungeon, for example with
/md play <name>, and leave with/leave. Requirements, keys and costs apply on every entry. - A party enters together. Set
IgnoreParties: truein the dungeon config to let each player come and go alone. General.MaxPlayerslimits how many players can be inside, and0is no limit. When the world is full, players wait in the queue and get a ready check when a spot opens.- Players who were inside when the server stopped are sent back to where they entered from when they log in again.
Commands
All of these need dungeons.admin and work from the console.
| Command | What it does |
|---|---|
/md world list |
Lists the persistent worlds, whether each is loaded and how many players are inside. |
/md world info <name> |
Shows the folder, when the world was created and last saved, and its saved variables. |
/md world load <name> |
Loads the world. |
/md world load <name> adopt |
Uses an existing world folder, see Using an existing world. |
/md world unload <name> |
Sends the players out, saves the world and unloads it. |
/md world save <name> |
Saves the world now. /md save does the same while you stand in it. |
/md world reset <name> confirm |
Deletes the live world and builds it again from the map. |
/md delete <name> deletes the live world along with the dungeon.
Config
In the dungeon's config.yml. A persistent dungeon that is missing any of these keys gets them added when it loads.
PersistentWorld:
LoadAtStart: true
UnloadWhenEmpty: -1
SaveInterval: 300
Save:
World: true
Variables: true
Status: true
TimeElapsed: true
Functions: true
| Key | What it does |
|---|---|
LoadAtStart |
Loads the world when the server starts. With false it loads when the first player enters, or with /md world load. |
UnloadWhenEmpty |
Seconds the world may stay empty before it is saved and unloaded. -1 keeps it loaded. An unloaded world loads again when a player enters. |
SaveInterval |
How often, in seconds, variables, status and time are written to disk. 0 turns the timed save off. They are also written when the world unloads and when the server stops. |
Save.World |
Blocks, chest contents and entities. With false the world is built from the dungeon's map again at every load. Nothing players change in it is kept, and map edits show up at the next load. Blocks that functions changed are not kept either, so turn Save.Functions off too if your functions build parts of the world. |
Save.Variables |
Dungeon variables. With false they start empty at every load. |
Save.Status |
The dungeon status. With false it starts unset at every load. |
Save.TimeElapsed |
The elapsed time. With false it starts at 0 at every load. |
Save.Functions |
The state of functions and triggers, see What is saved. With false every function starts fresh at every load. Turning it off and running /md reload <name> also drops what was saved, which is how you clear it without a reset. |
Turning Save.World off for a world that already has changes deletes those changes at the next load.
Blocks are saved by the server's own world autosave, when the world unloads and when the server stops. After a crash, the changes since the last save are lost.
Variables, status and time are stored in mythicdungeons/state.yml inside the live world's folder. Edit that file only while the world is unloaded, or the next save overwrites your change.
Using an existing world
If a folder with the dungeon's name already exists among the server's worlds and Mythic Dungeons did not create it, the world is not loaded and the folder is left alone. This happens after /md import <world>, because the imported world's own folder stays where it was. You then have two choices:
/md world load <name> adoptuses that folder as the live world, as it is. From then on a reset or/md deletedeletes it.- Delete or rename the folder and run
/md world load <name>. The world is then built from the dungeon's map.
Functions are placed by coordinates, so adopt a folder only when it holds the same build as the dungeon's map. A world with Save.World: false can't use an existing folder, so there only the second choice works.
Limitations
- As in continuous dungeons, a trigger that a player sets off fires once for that player, also with Allow Retrigger on. With Allow Retrigger off this is remembered across loads, until the world is reset. With Allow Retrigger on, or with
Save.Functionsoff, it works for them again after the world has loaded again. The exception is a Player Detector with Allow Retrigger on and For Each Player off, which fires again each time the area empties and a player walks back in. - A Delayed Function that was still waiting when the world unloaded does not run after the next load.
- Dungeon Start fires once after each load, for the first player who enters.
- Moving Block, Moving Block Cluster and Pushable Block functions are skipped, with a warning in the console.
- Difficulty levels and
General.TimeLimitare not used. - Not available with one-world dungeons. The dungeon is not loaded and the console says why.
- With proxy dungeons, the world runs on the lobby and players enter it there. A dungeon server does not load it.
- The dungeon's name is also the world's name. It can't be the name of one of the server's own worlds, and
overworld,the_nether,the_endandDXL_Importare reserved./md createand/md importrefuse a name that a persistent world already uses. - Switching the dungeon to another type keeps the live world's folder. Delete it by hand if you no longer need it.