quilt-standard-libraries icon indicating copy to clipboard operation
quilt-standard-libraries copied to clipboard

Add event for adding to, removing, or otherwise modifying a structure's spawn override

Open TelepathicGrunt opened this issue 2 years ago • 1 comments

The spawn overrides that structures have is made with records and immutable maps/lists to the point it's very difficult for a mod to add their mobs to a structure that isn't their own. For example, Pillager Outposts. Those use spawn overrides to spawn pillagers. If you want to add a Flamethrower Pillager to spawn over time in that structure, you'll want to get it into the spawn override.

Mixin into the initial spawn override map for outposts is not ideal because any mod or datapack that overrides the structure with a structure json file will override the mixin's changes. Think Savage and Ravage mod on Forge where they changed outposts to be better but did not change the spawn overrides. We would want a mod adding new mobs to outposts to work alongside mods that overhaul the outpost.

Forge already provides an event for adding to any structure's spawn override. It is called StructureSpawnListGatherEvent in 1.18 for any research purpose. They are also looking to migrate that event into their brand new biome modifier system but for structure overrides in 1.19 since 1.19 broke the event.

The discord convo that sparked this:

image image

TelepathicGrunt avatar Jun 12 '22 22:06 TelepathicGrunt

Complicated now that everything is in JSON.

Mysterious-Dev avatar Feb 20 '23 16:02 Mysterious-Dev