[PR #6797] [MERGED] Summoned splash and lingering potions are projectiles, not inert entities #7101

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

📋 Pull Request Information

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

Base: main ← Head: fix/splash-potion-summon


📝 Commits (4)

  • ab0afa3 Summoned splash and lingering potions are projectiles, not inert entities
  • 99a257f Follow the widened air drag in the two projectile tests
  • 99cf959 Merge main into #6797
  • 6638d28 Projectile potions call native_potion_splash too

📊 Changes

8 files changed (+340 additions, -159 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+100 -21)
📝 crates/horizon-client/src/game/creatures.rs (+30 -77)
📝 crates/horizon-client/src/game/lan_entities.rs (+11 -0)
📝 crates/horizon-client/src/game/potions.rs (+68 -16)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+5 -3)
📝 crates/horizon-client/src/mobs/witch.rs (+12 -13)
📝 crates/horizon-client/src/projectiles.rs (+41 -29)
📝 tools/command_exec_corpus.py (+73 -0)

📄 Description

Vanilla's /summon minecraft:splash_potion creates a ThrownSplashPotion: a ThrowableItemProjectile that falls with gravity 0.05, carries Motion in its compound, flies as its Item (the default splash potion when the summon names none) and splashes where it lands with that item's potion_contents, while a lingering potion leaves its cloud there.

Horizon loaded both potion types as an inert "other" entity kept only as its compound - nothing ticked it, its data had no Motion, no blast could push it and nothing splashed - because ProjectileKind::Potion carried one baked effect (the witch's) rather than the stack; the kind now holds the item it flies as, a landed potion goes through the same splash() a thrown one does, the witch builds the stack vanilla's Witch.performRangedAttack makes, and ThrowableProjectile's air drag is vanilla's 0.99F float widened to double instead of 0.99, which is what kept a thrown item's position from matching the server's.

Proven:

  • python3 tools/test_command_exec_parity.py --binary target/fast/horizon-client (full corpus, against a real 26.3 server): total: 1503/1503 commands match, including the new summoned potions group (15/15) - the summoned potion's Item, Pos and Motion right after the summon and after ticks (bit-identical to vanilla), Pos following gravity 0.05, a harming splash potion taking a pig from 10.0 to dead, a lingering poison potion leaving a cloud that puts minecraft:poison on the pig standing in it, and a bare lingering potion leaving its pig clean.
  • cargo test -q -p horizon-client-lib --lib entity_nbt: 31 passed (adds a_summoned_potion_flies_as_the_item_its_compound_names, the bare-summon default item and a loaded potion_contents).
  • cargo test -q -p horizon-client --lib projectiles: 7 passed; cargo test -q -p horizon-client --lib potion: 4 passed.
  • cargo clippy -q -p horizon-client --lib -- -D warnings: clean.

Not proven: No window or GPU was run, so nothing here says how a summoned potion is drawn (its item model and colour) or that a guest's client draws it after the ITEM_STACK its entity is now sent with; in-game check: /summon minecraft:splash_potion ~ ~2 ~ and the same for a lingering_potion with potion_contents, watch both fall and splash, then push a summoned potion with a blast. The corpus group checks the lingering cloud's effect but not its duration: the cloud's age and the mob's effect tick interleave one tick differently from vanilla, which is a separate behaviour and is left alone here.


🔄 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/6797 **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/splash-potion-summon` --- ### 📝 Commits (4) - [`ab0afa3`](https://github.com/horizon-rust/horizon/commit/ab0afa3174208796867da7204cb808875a2c6a09) Summoned splash and lingering potions are projectiles, not inert entities - [`99a257f`](https://github.com/horizon-rust/horizon/commit/99a257fc7c056638af7446541fd3289fc0d962df) Follow the widened air drag in the two projectile tests - [`99cf959`](https://github.com/horizon-rust/horizon/commit/99cf9591ad6dd04fb8de54050d8a9cb695a2ddf8) Merge main into #6797 - [`6638d28`](https://github.com/horizon-rust/horizon/commit/6638d28c2d6f437cd4c26033cc98863966c267e5) Projectile potions call native_potion_splash too ### 📊 Changes **8 files changed** (+340 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+100 -21) 📝 `crates/horizon-client/src/game/creatures.rs` (+30 -77) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+11 -0) 📝 `crates/horizon-client/src/game/potions.rs` (+68 -16) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+5 -3) 📝 `crates/horizon-client/src/mobs/witch.rs` (+12 -13) 📝 `crates/horizon-client/src/projectiles.rs` (+41 -29) 📝 `tools/command_exec_corpus.py` (+73 -0) </details> ### 📄 Description Vanilla's `/summon minecraft:splash_potion` creates a `ThrownSplashPotion`: a `ThrowableItemProjectile` that falls with gravity 0.05, carries `Motion` in its compound, flies as its `Item` (the default splash potion when the summon names none) and splashes where it lands with that item's `potion_contents`, while a lingering potion leaves its cloud there. Horizon loaded both potion types as an inert "other" entity kept only as its compound - nothing ticked it, its data had no `Motion`, no blast could push it and nothing splashed - because `ProjectileKind::Potion` carried one baked effect (the witch's) rather than the stack; the kind now holds the item it flies as, a landed potion goes through the same `splash()` a thrown one does, the witch builds the stack vanilla's `Witch.performRangedAttack` makes, and `ThrowableProjectile`'s air drag is vanilla's `0.99F` float widened to double instead of `0.99`, which is what kept a thrown item's position from matching the server's. **Proven:** - `python3 tools/test_command_exec_parity.py --binary target/fast/horizon-client` (full corpus, against a real 26.3 server): `total: 1503/1503 commands match`, including the new `summoned potions` group (15/15) - the summoned potion's `Item`, `Pos` and `Motion` right after the summon and after ticks (bit-identical to vanilla), `Pos` following gravity 0.05, a harming splash potion taking a pig from 10.0 to dead, a lingering poison potion leaving a cloud that puts `minecraft:poison` on the pig standing in it, and a bare lingering potion leaving its pig clean. - `cargo test -q -p horizon-client-lib --lib entity_nbt`: 31 passed (adds `a_summoned_potion_flies_as_the_item_its_compound_names`, the bare-summon default item and a loaded `potion_contents`). - `cargo test -q -p horizon-client --lib projectiles`: 7 passed; `cargo test -q -p horizon-client --lib potion`: 4 passed. - `cargo clippy -q -p horizon-client --lib -- -D warnings`: clean. **Not proven:** No window or GPU was run, so nothing here says how a summoned potion is drawn (its item model and colour) or that a guest's client draws it after the `ITEM_STACK` its entity is now sent with; in-game check: `/summon minecraft:splash_potion ~ ~2 ~` and the same for a `lingering_potion` with `potion_contents`, watch both fall and splash, then push a summoned potion with a blast. The corpus group checks the lingering cloud's effect but not its duration: the cloud's age and the mob's effect tick interleave one tick differently from vanilla, which is a separate behaviour and is left alone here. --- <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:48 +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#7101
No description provided.