[PR #2201] [MERGED] Zombies and vindicators break and open doors as in vanilla #4099

Closed
opened 2026-11-03 04:14:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2201
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/raider-and-zombie-doors


📝 Commits (4)

  • 628ff01 Only zombies that break doors and raiding vindicators get through doors
  • c75854a Send mob door cracks to nearby players
  • bf2c867 Zombies: roll canBreakDoors when the game spawns them
  • ac4309d Merge origin/main into fix/raider-and-zombie-doors

📊 Changes

12 files changed (+358 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+11 -1)
📝 crates/horizon-client/src/game.rs (+9 -1)
📝 crates/horizon-client/src/game/creatures.rs (+34 -0)
📝 crates/horizon-client/src/game/raids.rs (+2 -0)
📝 crates/horizon-client/src/mobs.rs (+19 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+1 -0)
➕ crates/horizon-client/src/mobs/doors.rs (+252 -0)
📝 crates/horizon-client/src/mobs/finalize.rs (+3 -2)
📝 crates/horizon-client/src/mobs/illager.rs (+9 -0)
📝 crates/horizon-client/src/mobs/raider.rs (+3 -0)
📝 crates/horizon-client/src/mobs/spawning.rs (+11 -0)
📝 crates/horizon-client/src/mobs/undead.rs (+4 -0)

📄 Description

What and why

Doors were never opened or broken by any mob except villagers and copper golems. Zombies that rolled canBreakDoors kept the flag but never used it, and vindicators ignored doors in a raid.

  • New mobs/doors.rs with the door goals: BreakDoor (zombie and vindicator versions) and RaiderOpenDoor.
  • Zombie family (zombie, husk, drowned, zombie villager, zombified piglin): goal at priority 1 that breaks a door in the path on Hard only, when the mob can break doors. set_can_break_doors also turns on the navigation's door opening, as Zombie.setCanBreakDoors does. The finalize rolls go through it.
  • Vindicator: break door goal at priority 2 (Normal and Hard, only with an active raid, holds movement) and open door goal at priority 3 (only with an active raid). Its navigation opens doors while a raid is within range of its position.
  • The break goal cracks the door for 240 ticks (destroy progress 0 to 9, attack sound with a swing now and then), then removes it, plays the break sound and sends level event 2001. It needs the mob griefing rule.
  • New level event sounds for 1019 and 1021, and new mob events for the crack, the level event and the door removal.
  • CanBreakDoors is now saved from the real value and read back on load, instead of always writing 0.

Vanilla reference

  • DoorInteractGoal, BreakDoorGoal, OpenDoorGoal
  • Zombie.setCanBreakDoors, Zombie.DOOR_BREAKING_PREDICATE (Hard), Zombie.finalizeSpawn
  • Vindicator.VindicatorBreakDoorGoal, Vindicator.DOOR_BREAKING_PREDICATE (Normal, Hard), Vindicator.customServerAiStep (ServerLevel.isRaided)
  • AbstractIllager.RaiderOpenDoorGoal
  • LevelEventHandler events 1019 and 1021

BreakDoorGoal.getDoorBreakTime is max(240, doorBreakTime), so the vindicator's 6 does not shorten it. The goal re-reads the block after removing it, so event 2001 carries air, as in vanilla.

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2201 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/raider-and-zombie-doors` --- ### 📝 Commits (4) - [`628ff01`](https://github.com/horizon-rust/horizon/commit/628ff01a44d74c43c2e0a2db4afbec532f4fab95) Only zombies that break doors and raiding vindicators get through doors - [`c75854a`](https://github.com/horizon-rust/horizon/commit/c75854a9683fc63045dc8b16fbd0f6d345c6262b) Send mob door cracks to nearby players - [`bf2c867`](https://github.com/horizon-rust/horizon/commit/bf2c8679660a72f3377e809ece12eb6aeaac32b9) Zombies: roll canBreakDoors when the game spawns them - [`ac4309d`](https://github.com/horizon-rust/horizon/commit/ac4309d3bfb9cb5deedb7abf11ecd585930e12bb) Merge origin/main into fix/raider-and-zombie-doors ### 📊 Changes **12 files changed** (+358 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+11 -1) 📝 `crates/horizon-client/src/game.rs` (+9 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+34 -0) 📝 `crates/horizon-client/src/game/raids.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs.rs` (+19 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+1 -0) ➕ `crates/horizon-client/src/mobs/doors.rs` (+252 -0) 📝 `crates/horizon-client/src/mobs/finalize.rs` (+3 -2) 📝 `crates/horizon-client/src/mobs/illager.rs` (+9 -0) 📝 `crates/horizon-client/src/mobs/raider.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/spawning.rs` (+11 -0) 📝 `crates/horizon-client/src/mobs/undead.rs` (+4 -0) </details> ### 📄 Description ## What and why Doors were never opened or broken by any mob except villagers and copper golems. Zombies that rolled `canBreakDoors` kept the flag but never used it, and vindicators ignored doors in a raid. - New `mobs/doors.rs` with the door goals: `BreakDoor` (zombie and vindicator versions) and `RaiderOpenDoor`. - Zombie family (zombie, husk, drowned, zombie villager, zombified piglin): goal at priority 1 that breaks a door in the path on Hard only, when the mob can break doors. `set_can_break_doors` also turns on the navigation's door opening, as `Zombie.setCanBreakDoors` does. The finalize rolls go through it. - Vindicator: break door goal at priority 2 (Normal and Hard, only with an active raid, holds movement) and open door goal at priority 3 (only with an active raid). Its navigation opens doors while a raid is within range of its position. - The break goal cracks the door for 240 ticks (destroy progress 0 to 9, attack sound with a swing now and then), then removes it, plays the break sound and sends level event 2001. It needs the mob griefing rule. - New level event sounds for 1019 and 1021, and new mob events for the crack, the level event and the door removal. - `CanBreakDoors` is now saved from the real value and read back on load, instead of always writing 0. ## Vanilla reference - `DoorInteractGoal`, `BreakDoorGoal`, `OpenDoorGoal` - `Zombie.setCanBreakDoors`, `Zombie.DOOR_BREAKING_PREDICATE` (Hard), `Zombie.finalizeSpawn` - `Vindicator.VindicatorBreakDoorGoal`, `Vindicator.DOOR_BREAKING_PREDICATE` (Normal, Hard), `Vindicator.customServerAiStep` (`ServerLevel.isRaided`) - `AbstractIllager.RaiderOpenDoorGoal` - `LevelEventHandler` events 1019 and 1021 `BreakDoorGoal.getDoorBreakTime` is `max(240, doorBreakTime)`, so the vindicator's 6 does not shorten it. The goal re-reads the block after removing it, so event 2001 carries air, as in vanilla. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:39 +07:00
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#4099
No description provided.