(IDEA) Checking the profession of a villager

Started by ImSeyo on

Topic category: Feature requests and ideas for MCreator

Last seen on 18:44, 23. Apr 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(IDEA) Checking the profession of a villager
Thu, 04/11/2024 - 11:10 (edited)

At the time of development on one of my mods, I ran into a problem - I needed to check if a villager had a certain profession. As it turned out, there is no procedural block in MCreator responsible for this. I would like you to do that. After a while, I managed to find a way to solve this problem (using custom code), but it does not work with the custom professions of the villagers. To make it easier for you, I'll leave the code:
((Villager) entity).getVillagerData().getProfession() == VillagerProfession.PROFESSIONNAME

Edited by ImSeyo on Thu, 04/11/2024 - 11:10