Open Luke616 opened 6 years ago
If you point me to Forge API event that happens only once when villager joins the world for the first time, I'll gladly remove this "feature". But I found only one event where you can somehow control villagers profession, which is EntityJoinWorldEvent that is fired everytime chunk with this entity loaded. So to prevent all farmers from shifting their profession I came up with this trick: give every villager that has been already processed once a custom name
villager.setCustomNameTag(name.getUnformattedComponentText());
Next time event is fired on the same villager once again we already know that this villager had a chance for shift and skip:
if (e.getEntity().hasCustomName()) return;
As for custom professions names, here's good article in VTT wiki that describes how to give your custom professions nice looking career names.
Thank you very much for the article link! Admittedly I know very little about the way forge handles these things. Is there some way you could assign every villager the first time it is "processed" some sort of NBT tag, which is checked for instead of the custom name?
I tried it, but it did not work, some digging through Forge source codes showed that it's pretty tricky, so I decided to go easy way.
I see. Well, thanks for the explanation - wish I could help more but I'm certainly not a modder. A bit of reading in the forge documentation pointed me to these pages, which might have more information on how to implement this type of feature. You've probably already read this stuff though, ah well. https://mcforge.readthedocs.io/en/latest/datastorage/extendedentityproperties/ https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
OK, I'll see what can be done, but no promises.
See title, the feature where a villager's name is replaced with its profession raises conflicts with the Village Names mod (it overwrites VN's custom villager names) and also causes some weirdness with VTT (a custom villager type with an improper name will cause the villager to be names something like entity.Villager.name)
Attached is an image of this second issue. Thanks again for this mod, its absolutely required for servers running VTT.