[PR #2115] [MERGED] Lingering potions leave an effect cloud #4018

Closed
opened 2026-11-03 04:14:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2115
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/1361-lingering-cloud


📝 Commits (3)

  • f5f7448 Lingering potions leave an effect cloud
  • da736d5 Lingering clouds skip mobs none of their effects can affect
  • 24744aa Merge main into fix/1361-lingering-cloud

📊 Changes

4 files changed (+373 additions, -102 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+29 -9)
📝 crates/horizon-client/src/game/lan_entities.rs (+7 -3)
📝 crates/horizon-client/src/game/potions.rs (+283 -46)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+54 -44)

📄 Description

What and why

Stacked on #2109. This PR includes its commits until that merges, so the diff will shrink then.

Bug: a lingering potion only acted as one weaker splash at impact. No cloud stayed, so staying in the impact spot (or coming back to it) never applied the effect again.

What was built:

  • A lingering potion that hits a block or a mob now spawns an area effect cloud (at the mob's feet if it hit a mob). A potion with no effects, like a water bottle, leaves no cloud.
  • The cloud is the dragon's breath cloud type (Breath) with an optional potion part, so it shares the existing storage, per-dimension swap, entity ids and tracking. tick_breath skips these clouds; they tick with the thrown potions (tick_potion_clouds in game/potions.rs).
  • It waits 10 ticks, then shrinks every tick, and is removed after 600 ticks or when it is smaller than 0.5.
  • Every 5 ticks it affects living entities in its box and radius that it has not affected in the last 20 ticks. Mobs and players (host and server players, through as_fight_player) both count. Each one it affects takes 0.5 off its radius.
  • Timed effects last a quarter of the potion's duration (at least 1 tick). Instant effects work at half strength, and undead mobs invert healing and harming.
  • The cloud's particles (an entity effect in the potion's colour, the white one while waiting) are drawn in the game that owns the world. The loop that did this for clouds sent by a server is now one function (cloud_client_tick) used by both.
  • Server players are sent it as minecraft:area_effect_cloud with radius, waiting flag and the coloured particle, like the breath clouds.

Left out: a thrown potion still does not hit players, and the cloud has no owner. Mob immunities (canBeAffected) and tipped-arrow clouds are not done.

Fixes #1361.

Vanilla reference

  • ThrownLingeringPotion.onHitAsPotion: radius 3, radius on use -0.5, duration 600, wait time 10, radius per tick -radius/duration, the item's potion contents and 0.25 duration scale; at the hit entity's position if it hit an entity.
  • AreaEffectCloud.serverTick: discard when tickCount - waitTime >= duration, waiting before the wait time, radius per tick and the 0.5 minimum, the 5 tick check, victims with the reapplication delay, the box and distance test, applyInstantaneousEffect with 0.5, radius on use.
  • AreaEffectCloud.clientTick, updateParticle and the synced data (radius, waiting, particle).
  • PotionContents.forEachEffect / MobEffectInstance.withScaledDuration, HealOrHarmMobEffect.applyInstantaneousEffect.

Self-check

cargo check -p horizon-client passes.


🔄 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/2115 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1361-lingering-cloud` --- ### 📝 Commits (3) - [`f5f7448`](https://github.com/horizon-rust/horizon/commit/f5f7448909e1dfe7db76ff0c9a565bc59f786967) Lingering potions leave an effect cloud - [`da736d5`](https://github.com/horizon-rust/horizon/commit/da736d56d64aade0b9b95978358515a8c9b40b36) Lingering clouds skip mobs none of their effects can affect - [`24744aa`](https://github.com/horizon-rust/horizon/commit/24744aae44c65f71b7212fc66d8bc1beda6c3d7b) Merge main into fix/1361-lingering-cloud ### 📊 Changes **4 files changed** (+373 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+29 -9) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+7 -3) 📝 `crates/horizon-client/src/game/potions.rs` (+283 -46) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+54 -44) </details> ### 📄 Description ## What and why Stacked on #2109. This PR includes its commits until that merges, so the diff will shrink then. Bug: a lingering potion only acted as one weaker splash at impact. No cloud stayed, so staying in the impact spot (or coming back to it) never applied the effect again. What was built: - A lingering potion that hits a block or a mob now spawns an area effect cloud (at the mob's feet if it hit a mob). A potion with no effects, like a water bottle, leaves no cloud. - The cloud is the dragon's breath cloud type (`Breath`) with an optional potion part, so it shares the existing storage, per-dimension swap, entity ids and tracking. `tick_breath` skips these clouds; they tick with the thrown potions (`tick_potion_clouds` in `game/potions.rs`). - It waits 10 ticks, then shrinks every tick, and is removed after 600 ticks or when it is smaller than 0.5. - Every 5 ticks it affects living entities in its box and radius that it has not affected in the last 20 ticks. Mobs and players (host and server players, through `as_fight_player`) both count. Each one it affects takes 0.5 off its radius. - Timed effects last a quarter of the potion's duration (at least 1 tick). Instant effects work at half strength, and undead mobs invert healing and harming. - The cloud's particles (an entity effect in the potion's colour, the white one while waiting) are drawn in the game that owns the world. The loop that did this for clouds sent by a server is now one function (`cloud_client_tick`) used by both. - Server players are sent it as `minecraft:area_effect_cloud` with radius, waiting flag and the coloured particle, like the breath clouds. Left out: a thrown potion still does not hit players, and the cloud has no owner. Mob immunities (`canBeAffected`) and tipped-arrow clouds are not done. Fixes #1361. ## Vanilla reference - `ThrownLingeringPotion.onHitAsPotion`: radius 3, radius on use -0.5, duration 600, wait time 10, radius per tick -radius/duration, the item's potion contents and 0.25 duration scale; at the hit entity's position if it hit an entity. - `AreaEffectCloud.serverTick`: discard when `tickCount - waitTime >= duration`, waiting before the wait time, radius per tick and the 0.5 minimum, the 5 tick check, `victims` with the reapplication delay, the box and distance test, `applyInstantaneousEffect` with 0.5, radius on use. - `AreaEffectCloud.clientTick`, `updateParticle` and the synced data (radius, waiting, particle). - `PotionContents.forEachEffect` / `MobEffectInstance.withScaledDuration`, `HealOrHarmMobEffect.applyInstantaneousEffect`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:03 +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#4018
No description provided.