Started by
Joghdae
on
Topic category: Help with Minecraft modding (Java Edition)
Hello everyone, I'm makeing a mod about plagues and I want to make so if a villager is infected with the plague it stays near his bed until you cure him.
I also want to make them unable to trade with you unless they don't have the plague anymore. That's all.
Edited by Joghdae on Wed, 08/16/2023 - 18:01
I had done a similar thing involving a plague in incmod. What I had to do to figure this out was make a custom entity that was a plagued villager/entity. I made a whole model and went the long route for that but if you're wanting to keep it simple you can just texture the villager model mcreator offers. Then, When an entity contracts this plague, the entity despawns and is replaced with the plagued entity. You can reverse this when cured. Do not assign the plagued entity as a villager when creating it and it will then not be able to trade with you. You can then set the ai to seek indoors if possible. This will cause your entity to stay inside of a home anytime it can. You can then have your entity seek out something specific in the world, similar to the Alay in the basegame. You can set this to beds, and when your plagued villager finds said bed, if you make sure it's ai is not allowed to break blocks. It'll sorta just hang around the bed.
The main thing I can't help you with is getting your villager to actually sleep in the bed. I couldn't figure that out either. I hope this helps any and best of luck!
Thanks for the suggestion, I'm going to try it. Thanks.
Let me know how it goes and if you need any more help.