[PR #2359] [MERGED] Make adult piglins hunt adult hoglins #4239

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

📋 Pull Request Information

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

Base: main ← Head: fix/piglins-hunt-adult-hoglins


📝 Commits (3)

  • 034af45 Make adult piglins hunt adult hoglins
  • 4b4361f Clear a piglin's hoglin target once it dies or disappears
  • fe9b207 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

3 files changed (+121 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+8 -0)
📝 crates/horizon-client/src/mobs.rs (+10 -0)
📝 crates/horizon-client/src/mobs/piglin.rs (+103 -10)

📄 Description

What and why

Piglins never hunted adult hoglins. Horizon only made adult piglins attack baby hoglins, which vanilla does not do (baby piglins only ride baby hoglins).

Now an adult piglin that is not angry at a player, has not hunted recently and sees no adult piglin that has, goes for the nearest adult hoglin it sees. After that it waits 30 to 120 seconds before the next hunt, the adult piglins around it wait too, and they take the hoglin as their target if they have none. A new piglin also waits 30 to 120 seconds before its first hunt.

The "hunted recently" wait is not saved with the world, so after a reload each piglin starts a fresh wait.

Vanilla reference

  • PiglinAi.initCoreActivity/idle activity: triggerIf(Piglin::canHunt, StartHuntingHoglin.create()).
  • StartHuntingHoglin: needs a huntable hoglin, no ANGRY_AT, no HUNTED_RECENTLY, no nearby adult piglin with HUNTED_RECENTLY; then setAngerTarget, dontKillAnyMoreHoglinsForAWhile on itself and the nearby piglins, broadcastAngerTarget.
  • PiglinAi.initMemories and TIME_BETWEEN_HUNTS (30 to 120 s); Hoglin.canBeHunted (adults only).

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/2359 **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/piglins-hunt-adult-hoglins` --- ### 📝 Commits (3) - [`034af45`](https://github.com/horizon-rust/horizon/commit/034af457778bab980cc95ca1c76c8e50471d49fc) Make adult piglins hunt adult hoglins - [`4b4361f`](https://github.com/horizon-rust/horizon/commit/4b4361fbc052751a5118192b312d857b4607c5c4) Clear a piglin's hoglin target once it dies or disappears - [`fe9b207`](https://github.com/horizon-rust/horizon/commit/fe9b20733aadd3d473393e31035dfccbc81fa09a) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **3 files changed** (+121 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+8 -0) 📝 `crates/horizon-client/src/mobs.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/piglin.rs` (+103 -10) </details> ### 📄 Description ## What and why Piglins never hunted adult hoglins. Horizon only made adult piglins attack baby hoglins, which vanilla does not do (baby piglins only ride baby hoglins). Now an adult piglin that is not angry at a player, has not hunted recently and sees no adult piglin that has, goes for the nearest adult hoglin it sees. After that it waits 30 to 120 seconds before the next hunt, the adult piglins around it wait too, and they take the hoglin as their target if they have none. A new piglin also waits 30 to 120 seconds before its first hunt. The "hunted recently" wait is not saved with the world, so after a reload each piglin starts a fresh wait. ## Vanilla reference - `PiglinAi.initCoreActivity`/idle activity: `triggerIf(Piglin::canHunt, StartHuntingHoglin.create())`. - `StartHuntingHoglin`: needs a huntable hoglin, no `ANGRY_AT`, no `HUNTED_RECENTLY`, no nearby adult piglin with `HUNTED_RECENTLY`; then `setAngerTarget`, `dontKillAnyMoreHoglinsForAWhile` on itself and the nearby piglins, `broadcastAngerTarget`. - `PiglinAi.initMemories` and `TIME_BETWEEN_HUNTS` (30 to 120 s); `Hoglin.canBeHunted` (adults only). ## 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:42 +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#4239
No description provided.