How to teleport only unemployed villagers



  • How does one teleport only unemployed villagers in Minecraft 1.18.2 java edition?

    I have tried the following:

    tp @e[type=villager, nbt={VillagerData:{profession:"minecraft:unemployed"}}, limit=2] Romans1234
    

    tp @e[type=villager, nbt={VillagerData:{profession:"minecraft:0"}}, limit=2] Romans1234

    tp @e[type=villager, nbt={VillagerData:{profession:"minecraft:none"}}, limit=2] Romans1234

    tp @e[type=villager, nbt={VillagerData:{profession:""}}, limit=2] Romans1234



  • Thanks to @BsAxUbx5KoQDEpCAqSffwGy554PSah for providing the link towards the Minecraft Villager professions. From there I was able to find the solution:

    /tp @e[type=minecraft:villager, nbt={VillagerData:{profession:"Minecraft:none"}}] Romans1234
    

    The fault in the code mentioned in the question, is that I forgot to add minecraft: to the type parameter.

    The above code will teleport all villagers without a profession to a player named Romans1234.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2