[PR #7819] Use the entity-type Peaceful policy for summon admission #7842

Open
opened 2026-11-03 07:25:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7819
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/h126-peaceful-summon


📝 Commits (1)

  • 04627b1 Use the entity-type Peaceful policy for summon admission

📊 Changes

3 files changed (+167 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+6 -13)
📝 tools/port_map/rest-016.tsv (+1 -0)
➕ tools/test_peaceful_summon_parity.py (+160 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

Peaceful /summon currently rejects camel husks and zombie horses because their category is monster, although their entity types are allowed in Peaceful. Share the existing entity-type policy check between the plain and NBT forms instead of testing category twice. Fixes #7803.

Add a fresh dedicated-server matrix: camel husk, camel, husk and zombie horse; plain/NBT forms; Peaceful/Normal difficulty. The unchanged fixture gives 48/64 observations on old source and 64/64 with the fix, with identical fresh Java 26.3 records. All 16 old differences originate at the incorrect Peaceful rejection of camel husks and zombie horses.

The fixture validates summon feedback before interpreting selectors or Health, waits for loaded coordinates, clears prior entities with 25 actual ticks between cases, and observes accepted entities after two more ticks. The Peaceful husk rejection and all Normal forms remain controls. This proves command admission; fields, despawning and natural spawning are outside the change.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Java 26.3 SummonCommand.createEntity checks spawnable bounds, then rejects Peaceful summons only when EntityType.isAllowedInPeaceful is false. That getter reads the separate allowedInPeaceful flag. Inspected the pinned official bytecode.

Reuse mobs::finalize::allowed_in_peaceful and record the shared admission path in the port map. Regression: python3 tools/test_peaceful_summon_parity.py.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on local validation, against origin/main at 3fc4c4ca0, 11 min 28 s)

Check Result
Scope ✅ 3 files, +167 −13
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (2 min 13 s)
rustfmt ✅ (29 s)
clippy ✅ (4 min 55 s)
tests: horizon-client ✅ 711 passed (3 min 13 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
mod API up to date ✅ (34 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Port-map validation passed. The ledger comparison reports call-reach reminders for the existing rotation and bounds paths; those paths are untouched by this admission change.

The focused old/fixed runtime above was run separately. Full affected parity was not run locally (--quick).

🤖 Generated with Codex


🔄 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/7819 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/h126-peaceful-summon` --- ### 📝 Commits (1) - [`04627b1`](https://github.com/horizon-rust/horizon/commit/04627b17a7d01d873fd3ab33e5051b1adc6e8160) Use the entity-type Peaceful policy for summon admission ### 📊 Changes **3 files changed** (+167 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+6 -13) 📝 `tools/port_map/rest-016.tsv` (+1 -0) ➕ `tools/test_peaceful_summon_parity.py` (+160 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Peaceful `/summon` currently rejects camel husks and zombie horses because their category is `monster`, although their entity types are allowed in Peaceful. Share the existing entity-type policy check between the plain and NBT forms instead of testing category twice. Fixes #7803. Add a fresh dedicated-server matrix: camel husk, camel, husk and zombie horse; plain/NBT forms; Peaceful/Normal difficulty. The unchanged fixture gives **48/64 observations on old source and 64/64 with the fix**, with identical fresh Java 26.3 records. All 16 old differences originate at the incorrect Peaceful rejection of camel husks and zombie horses. The fixture validates summon feedback before interpreting selectors or Health, waits for loaded coordinates, clears prior entities with 25 actual ticks between cases, and observes accepted entities after two more ticks. The Peaceful husk rejection and all Normal forms remain controls. This proves command admission; fields, despawning and natural spawning are outside the change. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Java 26.3 `SummonCommand.createEntity` checks spawnable bounds, then rejects Peaceful summons only when `EntityType.isAllowedInPeaceful` is false. That getter reads the separate `allowedInPeaceful` flag. Inspected the pinned official bytecode. Reuse `mobs::finalize::allowed_in_peaceful` and record the shared admission path in the port map. Regression: `python3 tools/test_peaceful_summon_parity.py`. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on local validation, against origin/main at 3fc4c4ca0, 11 min 28 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +167 −13 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (2 min 13 s) | | rustfmt | ✅ (29 s) | | clippy | ✅ (4 min 55 s) | | tests: horizon-client | ✅ 711 passed (3 min 13 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (34 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Port-map validation passed. The ledger comparison reports call-reach reminders for the existing rotation and bounds paths; those paths are untouched by this admission change. The focused old/fixed runtime above was run separately. Full affected parity was not run locally (`--quick`). 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7842
No description provided.