Jump to content

[1.15.2] How to add villager and structure to village


lisilew

Recommended Posts

I want to add a structure to vanilla villages where custom villager will be spawned in.

I know I should ask questions after I have tried something but I absolutely have no ideas where and how to begin with.

I would really appreciate some helps regarding things below.

  1. I want a custom villager who does not trade but open a GUI when right clicked. I believe I should use EntityInteract or override openMerchantContainer to open the GUI instead of trade. Then, how can I prevent the villager from getting profession and make it use one texture regardless of biomes?
  2. I want to add a custom structure to all biomes villages. I might create different structures for different biomes but for now, I just want one structure regardless of biomes. Do I just add nbt files under data/minecraft/structures/village or are there more steps I should take?
  3. Is it possible to set in which structure the villager is going to spawn? For example, if I do not want the structure to spawn all the time (which I also want to know how to set probability), I also do not want the villager to spawn without the structure. If setting probability is not possible, i just want the villager to spawn in the structure. It is okay to move around in the village, but I want the initial spawn to be the structure.

Instead answering all questions, providing me with mod that achieves the same would also help.

Link to comment
Share on other sites

So far, I have found out that I need to register my NBT files using JigsawPatternRegistry to generate structures.

And I can use jigsaw block to spawn entity.

I have registered my structures using coremod to call my PlainsVillagePools#init instead of vanilla one but I feel like there is a way to do it without using coremod.

Also, how do I make my structures are generated only one per village with probability?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.