[PR #5418] [MERGED] A spawner minecart exists and ticks its spawner #6276

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5418
Author: @xFedeT
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/spawner-minecart


📝 Commits (4)

  • cb12c27 MinecartSpawner: a spawner minecart ticks its BaseSpawner where it stands
  • e05059a Merge main into #5418
  • 6ebfcd0 Spawner minecart: /summon loads its spawner; review fixups
  • 7fcd32f Merge main into #5418

📊 Changes

6 files changed (+153 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+9 -1)
📝 crates/horizon-client/src/game/entity_model_loading_tests.rs (+4 -3)
📝 crates/horizon-client/src/game/minecarts.rs (+114 -2)
📝 crates/horizon-client/src/game/pick_entity.rs (+1 -1)
📝 crates/horizon-client/src/game/spawner.rs (+20 -2)
📝 tools/port_map/classes-01.tsv (+5 -1)

📄 Description

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

Part of #3514: the MinecartSpawner row. The row says "a spawner minecart item does nothing on a rail", but vanilla 26.3 has no such item (Items.java has no spawner minecart; only EntityTypes.SPAWNER_MINECART, OP_ONLY_CUSTOM_DATA): the entity only comes from /summon or a saved world. What was missing is the entity.

Vanilla (MinecartSpawner.java)

  • It extends AbstractMinecart and owns a BaseSpawner whose broadcastEvent is level.broadcastEntityEvent(cart, id).
  • tick() is super.tick() and then spawner.serverTick(level, blockPosition()) (the client runs clientTick, which has nothing to show: a client's spawner has no spawn data, so there is no display mob or particles).
  • getDefaultDisplayBlockState() is a spawner block; getDropItem() and getPickResult() are a plain minecart.
  • addAdditionalSaveData / readAdditionalSaveData are BaseSpawner.save / load.

What changes

  • CartKind::Spawner (spawner_minecart): created by /summon, loaded from a world, saved with Delay, MinSpawnDelay, MaxSpawnDelay, SpawnCount, MaxNearbyEntities, RequiredPlayerRange, SpawnRange, SpawnData and SpawnPotentials (Minecart::spawner, the same Spawner a spawner block has).
  • Its tick runs the spawner block's serverTick at the cart's block (server_tick_spawner_of, shared with the block version): the same spawner_blocks_work rule, player range, spawn rules, collision and mob cap, the flame and smoke burst (level event 2004) and the spawn poof. Its broadcastEvent(1) is an entity event on the cart, not a block event; there is no block to sendBlockUpdated.
  • It draws a spawner block in the cart, has no interact (it passes to the held item, like a TNT minecart's), and drops and is picked as a plain minecart (CartKind::item).

Verification

  • a_spawner_cart_keeps_its_spawner_and_drops_a_minecart: the saved fields come back, the id maps, the drop and pick item is minecraft:minecart, the display offset is 6.
  • Parity spawner and trial_spawner pass (the block spawner code I shared).
  • A real run on the server thread (survival): /summon minecraft:spawner_minecart ~ ~ ~ {SpawnData:{entity:{id:"minecraft:pig",Silent:1b},custom_spawn_rules:{block_light_limit:[0,15],sky_light_limit:[0,15]}},Delay:20,MinSpawnDelay:40,MaxSpawnDelay:60,SpawnCount:2}: the cart shows its spawner block and spawns pigs around itself with the burst, five after a few seconds. (A pig with only an id on stone spawns nothing, as in vanilla: the spawn rules apply, the same for a spawner block.)

a spawner minecart spawning pigs

  • pr_ready --quick: rustfmt, clippy, Python tests pass. The only failures are the 8 lan_bot tests, which fail the same way on a clean origin/main here.

🤖 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/5418 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/spawner-minecart` --- ### 📝 Commits (4) - [`cb12c27`](https://github.com/horizon-rust/horizon/commit/cb12c27a6eef2217b8b945b814565ec5de540dea) MinecartSpawner: a spawner minecart ticks its BaseSpawner where it stands - [`e05059a`](https://github.com/horizon-rust/horizon/commit/e05059a56211478a522465546b320556e09c0119) Merge main into #5418 - [`6ebfcd0`](https://github.com/horizon-rust/horizon/commit/6ebfcd0ded01c7455ff9e6aac657ac6acb83aa26) Spawner minecart: /summon loads its spawner; review fixups - [`7fcd32f`](https://github.com/horizon-rust/horizon/commit/7fcd32faa1dd4a29c3a8f6eb97f4a1133fa03c5a) Merge main into #5418 ### 📊 Changes **6 files changed** (+153 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+9 -1) 📝 `crates/horizon-client/src/game/entity_model_loading_tests.rs` (+4 -3) 📝 `crates/horizon-client/src/game/minecarts.rs` (+114 -2) 📝 `crates/horizon-client/src/game/pick_entity.rs` (+1 -1) 📝 `crates/horizon-client/src/game/spawner.rs` (+20 -2) 📝 `tools/port_map/classes-01.tsv` (+5 -1) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Part of #3514: the `MinecartSpawner` row. The row says "a spawner minecart item does nothing on a rail", but vanilla 26.3 has **no such item** (`Items.java` has no spawner minecart; only `EntityTypes.SPAWNER_MINECART`, `OP_ONLY_CUSTOM_DATA`): the entity only comes from `/summon` or a saved world. What was missing is the entity. ## Vanilla (`MinecartSpawner.java`) - It extends `AbstractMinecart` and owns a `BaseSpawner` whose `broadcastEvent` is `level.broadcastEntityEvent(cart, id)`. - `tick()` is `super.tick()` and then `spawner.serverTick(level, blockPosition())` (the client runs `clientTick`, which has nothing to show: a client's spawner has no spawn data, so there is no display mob or particles). - `getDefaultDisplayBlockState()` is a spawner block; `getDropItem()` and `getPickResult()` are a plain minecart. - `addAdditionalSaveData` / `readAdditionalSaveData` are `BaseSpawner.save` / `load`. ## What changes - `CartKind::Spawner` (`spawner_minecart`): created by `/summon`, loaded from a world, saved with `Delay`, `MinSpawnDelay`, `MaxSpawnDelay`, `SpawnCount`, `MaxNearbyEntities`, `RequiredPlayerRange`, `SpawnRange`, `SpawnData` and `SpawnPotentials` (`Minecart::spawner`, the same `Spawner` a spawner block has). - Its tick runs the spawner block's `serverTick` at the cart's block (`server_tick_spawner_of`, shared with the block version): the same `spawner_blocks_work` rule, player range, spawn rules, collision and mob cap, the flame and smoke burst (level event 2004) and the spawn poof. Its `broadcastEvent(1)` is an entity event on the cart, not a block event; there is no block to `sendBlockUpdated`. - It draws a spawner block in the cart, has no `interact` (it passes to the held item, like a TNT minecart's), and drops and is picked as a plain minecart (`CartKind::item`). ## Verification - `a_spawner_cart_keeps_its_spawner_and_drops_a_minecart`: the saved fields come back, the id maps, the drop and pick item is `minecraft:minecart`, the display offset is 6. - Parity `spawner` and `trial_spawner` pass (the block spawner code I shared). - A real run on the server thread (survival): `/summon minecraft:spawner_minecart ~ ~ ~ {SpawnData:{entity:{id:"minecraft:pig",Silent:1b},custom_spawn_rules:{block_light_limit:[0,15],sky_light_limit:[0,15]}},Delay:20,MinSpawnDelay:40,MaxSpawnDelay:60,SpawnCount:2}`: the cart shows its spawner block and spawns pigs around itself with the burst, five after a few seconds. (A pig with only an id on stone spawns nothing, as in vanilla: the spawn rules apply, the same for a spawner block.) ![a spawner minecart spawning pigs](https://raw.githubusercontent.com/xFedeT/horizon/pr-screenshots/3514/spawner-minecart.png) - `pr_ready --quick`: rustfmt, clippy, Python tests pass. The only failures are the 8 `lan_bot` tests, which fail the same way on a clean `origin/main` here. 🤖 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 06:17:23 +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#6276
No description provided.