i just created Trial Chambers Instance

  • Thread starter Thread starter /u/No_Unit9980
  • Start date Start date
U

/u/No_Unit9980

Guest
i just created Trial Chambers Instance

Every player gets their own fresh Trial Chamber — no more arriving to find it already cleared or looted by someone else.

How Instance Creation Works:​

1. Void World​


When the plugin loads for the first time, it creates a dedicated blank world called trial_chamber_instances. This world is completely empty — no terrain, no mobs, no weather. It only exists as a neutral space to paste dungeons into

The world persists across server restarts so that active instances are kept intact

2. Grid Layout​


The void world is divided into an invisible grid. Each cell in the grid is 2000 blocks apart, arranged in rows of 100

When a new instance is needed, the plugin picks the next free grid cell — for example cell (0, 0), then (1, 0), then (2, 0), and so on. When an instance is finished and wiped, its cell is returned to the pool and can be reused by a future instance

This means up to 100 instances per row, expanding downward indefinitely, instances never collide with each other

3. Schematic Paste​


Once a grid cell is reserved, the plugin randomly picks one .schem file from its structures/ folder and pastes it into the reserved area using FastAsyncWorldEdit, centered at Y=64 of that cell. The paste runs on a background thread so the server doesn't freeze.

4. Post-Paste Setup​


After the structure appears in the world, the plugin does a quick scan of all blocks inside the pasted area to:

  • Find and register every Trial Spawner and Vault block
  • Reset Vault block data so fresh loot tables are applied correctly (normal and ominous vaults handled separately)
  • Reset Trial Spawner data and increase their player detection range from vanilla's 14 blocks to 40 blocks so they activate from further away
  • Find a safe two-block-high air gap to use as the spawn point for players

5. Teleportation​


All party members are teleported to the spawn point at the same time. Their current overworld location is saved so they can be returned there when the instance ends

6. Cleanup​


When the instance ends (all vaults opened, grace timer expired, or all players left), the plugin:

  1. Teleports all remaining players back to their overworld locations
  2. Wipes all blocks in that grid cell (overwrites the structure with air)
  3. Frees the grid cell back to the pool for future use
  4. Removes all session data from memory
submitted by /u/No_Unit9980
[link] [comments]

Continue reading...
 
Back
Top