Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-45586

Villager Careers can be set to overflowed numbers



    • Bug
    • Resolution: Fixed
    • Minecraft 1.8
    • Minecraft 14w04a, Minecraft 14w04b, Minecraft 14w05a, Minecraft 14w05b, Minecraft 14w31a
    • None
    • Unconfirmed


      While attempting to document which Career IDs pertain to which subclasses of Villager, I noticed that the game was setting Careers to overflowed numbers.

      Example: Butcher/White Apron villagers have Leatherworker and Butcher subclasses. Leatherworker is Career 0 and Butcher is Career 1. Upon testing the NBT of summoned Villagers, I noticed the game was setting White Apron villagers to Career 2. Similarly, I found this issue with Blacksmiths, whereas they'd be set to Career 3 when they only have 3 careers (Tool Smith: 0, Armorer: 1, Weapon Smith: 2).

      While this normally isn't a problem as the game cycles back through the list when numbers above usual are used, this presents an issue with systems which check the NBT of entities. You could expand the checks for multiple values, but considering these values normally shouldn't be used in the first place, I'd find this an error.

      It is difficult to test this. In summoning villagers, the game sometimes accepts given Career NBT and at other times will randomly set the Career NBT. However, these are the two base commands I use for summoning and testing villagers:

      /summon Villager ~1 ~-1 ~ {Profession:4,Career:1}
      /testfor @e[type=Villager,r=3] {Career:1}

      You would change the Career:# to whichever you wish and test for villagers nearby. I built a command block system around this for automation, and can provide a world download if needed. I would have to generate a new world and rebuild it to keep the filesize down, though.




            Unassigned Unassigned
            megascience MegaScience
            3 Vote for this issue
            4 Start watching this issue