[GH-ISSUE #3429] Zombie villagers with NoAI never finish curing #972

Closed
opened 2026-11-02 15:43:14 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @degepie on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3429

🤖 Filed by degepie's AI agent (Claude Code), not by degepie personally.

What happens

A zombie villager with NoAI:1b never finishes curing: its ConversionTime stays where it was, so it is a zombie forever. Without NoAI the same zombie villager turns into a villager as expected.

What vanilla does

ZombieVillager.tick counts villagerConversionTime down every tick (by getConversionProgress, sped up by nearby iron bars and beds) and calls finishConversion at zero. It does this on the server for any living, converting zombie villager. The mob's AI does not matter: this is in tick, not in serverAiStep/customServerAiStep, which are the parts NoAI turns off.

Where in Horizon

At origin/main 142388e1c:

  • crates/horizon-client/src/mobs/zombie_villager.rs:98 step counts the cure down. It is called from undead::custom_server_ai_step (crates/horizon-client/src/mobs/undead.rs:566-568).
  • That runs from server_ai_step (crates/horizon-client/src/mobs/ai.rs:1226), which runs from ai_step (ai.rs:963).
  • ai.rs:490 skips the whole of ai_step when m.no_ai:
    if m.no_ai {
        // Mob.aiStep still runs without AI (only serverAiStep is skipped),
        // so the endermite's life keeps counting.
        if m.species() == Species::Endermite { endermite_lifetime(m); }
    } else {
        ai_step(m, w, level_random, events);
    }
    
    So the countdown is tied to the AI when it should be tied to the tick.

How to reproduce (seen in game, current main, default server thread, Easy)

/summon minecraft:zombie_villager ~4 ~ ~ {NoAI:1b,ConversionTime:40,PersistenceRequired:1b,Tags:["za"]}
/summon minecraft:zombie_villager ~-4 ~ ~ {ConversionTime:40,PersistenceRequired:1b,Tags:["zb"]}

Wait a few seconds, then /data get entity @e[tag=za,limit=1] ConversionTime.

  • Without NoAI (zb): it became a villager within 5 s.
  • With NoAI (za): ConversionTime was still 40 after about 25 s, and the mob was still a zombie villager.

In vanilla both are villagers after 2 s.

Notes

  • The fix is to run the cure countdown from the mob's tick for every converting zombie villager, whatever its NoAI flag is. It should also stay before the rest of the tick, as vanilla runs it before super.tick().
  • Related: #3404 (cure credit on the server thread). It doesn't touch this. A separate issue covers NoAI undead not burning in daylight, which has the same ai.rs:490 cause but a different vanilla hook.
Originally created by @degepie on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3429 > 🤖 Filed by degepie's AI agent (Claude Code), not by degepie personally. ## What happens A zombie villager with `NoAI:1b` never finishes curing: its `ConversionTime` stays where it was, so it is a zombie forever. Without NoAI the same zombie villager turns into a villager as expected. ## What vanilla does `ZombieVillager.tick` counts `villagerConversionTime` down every tick (by `getConversionProgress`, sped up by nearby iron bars and beds) and calls `finishConversion` at zero. It does this on the server for any living, converting zombie villager. The mob's AI does not matter: this is in `tick`, not in `serverAiStep`/`customServerAiStep`, which are the parts NoAI turns off. ## Where in Horizon At `origin/main` 142388e1c: - `crates/horizon-client/src/mobs/zombie_villager.rs:98` `step` counts the cure down. It is called from `undead::custom_server_ai_step` (`crates/horizon-client/src/mobs/undead.rs:566-568`). - That runs from `server_ai_step` (`crates/horizon-client/src/mobs/ai.rs:1226`), which runs from `ai_step` (`ai.rs:963`). - `ai.rs:490` skips the whole of `ai_step` when `m.no_ai`: ```rust if m.no_ai { // Mob.aiStep still runs without AI (only serverAiStep is skipped), // so the endermite's life keeps counting. if m.species() == Species::Endermite { endermite_lifetime(m); } } else { ai_step(m, w, level_random, events); } ``` So the countdown is tied to the AI when it should be tied to the tick. ## How to reproduce (seen in game, current main, default server thread, Easy) ``` /summon minecraft:zombie_villager ~4 ~ ~ {NoAI:1b,ConversionTime:40,PersistenceRequired:1b,Tags:["za"]} /summon minecraft:zombie_villager ~-4 ~ ~ {ConversionTime:40,PersistenceRequired:1b,Tags:["zb"]} ``` Wait a few seconds, then `/data get entity @e[tag=za,limit=1] ConversionTime`. - Without NoAI (`zb`): it became a villager within 5 s. - With NoAI (`za`): `ConversionTime` was still `40` after about 25 s, and the mob was still a zombie villager. In vanilla both are villagers after 2 s. ## Notes - The fix is to run the cure countdown from the mob's tick for every converting zombie villager, whatever its NoAI flag is. It should also stay before the rest of the tick, as vanilla runs it before `super.tick()`. - Related: #3404 (cure credit on the server thread). It doesn't touch this. A separate issue covers NoAI undead not burning in daylight, which has the same `ai.rs:490` cause but a different vanilla hook.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#972
No description provided.