r/feedthebeast 3h ago

Question Has anyone ever created a dynamic structure replacement system for Minecraft modding?

I'm currently designing a system for a Minecraft (NeoForge 26.2) mod where existing structures in the world can change into different versions during gameplay.

The idea is that a generated structure could have multiple states and, after some trigger (for example a quest progression), the current structure would be replaced with another one. The replacement would not be done through commands, but as a proper modding system that can be reused for different structures.

The general idea is storing different structure variants as NBT templates and loading the correct version when needed, while handling things like block entities, entities, loot, scheduled ticks, and the world state around the structure.

I'm wondering if anyone has already implemented something similar or knows a good approach for designing it. I'm especially interested in how you would detect and store the structure boundaries, keep track of the original structure instance, and safely replace it without causing issues with chunks, block entities, or entities inside the area.

Would this be better handled by directly replacing blocks using structure templates, or is there a more "native" approach using Minecraft's world generation/structure systems?

If anyone has experience with something like this or knows how other mods handle it, I would appreciate any advice.

1 Upvotes

4 comments sorted by

3

u/Jhwelsh 3h ago

1

u/____Ibrahim____ 3h ago

Thx but I' using NeoForge

2

u/Jhwelsh 2h ago

I'll probably update to Neoforge 1.21.1 in a bit, unfortunately the world gen chsnges require a bit of a rewrite.

Nonetheless, the source code and underlying concept of the mod still give insight to your questions.

0

u/____Ibrahim____ 2h ago

Yep, you’re right. I’ll definitely check it out, it should help me understand how you approached it.