One World Dungeons
| DISCLAIMER |
|---|
| This is an experimental feature and is turned off by default. |
One-world dungeons is a system for handling dungeon instances where dungeon instances share a single world, instead of every instance being run in its own world. This drastically reduces memory usage and memory leaks by reducing the amount of worlds being loaded and unloaded.
NOTE: This system does NOT load your dungeons into your survival world! It loads them into completely separate worlds that host all the dungeons.
Mythic Dungeons creates one shared world per dimension the moment a dungeon of that dimension is loaded, named dungeons_normal_0, dungeons_nether_0 and dungeons_the_end_0. Instances are packed side by side into that world, one region rectangle each, and are told apart by the area they occupy. When a shared world runs out of room, the next one (dungeons_normal_1, and so on) is created automatically. The shared worlds are deleted when the plugin shuts down.
Edit sessions are not affected. /md edit always loads a private copy of the dungeon, exactly as it does with one-world dungeons turned off.
Enabling one-world dungeons
In the plugin config.yml, there is a section called "Experimental" options. Add or set OneWorldDungeons: true to this section like so...
# These config options have potential to cause unforeseen issues and strangeness.
Experimental:
MovingBlocksMoveEntities: false
# Whether to keep all dungeons in a master world to avoid constantly loading and unloading worlds. SIGNIFICANTLY reduces risks of memory leaks.
# WARNING :: This does NOT load all dungeons into your existing survival worlds!! It creates a SEPARATE world that will host all the dungeons!
OneWorldDungeons: true
Setting up for one-world dungeons
If a dungeon has no regions configured, Mythic Dungeons falls back to copying every region file in the dungeon folder, and logs a warning at startup so you know it's happening:
WARNING :: The dungeon '<dungeon>' doesn't have its regions configured!
├─ One-world dungeons load much faster when you specify what regions contain the dungeon.
└─ See this article for more info on selecting regions: .../One-World-Dungeons#region-selection
Procedural dungeons never need regions and are exempt from that warning, because their rooms are generated straight into the shared world.
Region Selection
One-world dungeons copies and pastes the region files from dungeon worlds. By default, it will grab all region files from the dungeon, but it is HIGHLY recommended to specify which regions are actually a part of your dungeon in order to speed up loading times.

To see regions in Minecraft, you can open your F3 debug menu and find a section here that specifies what region you're standing in. In this example, the region is -2,-1. A new region begins every 512 blocks.
Once you've figured out which regions your dungeon is in, open the dungeon with /md edit <dungeon>, stand in each region and run /md addregion to mark the region for use. To remove the region you're standing in, run /md removeregion. Both commands take no arguments, both need the dungeons.edit permission, and both only work while you're inside an edit session. Outside one they abort with "You are not currently editing a dungeon!"
By manually configuring your regions, Mythic Dungeons will only copy the regions into the dungeon world that you tell it to, in most cases making it load faster.
What actually gets copied
For classic and continuous dungeons, only the selected region/ files and their matching entities/ files are cloned into the shared world, at shifted coordinates so instances never overlap. Entity UUIDs are re-rolled during the copy so the clones don't collide with the originals. Anything outside the regions you selected simply isn't there. If the copy fails or takes longer than 5 seconds, the allocation is rolled back and the instance doesn't load.
When an instance is cleaned up, its region, entity and POI files are deleted from the shared world shortly afterwards. A shared world is only unloaded and deleted once it is both full and empty, or when the plugin shuts down.
Limitations
Because every dungeon shares one world, some per-dungeon settings can't be applied the way they are in normal dungeons.
Gamerules
These gamerules from a dungeon's gamerules.yml still work per dungeon, because Mythic Dungeons re-implements them for the players inside that instance:
doFireTick, naturalRegeneration, doMobLoot, doEntityDrops, keepInventory, fallDamage, fireDamage, drowningDamage, freezeDamage, mobGriefing, doTileDrops, doMobSpawning, doPatrolSpawning, showDeathMessages, doImmediateRespawn.
doDaylightCycle and doWeatherCycle are handled by showing that dungeon's time and weather to its own players when they differ from the baseline configured below.
Every other gamerule, and the dungeon's saved world difficulty, is ignored. They belong to the shared world, so the last dungeon to set them would win. The first time a dungeon starts an instance, Mythic Dungeons logs the exact list of ignored rules for that dungeon once. Set them for all dungeons under Experimental.OneWorldDungeonsWorld in config.yml instead:
Experimental:
OneWorldDungeons: true
# Baseline world options for the shared OneWorldDungeons world. These apply to all dungeons.
# Dungeons can still override time and weather per-player when they differ from these values.
# Only the gamerules you list are changed; anything omitted keeps its vanilla default.
OneWorldDungeonsWorld:
# PEACEFUL, EASY, NORMAL, or HARD.
Difficulty: NORMAL
# Ticks. Only fixed when doDaylightCycle is false.
WorldTime: 6000
# CLEAR or DOWNFALL. Only fixed when doWeatherCycle is false.
WorldWeather: CLEAR
Gamerule:
keepInventory: false
doDaylightCycle: true
doWeatherCycle: true
mobGriefing: true
randomTickSpeed: 0
Two caveats about that warning: it is only printed the first time one of the dungeon's play instances is created, not when the dungeon is loaded, and procedural dungeons never print it at all. It also lists doImmediateRespawn as unsupported even though that rule is honoured.
Dungeon config rules that don't apply
These Rules.* options in a dungeon's config.yml do nothing while one-world dungeons are enabled, because they are world-wide settings:
Rules.SpawnMobs,Rules.SpawnAnimals,Rules.SpawnMonsters- use thedoMobSpawninggamerule in the dungeon's gamerules instead.Rules.DisableRandomTick- userandomTickSpeedunderOneWorldDungeonsWorld.Gamerule.
The area-based rules (block placing and breaking, plant growth, PvP, and the rest of the Rules. block) are checked against each instance's own area, so they keep working per dungeon. See Dungeon Config for every per-dungeon key, including the others that become a no-op here.