[PR #6789] [MERGED] A fox's or frog's variant component on a spawn egg picks its variant #7099

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6789
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/fox-frog-variant-component


📝 Commits (1)

  • 0fa27d4 A fox's or frog's variant component on a spawn egg picks its variant

📊 Changes

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

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+47 -0)
📝 crates/horizon-client/src/mobs/finalize.rs (+3 -0)
📝 tools/port_map/game-012.tsv (+2 -2)

📄 Description

Vanilla's Fox.applyImplicitComponent and Frog.applyImplicitComponent call setVariant from minecraft:fox/variant and minecraft:frog/variant, so an item that carries one (a spawn egg with that component) hatches that variant.

Horizon's entity_nbt::apply_item_components read the variant components of chickens, cows, pigs, zombie nautiluses, mooshrooms, sheep, axolotls, salmon and tropical fish but not foxes or frogs, and finalize::variant_index had no fox entry, so a minecraft:snow fox fell through the frog name list; the component was dropped and the mob kept the variant its spawn picked.

Proven: on the build VM, cargo test -q -p horizon-client-lib --lib entity_nbt::item_component_tests passes 3 tests, including the new a_fox_or_frog_spawn_egg_picks_its_variant_component; with the two code hunks removed the same test fails on Fox.Variant.SNOW, not red: left: 0, right: 1. cargo clippy -q -p horizon-client-lib --lib prints nothing and rustfmt --edition 2024 --check passes on both files. The vanilla side is javap -p -c net.minecraft.world.entity.animal.fox.Fox: applyImplicitComponent compares DataComponents.FOX_VARIANT and calls setVariant; Frog the same with FROG_VARIANT.

Not proven: I did not run the game. The in-game check is a minecraft:fox_spawn_egg carrying minecraft:fox/variant=minecraft:snow hatching a snow fox, and a minecraft:frog_spawn_egg with minecraft:frog/variant=minecraft:warm in a swamp hatching a warm frog.

Corrects the Fox.applyImplicitComponent and Frog.applyImplicitComponent rows of tools/port_map/game-012.tsv.


🔄 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/6789 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/fox-frog-variant-component` --- ### 📝 Commits (1) - [`0fa27d4`](https://github.com/horizon-rust/horizon/commit/0fa27d49b7faaaa3c2a0141e425409418fbce1fb) A fox's or frog's variant component on a spawn egg picks its variant ### 📊 Changes **3 files changed** (+52 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+47 -0) 📝 `crates/horizon-client/src/mobs/finalize.rs` (+3 -0) 📝 `tools/port_map/game-012.tsv` (+2 -2) </details> ### 📄 Description Vanilla's `Fox.applyImplicitComponent` and `Frog.applyImplicitComponent` call `setVariant` from `minecraft:fox/variant` and `minecraft:frog/variant`, so an item that carries one (a spawn egg with that component) hatches that variant. Horizon's `entity_nbt::apply_item_components` read the variant components of chickens, cows, pigs, zombie nautiluses, mooshrooms, sheep, axolotls, salmon and tropical fish but not foxes or frogs, and `finalize::variant_index` had no fox entry, so a `minecraft:snow` fox fell through the frog name list; the component was dropped and the mob kept the variant its spawn picked. **Proven:** on the build VM, `cargo test -q -p horizon-client-lib --lib entity_nbt::item_component_tests` passes 3 tests, including the new `a_fox_or_frog_spawn_egg_picks_its_variant_component`; with the two code hunks removed the same test fails on `Fox.Variant.SNOW, not red: left: 0, right: 1`. `cargo clippy -q -p horizon-client-lib --lib` prints nothing and `rustfmt --edition 2024 --check` passes on both files. The vanilla side is `javap -p -c net.minecraft.world.entity.animal.fox.Fox`: `applyImplicitComponent` compares `DataComponents.FOX_VARIANT` and calls `setVariant`; `Frog` the same with `FROG_VARIANT`. **Not proven:** I did not run the game. The in-game check is a `minecraft:fox_spawn_egg` carrying `minecraft:fox/variant=minecraft:snow` hatching a snow fox, and a `minecraft:frog_spawn_egg` with `minecraft:frog/variant=minecraft:warm` in a swamp hatching a warm frog. Corrects the `Fox.applyImplicitComponent` and `Frog.applyImplicitComponent` rows of `tools/port_map/game-012.tsv`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33:45 +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#7099
No description provided.