I got rid of the classes and tried making it so in my…
- User
I got rid of the classes and tried making it so in my resources/data/minecraft/structures/village/plains/houses I have all the nbts and they are named after the minecraft ones trying to "replace" them and when you do the /place command it will place my structure but if I look in real villages by flying around and using /locate village_plains it seems like there is no houses that I replaced for example before I replaced the plains_tannery it would spawn but since I replaced it with mine it will not spawn in the actual village now and that's the same for all of the ones I have replaced
Assistant
To resolve the issue where your custom village houses aren't spawning in actual villages, follow these steps:
1. Fix Structure Pool Registration
Your current code isn't properly registering the modified structure pool. Update your
ModStructurePoolsclass:package net.mattias.marloevillages.registry; import net.mattias.marloevillages.MarloeVillages; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.level.levelgen.structure.pools.*; import net.minecraftforge.eventbus.api.IEventBus; import net.mattias.marloevillages.util.ModConstants; import java.util.List; public class ModStructurePools { public static void register() { // Register during common setup modifyPlainsVillage(); } private static void modifyPlainsVillage() { ResourceLocation poolLocation = new ResourceLocation("village/plains/houses"); StructureTemplatePool originalPool = StructureTemplatePool.getPoolByLocation(poolLocation); if (originalPool == null) { MarloeVillages.LOGGER.error("Original plains village pool not found!"); return; } // Create new elements pointing to your custom structures List<StructurePoolElement> newElements = List.of( StructurePoolElement.single(new ResourceLocation(ModConstants.MOD_ID, "village/plains/marloe_house_1")) .apply(StructureTemplatePool.Projection.RIGID) .build(), StructurePoolElement.single(new ResourceLocation(ModConstants.MOD_ID, "village/plains/marloe_house_2")) .apply(StructureTemplatePool.Projection.RIGID) .build() ); // Create modified pool StructureTemplatePool modifiedPool = new StructureTemplatePool( poolLocation, originalPool.getFallback(), newElements, originalPool.getProjection() ); // Override the vanilla pool StructurePoolRegistry.registerPool(poolLocation, modifiedPool); } }2. Call Registration During Mod Setup
Update your main mod class to trigger registration:
// In MarloeVillages.java private void commonSetup(final FMLCommonSetupEvent event) { ModStructurePools.register(); // Add this line }3. Ensure Custom Structures Are Registered
Verify your NBT files are in the correct location and registered. For Forge 1.20.1:
-
Place NBT files in your mod's resources:
resources/data/marloevillages/structures/village/plains/marloe_house_1.nbt resources/data/marloevillages/structures/village/plains/marloe_house_2.nbt -
Register structures in your mod's common setup:
// In MarloeVillages.java commonSetup() event.enqueueWork(() -> { StructureTemplateRegistry.register( new ResourceLocation(ModConstants.MOD_ID, "village/plains/marloe_house_1"), new StructureTemplate() // Load your NBT here ); // Repeat for marloe_house_2 });
4. Verify Biome Tags
Ensure your custom structures have the
villagetag intags/blocks/village.json:{ "replace": false, "values": [ "marloevillages:village/plains/marloe_house_1", "marloevillages:village/plains/marloe_house_2" ] }5. Check Resource Locations
- Pool elements must reference your mod's namespace:
marloevillages:village/plains/marloe_house_1 - NBT files must be in
data/marloevillages/structures/...
6. Test in Game
- Generate a new world
- Use
/locate village_plainsto find a village - Verify your custom houses appear
Common Fixes If Issues Persist:
- Clear Cached Data: Delete the
worldfolder and regenerate the world - Check Logs: Look for structure loading errors in
latest.log - Validate NBT: Ensure your NBT files aren't corrupted and are properly formatted
By following these steps, your custom village houses should now spawn in naturally generated plains villages.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.