[PR #2348] [MERGED] Let silverfish hide in stone and wake their friends when hurt #4228

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

📋 Pull Request Information

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

Base: main ← Head: fix/silverfish-merge-and-wake-friends


📝 Commits (3)

  • b92dd80 Let silverfish hide in stone and wake their friends when hurt
  • 1f457ff Merge main into fix/silverfish-merge-and-wake-friends
  • 417ee43 Merge main into fix/silverfish-merge-and-wake-friends

📊 Changes

5 files changed (+205 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+42 -0)
📝 crates/horizon-client/src/mobs.rs (+8 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+5 -1)
📝 crates/horizon-client/src/mobs/hostile.rs (+149 -1)
📝 crates/horizon-client/src/mobs/spawn_selection.rs (+1 -1)

📄 Description

What and why

Silverfish only walked around and bit. They never hid in stone blocks, and hitting one did not wake the silverfish hidden in nearby blocks.

Silverfish now have their own goals:

  • Merge with stone: when idle and with mob griefing on, a silverfish sometimes picks a random neighbouring block; if it is a stone-type host block it turns into the infested block and the silverfish goes away with a poof.
  • Wake up friends: 20 ticks (10 with the reduced goal rate) after being hurt by an entity or by magic, it scans x/z within 10 and y within 5 and breaks the infested blocks it finds (stopping on a coin flip after each). With mob griefing off they turn back into their host block instead.
  • Its hurt-by target goal now alerts other silverfish, and it no longer gets the generic look-around goals.

A mob breaking an infested block with drops now releases its silverfish (same as a player break in #2135), so waking friends spawns the silverfish. A new MobEvent::Infest swaps a block between its host and infested form and keeps the deepslate axis, so it works on the server thread path too.

Vanilla reference

  • Silverfish.registerGoals, SilverfishMergeWithStoneGoal, SilverfishWakeUpFriendsGoal, Silverfish.hurtServer.
  • InfestedBlock.isCompatibleHostBlock, infestedStateByHost, hostStateByInfested, spawnAfterBreak.
  • Level.destroyBlock with drops.

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/2348 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/silverfish-merge-and-wake-friends` --- ### 📝 Commits (3) - [`b92dd80`](https://github.com/horizon-rust/horizon/commit/b92dd805668a9a6a3ab5deee65054fcad0c54407) Let silverfish hide in stone and wake their friends when hurt - [`1f457ff`](https://github.com/horizon-rust/horizon/commit/1f457ff81eee74eb7d29ce82216c07d8573ecc4e) Merge main into fix/silverfish-merge-and-wake-friends - [`417ee43`](https://github.com/horizon-rust/horizon/commit/417ee432c5803a033a197a2178ac4a09db40f9c6) Merge main into fix/silverfish-merge-and-wake-friends ### 📊 Changes **5 files changed** (+205 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+42 -0) 📝 `crates/horizon-client/src/mobs.rs` (+8 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+5 -1) 📝 `crates/horizon-client/src/mobs/hostile.rs` (+149 -1) 📝 `crates/horizon-client/src/mobs/spawn_selection.rs` (+1 -1) </details> ### 📄 Description ## What and why Silverfish only walked around and bit. They never hid in stone blocks, and hitting one did not wake the silverfish hidden in nearby blocks. Silverfish now have their own goals: - Merge with stone: when idle and with mob griefing on, a silverfish sometimes picks a random neighbouring block; if it is a stone-type host block it turns into the infested block and the silverfish goes away with a poof. - Wake up friends: 20 ticks (10 with the reduced goal rate) after being hurt by an entity or by magic, it scans x/z within 10 and y within 5 and breaks the infested blocks it finds (stopping on a coin flip after each). With mob griefing off they turn back into their host block instead. - Its hurt-by target goal now alerts other silverfish, and it no longer gets the generic look-around goals. A mob breaking an infested block with drops now releases its silverfish (same as a player break in #2135), so waking friends spawns the silverfish. A new `MobEvent::Infest` swaps a block between its host and infested form and keeps the deepslate axis, so it works on the server thread path too. ## Vanilla reference - `Silverfish.registerGoals`, `SilverfishMergeWithStoneGoal`, `SilverfishWakeUpFriendsGoal`, `Silverfish.hurtServer`. - `InfestedBlock.isCompatibleHostBlock`, `infestedStateByHost`, `hostStateByInfested`, `spawnAfterBreak`. - `Level.destroyBlock` with drops. ## 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:15:37 +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#4228
No description provided.