Posted January 6, 20187 yr Can someone explain the base concept of generating structures like end cities or woodland mansions? I know they use different components to build it together, but how does the base concept work and what classes do I need to set such a generation up? I already know how to write structures from ingame to nbt. Edited January 6, 20187 yr by ArmamentHaki
January 8, 20187 yr Author 9 hours ago, deerangle said: look at net.minecraft.world.gen.structure.StructureVillagePieces I noticed that but I was asking for a general overview because there are so many different classes that Minecraft uses and it is hard to keep track of what is where. In my case, I want to generate Villages aswell, but I think Minecraft Villages dont use NBT but hard coded files.
January 8, 20187 yr Although there are ways of generating structures from NBT files Minecraft uses min and max x, y, and z coordinates to decide which blocks go where. The StructureVillagePieces class is an example of this. In order to create a new village component (building) create a class that extends StructureVillagePieces.Village which will be your code for the building itself. An example of this can be found here. You will also need to create a handler the implements IVillageCreationHandler in which you will refer to your new village component class. In your main class preInit you will then need to use VillagerRegistry.instance().registerVillageCreationHandler(); to register your handler and MapGenStructureIO.registerStructureComponent(); to register the component itself. If you want to create an entirely new village instead of single buildings I recommend looking at Galacticraft's code for Moon Villages. Although I haven't look into them much I imagine End Cities and Woodlands are similar to this.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.