[PR #5297] [MERGED] fix(mobs): a dispensed spawn egg applies its entity_data too #6192

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5297
Author: @sirrayi
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/dispenser-egg-entity-data


📝 Commits (1)

  • 9ef1541 fix(mobs): a dispensed spawn egg applies its entity_data too

📊 Changes

3 files changed (+6 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+1 -1)
📝 crates/horizon-client/src/game/dispenser.rs (+4 -0)
📝 tools/port_map/game-005.tsv (+1 -1)

📄 Description

🤖 Opened by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by sirrayi personally.

What and why

A spawn egg a dispenser fires ignores the entity it is configured for. EntityType.updateCustomEntityTag is ported for a player's egg — block_entity_item::spawn_egg_entity_data then creatures.rs::Game::apply_spawn_egg_entity_data, which merges the compound over the mob's own NBT — but dispense_spawn_egg stops after entity_nbt::apply_item_components, so /give @s pig_spawn_egg[minecraft:entity_data={NoAI:1b}] fired from a dispenser spawned a plain mob. That is the half of the EntityType.updateCustomEntityTag row of #3514 that names game/dispenser.rs.

This makes the helper pub(super) and calls it in the dispenser after the components, exactly where the player's path calls it.

Vanilla reference

EntityType.updateCustomEntityTag (TypedEntityData.loadInto: the mob's own compound, the data merged over it, loaded back), the same call SpawnEggItem.use makes, reached from the dispenser's spawn-egg behaviour.

The guards are the ones spawn_egg_entity_data already has (the data must name the spawned type, and an op-only type's data needs the acting permission), so a dispenser run needs no new rule.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Other projects' code

none

Self-check

cargo fmt --all --check                                  clean
cargo check -p horizon-client --lib
  Finished (no errors)
python3 tools/check_public_tree.py
  Public tree check passed.

No unit test: the path needs a ticking dispenser, and the loader it calls is the one /data merge entity and the player's egg already exercise. tools/pr_ready.py still cannot run here (Python 3.11+ needed, 3.9 installed); the harnesses this can reach are the dispenser and entity NBT ones.

tools/port_map/game-005.tsv: the EntityType.updateCustomEntityTag row is port now — main implements it but the row still said missing.

This replaces #5271, which I closed: it implemented the same row its own way before main grew the better one. Only the dispenser half was still missing.

🤖 Generated with DeepSeek Harness (deepseek-v4.1-flash)


🔄 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/5297 **Author:** [@sirrayi](https://github.com/sirrayi) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dispenser-egg-entity-data` --- ### 📝 Commits (1) - [`9ef1541`](https://github.com/horizon-rust/horizon/commit/9ef1541c02395256c8013c1ac932c19c80014233) fix(mobs): a dispensed spawn egg applies its entity_data too ### 📊 Changes **3 files changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dispenser.rs` (+4 -0) 📝 `tools/port_map/game-005.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by sirrayi's AI agent (DeepSeek Harness, deepseek-v4.1-flash), not by sirrayi personally. ## What and why A spawn egg a dispenser fires ignores the entity it is configured for. `EntityType.updateCustomEntityTag` is ported for a player's egg — `block_entity_item::spawn_egg_entity_data` then `creatures.rs::Game::apply_spawn_egg_entity_data`, which merges the compound over the mob's own NBT — but `dispense_spawn_egg` stops after `entity_nbt::apply_item_components`, so `/give @s pig_spawn_egg[minecraft:entity_data={NoAI:1b}]` fired from a dispenser spawned a plain mob. That is the half of the `EntityType.updateCustomEntityTag` row of #3514 that names `game/dispenser.rs`. This makes the helper `pub(super)` and calls it in the dispenser after the components, exactly where the player's path calls it. ## Vanilla reference `EntityType.updateCustomEntityTag` (`TypedEntityData.loadInto`: the mob's own compound, the data merged over it, loaded back), the same call `SpawnEggItem.use` makes, reached from the dispenser's spawn-egg behaviour. The guards are the ones `spawn_egg_entity_data` already has (the data must name the spawned type, and an op-only type's data needs the acting permission), so a dispenser run needs no new rule. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Other projects' code none ## Self-check ``` cargo fmt --all --check clean cargo check -p horizon-client --lib Finished (no errors) python3 tools/check_public_tree.py Public tree check passed. ``` No unit test: the path needs a ticking dispenser, and the loader it calls is the one `/data merge entity` and the player's egg already exercise. `tools/pr_ready.py` still cannot run here (Python 3.11+ needed, 3.9 installed); the harnesses this can reach are the dispenser and entity NBT ones. `tools/port_map/game-005.tsv`: the `EntityType.updateCustomEntityTag` row is `port` now — `main` implements it but the row still said `missing`. ## Related This replaces #5271, which I closed: it implemented the same row its own way before `main` grew the better one. Only the dispenser half was still missing. 🤖 Generated with [DeepSeek Harness](https://www.deepseek.com) (deepseek-v4.1-flash) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:15:44 +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#6192
No description provided.