4/10/2024 0 Comments Minecraft build a forge villageYou can understand the weights but looking at the vanilla village piece weights. The registration requires you to set a "weight" for the chance it will be generated. Register creation handler: Important: Your IVillageCreationHandler must be registered in your init loading phase using the VillageRegistry.getInstance().registerVillageCreationHandler() method.In the handler class you need to implement the getVillagePieceWeight(), the getComponentClass() and getBuildComponent() method to return your village piece. Create custom creation handler: After creating the village piece class you need to create a class that implements the IVillageCreationHandler interface.Register piece: Important: Your custom piece needs to be registered in the init phase of loading with the MapGenStructureIO.registerStructureComponent() method.At a minimum you need to implement the addComponentParts() method. Some vanilla examples are Church, Field1, etc. Create custom piece: creating a custom class that extends and implements the abstract class StructureVillagePieces.Village class. You can edit it directly in the init loading phase of your mod using any standard List methods such as add(), remove(), clear() etc.Īdding Custom Village Structure "Pieces" To Vanilla VillagesĪ vlllage "piece" is a whole building like a church or other element like a field. The MapGenVillage class has a public static list of viable biomes called VILLAGE_SPAWN_BIOMES. Getting Villages To Generate In Different Biomes Important: If you handle the event make sure you return a Result.DENY in order for your replacement to be used. There is an event called BiomeEvent.GetVillageBlockID which can be used to replace construction blocks (not the crops and stuff, but rather the walls, planks, stairs) in villages. You can add new pieces to villages by: Create custom piece: creating a custom class that extends and implements the abstract class StructureVillagePieces. Replacing Construction Blocks In Vanilla Villages It is common for modders to want to either customize villages either in terms of the structures or the villagers themselves. The generation is semi-random but has certain organization and then the villagers have complicated behaviors and "professions" that can change according to the size of the villages.įor more information on villages, see the Official Wiki entry on villages. Villages in Minecraft are actually one of the most complicated parts of the game logic.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |