1

I am making a flat adventure/Survival map which is meant to be played for maybe a year or two and is made to make the game harder.

In the map when you spawn you have a big shop which is setted up with custom villagers using a online generator. There are 2 types of villagers one that sells items and one that buys items. Keep in mind the currency is emeralds.

But the problem is that zombie villagers are able to spawn within the world and I have only intended that the only way to achieve emeralds is by trading with the villagers within the shop.

I want some way to make them despawn or teleporting them to the void.

Keep in mind im not able to remove normal zombies due to that an important item within the shop is zombie flesh.

3

You will have to label zombies based on their IsVillager byte tag and then run commands based on the label.

1.8

Objective to use.

/scoreboard objectives add ZombieVillager dummy

Commands to run in numerical order.

  1. Set the "ZombieVillager" score to 1 for zombies with IsVillager set to 1.

    /scoreboard players set @e[type=Zombie] ZombieVillager 1 {IsVillager:1b}
    
  2. Teleport those zombies to the void.

    /tp @e[type=Zombie,score_ZombieVillager_min=1] ~ -64 ~
    

1.9

Commands to run in numerical order.

  1. Apply "ZombieVillager" label for zombies with IsVillager set to 1.

    /scoreboard players tag @e[type=Zombie,tag=!ZombieVillager] add ZombieVillager {IsVillager:1b}
    
  2. Teleport those zombies to the void.

    /tp @e[type=Zombie,tag=ZombieVillager] ~ -64 ~
    
  • Sorry to have watsed your time but I managed to fix the problem by only removing any effects form any zombies within the map making it possible for them to exist and letting the player be able to easily get zombie flesh. – Palestina Feb 9 '16 at 19:15
  • But still thank you! – Palestina Feb 9 '16 at 19:16
  • Just wondering, why not /kill them instead of /tping them into the void? – rustphoenix Feb 11 '16 at 17:47
  • @sharpturn /kill would leave any drops on the ground, potentially causing a great deal of lag if more and more spawn to be killed. Teleporting them into the void allows the void to kill them or, more likely, forces them to despawn. If killed, the drops are instantly deleted in the void. If despawned, then there's no worry of any drops at all. – Skylinerw Feb 11 '16 at 18:31
  • Ah, okay. Thanks! Always wondered why, since I'm used to having doMobLootoff. – rustphoenix Feb 12 '16 at 1:48
-1

Zombie villagers are now considered a separate type of entity, making it possible to easily target only them:

/tp @e[type=zombie_villager] ~ -64 ~

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.