Zombie Villager

Registry name

etfuturum.zombieVillager

Basic info

  • Health: Inherited from EntityZombie (standard zombie health)
  • Armor: Inherited from EntityZombie
  • Size: Inherited from EntityZombie (standard zombie size)
  • Spawn conditions: Same as zombie (light ≤ 7), but also when a villager is killed by a zombie (conversion)
  • Drops: Same as zombie (rotten flesh, equipment, etc.)
  • Behaviour: Villager-variant zombie. Can be cured with a golden apple + potion of weakness. Converts back to EntityVillager on cure.

Key features

Feature Details
Profession Random 0–5 (determined at spawn, stored in data watcher id 15)
Conversion cure Golden apple + weakness potion → convertToVillager()
Child state Locked to false (always adult)
Villager flag isVillager() returns true

Conversion (convertToVillager)

Called by player using golden apple on weakness-affected zombie:

  1. Creates new EntityVillager at same position
  2. Copies location and angles
  3. Sets villager profession to the stored type (0–5)
  4. Applies confusion potion (200 ticks) to the new villager
  5. Removes zombie, spawns villager
  6. Plays villager cure sound (1017)

NBT data

  • "VillagerType": integer 0–5 (profession)
  • Stored in data watcher id 15 (int)

AI tasks

Inherited from EntityZombie:

  • Melee attack player
  • Melee attack villager
  • Move through village
  • Wander, watch, look idle
  • Target: hurt-by-target → player → villager

Notes

  • Extends EntityZombie directly
  • setChild(boolean) overridden as no-op — zombie villagers are always adult
  • isChild() always returns false
  • Spawn egg: uses ModEntityList.getEggFromEntity (returns zombie villager egg)
  • onSpawnWithEgg: sets random profession type 0–5
  • Sound IDs: minecraft:entity.zombie_villager.ambient, .hurt, .death, .step