[PR #2331] [MERGED] Keep leashed mobs and carrying endermen from despawning #4210

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

📋 Pull Request Information

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

Base: main ← Head: fix/mob-custom-persistence


📝 Commits (1)

  • 90501f9 Keep leashed mobs and carrying endermen from despawning

📊 Changes

2 files changed (+16 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/natural_spawning.rs (+2 -1)
📝 crates/horizon-client/src/mobs/ai.rs (+14 -6)

📄 Description

What and why

Two kinds of mobs could despawn although vanilla keeps them: a mob on a lead, and an enderman carrying a block. The mob caps also counted them, so they used up room that vanilla leaves free. The despawn check and the cap count now share one helper that follows requiresCustomPersistence: a passenger, a leashed mob, a raider in a raid, an enderman carrying a block, a tame nautilus, and a sulfur cube holding a block or let out of a bucket (the last two were already there).

Vanilla reference

  • Mob.requiresCustomPersistence: isPassenger() || isLeashed().
  • Raider.requiresCustomPersistence: getCurrentRaid() != null.
  • Enderman.requiresCustomPersistence: getCarriedBlock() != null.
  • Mob.checkDespawn: isPersistenceRequired() || requiresCustomPersistence().
  • NaturalSpawner.createState: mobs with persistence required or custom persistence are not counted.

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/2331 **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/mob-custom-persistence` --- ### 📝 Commits (1) - [`90501f9`](https://github.com/horizon-rust/horizon/commit/90501f9ab4ab5cb04e85d6aa5d032d25e8e6bda2) Keep leashed mobs and carrying endermen from despawning ### 📊 Changes **2 files changed** (+16 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+2 -1) 📝 `crates/horizon-client/src/mobs/ai.rs` (+14 -6) </details> ### 📄 Description ## What and why Two kinds of mobs could despawn although vanilla keeps them: a mob on a lead, and an enderman carrying a block. The mob caps also counted them, so they used up room that vanilla leaves free. The despawn check and the cap count now share one helper that follows `requiresCustomPersistence`: a passenger, a leashed mob, a raider in a raid, an enderman carrying a block, a tame nautilus, and a sulfur cube holding a block or let out of a bucket (the last two were already there). ## Vanilla reference - `Mob.requiresCustomPersistence`: `isPassenger() || isLeashed()`. - `Raider.requiresCustomPersistence`: `getCurrentRaid() != null`. - `Enderman.requiresCustomPersistence`: `getCarriedBlock() != null`. - `Mob.checkDespawn`: `isPersistenceRequired() || requiresCustomPersistence()`. - `NaturalSpawner.createState`: mobs with persistence required or custom persistence are not counted. ## 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:30 +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#4210
No description provided.