[PR #2325] [MERGED] Use the real local difficulty for the phantom spawn check #4208

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

📋 Pull Request Information

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

Base: main ← Head: fix/phantom-difficulty


📝 Commits (1)

  • 6dcf4b3 Use the real local difficulty for the phantom spawn check

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/stats.rs (+3 -2)

📄 Description

What and why

The phantom spawn check used a fixed effective difficulty of 2 (normal difficulty with no local difficulty). Phantoms spawned the same way on easy, hard and in long-played areas, and on peaceful the check still passed. The check now uses the local difficulty at the player's position, the same one used for mob spawning, and keeps the same order of random draws.

Vanilla reference

  • PhantomSpawner.tick: level.getCurrentDifficultyAt(playerPos) and difficulty.isHarderThan(random.nextFloat() * 3.0F).
  • DifficultyInstance.isHarderThan: effectiveDifficulty > requiredDifficulty.

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/2325 **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/phantom-difficulty` --- ### 📝 Commits (1) - [`6dcf4b3`](https://github.com/horizon-rust/horizon/commit/6dcf4b3e8bbe734a1d906111405875ecee668579) Use the real local difficulty for the phantom spawn check ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/stats.rs` (+3 -2) </details> ### 📄 Description ## What and why The phantom spawn check used a fixed effective difficulty of 2 (normal difficulty with no local difficulty). Phantoms spawned the same way on easy, hard and in long-played areas, and on peaceful the check still passed. The check now uses the local difficulty at the player's position, the same one used for mob spawning, and keeps the same order of random draws. ## Vanilla reference - `PhantomSpawner.tick`: `level.getCurrentDifficultyAt(playerPos)` and `difficulty.isHarderThan(random.nextFloat() * 3.0F)`. - `DifficultyInstance.isHarderThan`: `effectiveDifficulty > requiredDifficulty`. ## 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:29 +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#4208
No description provided.