Posted April 16, 20187 yr So I've been trying to add a custom villager to the game and I have added a villager profession and career and set up a trade and everything is working when I use a spawn egg I can get the villager from it however they don't seem to be spawning naturally in villages. Do I need to add a structure for them to spawn with or is there something else that I need to do to get them to spawn? My Professions Class: https://github.com/Hazmatik/SonicTech/blob/master/src/main/java/hazmatik/sonictech/init/STProfessions.java and here is where it is called in the init() of my main mod class: https://github.com/Hazmatik/SonicTech/blob/master/src/main/java/hazmatik/sonictech/SonicTech.java#L49 Edited April 16, 20187 yr by Hazmatik
April 16, 20187 yr The proper way is to add some village structure pieces. In the StructureVillagePieces.Village class there is a chooseForgeProfession() method where you return the villager type you want to populate. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
April 18, 20187 yr Author Is it possible to load a village structure from an NBT file created from Structure Blocks? I decided on adding a structure in the village for my villager to spawn with and I am trying to wrap my head around how to define the different blocks of the structure and was thinking it would be a lot easier if I could build the structure in world and use a Structure Block to export it to an NBT file like I've done before to spawn structures in the world in general.
April 19, 20187 yr 15 hours ago, Hazmatik said: Is it possible to load a village structure from an NBT file created from Structure Blocks? I decided on adding a structure in the village for my villager to spawn with and I am trying to wrap my head around how to define the different blocks of the structure and was thinking it would be a lot easier if I could build the structure in world and use a Structure Block to export it to an NBT file like I've done before to spawn structures in the world in general. Yeah, in your method for addComponentParts() it is up to you how you place the blocks. It is your code, so you can do whatever you want there, either using loops to generate algorithmically, using arrays to generated based on a "map", using a file to load a structure, etc. What I usually do is create a command where I can "capture" an area of the world as an array of blocks and store that to file. Then I just copy that array directly into my code and loop through it. Here is an example of the command I use: https://github.com/jabelar/ExampleMod-1.12/blob/master/src/main/java/com/blogspot/jabelarminecraft/examplemod/commands/CommandStructureCapture.java. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
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.