[PR #4357] [MERGED] Spawn egg tooltip: the red "Disabled in Peaceful" line for a monster's egg #5580

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4357
Author: @xFedeT
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/spawn-egg-peaceful-tooltip


📝 Commits (2)

  • 253b1f8 Spawn egg tooltip: the red "Disabled in Peaceful" line in Peaceful
  • b57d440 Spawn egg tooltip: any item with entity_data, and an id without its namespace

📊 Changes

3 files changed (+96 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/stations.rs (+14 -0)
📝 crates/horizon-client/src/item_tooltip.rs (+81 -0)
📝 tools/port_map/classes-02.tsv (+1 -1)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Refs #3515 (row TypedEntityData.addToTooltip). Part of #3601. No other open PR touches spawn egg tooltips.

What and why

In Peaceful, a spawn egg of a monster (a zombie, a creeper, a blaze...) cannot spawn anything (EntityType.canSpawn), and vanilla says so in its tooltip: a red "Disabled in Peaceful" under the egg. Horizon showed only the op-only warning, so the egg looked usable and the click did nothing.

Change

  • item_tooltip.rs spawn_egg_peaceful_line (TypedEntityData.addToTooltip): in Peaceful, an egg whose entity type is not allowed there gets the item.spawn_egg.peaceful line, in red, hidden with entity_data by the tooltip display component. The type is the one in the egg's entity_data component, else the egg's own (zombie_spawn_egg).
  • game/stations.rs stack_tooltip_lines: lists it where vanilla's ItemStack.addDetailsToTooltip does (after the block state, before the spawner lines), using the difficulty the client has (a server's ChangeDifficulty too) and spawn_rules::allowed_in_peaceful.
  • tools/port_map/classes-02.tsv: the row to port.

Vanilla reference

TypedEntityData.addToTooltip, Item.TooltipContext.isPeaceful, EntityType.isAllowedInPeaceful, ItemStack.addDetailsToTooltip.

Testing

  • New unit test a_spawn_egg_of_a_monster_says_so_in_peaceful (Peaceful or not, a monster's egg, an animal's, a non-egg, the entity data's type winning over the egg's).
  • pr_ready --quick (Python 3.12): Python tests (480), rustfmt, clippy and the Rust tests (977) pass.
  • No screenshot: horizon-ctl has no command that hovers a slot without clicking it (click-slot restores the cursor), so I could not take the tooltip in a game. Worth a look by someone: /difficulty peaceful, /give @s zombie_spawn_egg, hover it in the inventory.

🤖 Generated with Claude Code


🔄 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/4357 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/spawn-egg-peaceful-tooltip` --- ### 📝 Commits (2) - [`253b1f8`](https://github.com/horizon-rust/horizon/commit/253b1f878005b66c2414c21b5f6181df29330eee) Spawn egg tooltip: the red "Disabled in Peaceful" line in Peaceful - [`b57d440`](https://github.com/horizon-rust/horizon/commit/b57d440412ff7d54b2f92042bf9ba4d7ec929d24) Spawn egg tooltip: any item with entity_data, and an id without its namespace ### 📊 Changes **3 files changed** (+96 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/stations.rs` (+14 -0) 📝 `crates/horizon-client/src/item_tooltip.rs` (+81 -0) 📝 `tools/port_map/classes-02.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Refs #3515 (row `TypedEntityData.addToTooltip`). Part of #3601. No other open PR touches spawn egg tooltips. ## What and why In Peaceful, a spawn egg of a monster (a zombie, a creeper, a blaze...) cannot spawn anything (`EntityType.canSpawn`), and vanilla says so in its tooltip: a red "Disabled in Peaceful" under the egg. Horizon showed only the op-only warning, so the egg looked usable and the click did nothing. ## Change - `item_tooltip.rs` `spawn_egg_peaceful_line` (`TypedEntityData.addToTooltip`): in Peaceful, an egg whose entity type is not allowed there gets the `item.spawn_egg.peaceful` line, in red, hidden with `entity_data` by the tooltip display component. The type is the one in the egg's `entity_data` component, else the egg's own (`zombie_spawn_egg`). - `game/stations.rs` `stack_tooltip_lines`: lists it where vanilla's `ItemStack.addDetailsToTooltip` does (after the block state, before the spawner lines), using the difficulty the client has (a server's `ChangeDifficulty` too) and `spawn_rules::allowed_in_peaceful`. - `tools/port_map/classes-02.tsv`: the row to `port`. ## Vanilla reference `TypedEntityData.addToTooltip`, `Item.TooltipContext.isPeaceful`, `EntityType.isAllowedInPeaceful`, `ItemStack.addDetailsToTooltip`. ## Testing - New unit test `a_spawn_egg_of_a_monster_says_so_in_peaceful` (Peaceful or not, a monster's egg, an animal's, a non-egg, the entity data's type winning over the egg's). - `pr_ready --quick` (Python 3.12): Python tests (480), rustfmt, clippy and the Rust tests (977) pass. - No screenshot: `horizon-ctl` has no command that hovers a slot without clicking it (`click-slot` restores the cursor), so I could not take the tooltip in a game. Worth a look by someone: `/difficulty peaceful`, `/give @s zombie_spawn_egg`, hover it in the inventory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:13:33 +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#5580
No description provided.