[PR #2151] [MERGED] Make Channeling summon lightning when a trident hits #4050

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

📋 Pull Request Information

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

Base: main ← Head: fix/trident-channeling


📝 Commits (1)

  • 48c289f Make Channeling summon lightning when a trident hits

📊 Changes

1 file changed (+82 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/trident.rs (+82 -3)

📄 Description

What and why

Channeling did nothing: a trident with it never summoned lightning. Now a thrown trident with Channeling summons a lightning bolt during a thunderstorm in the two cases the enchantment data describes:

  • It hurts a mob and the mob can see the sky.
  • It hits a lightning rod that can see the sky.

Each time the thunder sound plays at volume 5 and the bolt behaves like any other bolt (fire, damage, powering the rod).

Both cases are in game/trident.rs. The enchantment effect code only reads ignite and explode post-attack effects and cannot check weather or location conditions, so the two effects (summon_entity, play_sound) are applied directly there, following channeling.json.

Vanilla reference

  • data/minecraft/enchantment/channeling.json: minecraft:post_attack (victim, weather_check thundering, this can see the sky, direct attacker is a trident) and minecraft:hit_block (thundering, trident, lightning rod that can see the sky). Both run summon_entity for lightning_bolt, then play_sound item.trident.thunder at volume 5.
  • ThrownTrident.onHitEntity: the post-attack effects run only when hurtOrSimulate succeeded.
  • AbstractArrow.hitBlockEnchantmentEffects: the hit location is clamped into the block (BlockPos.clampLocationWithin).
  • SummonEntityEffect.apply: the bolt appears at the victim's position or the hit location.
  • Level.isThundering and BlockAndLightGetter.canSeeSky.

Not covered: the bolt's cause (only used for advancements), and the existing trident block collision still uses the trident's box rather than a point ray, so a trident that grazes the side of a rod may stick without the rod being the block its flight line hits.

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/2151 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/trident-channeling` --- ### 📝 Commits (1) - [`48c289f`](https://github.com/horizon-rust/horizon/commit/48c289f775c5d544714963f556e9ed521bb814bf) Make Channeling summon lightning when a trident hits ### 📊 Changes **1 file changed** (+82 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/trident.rs` (+82 -3) </details> ### 📄 Description ## What and why Channeling did nothing: a trident with it never summoned lightning. Now a thrown trident with Channeling summons a lightning bolt during a thunderstorm in the two cases the enchantment data describes: - It hurts a mob and the mob can see the sky. - It hits a lightning rod that can see the sky. Each time the thunder sound plays at volume 5 and the bolt behaves like any other bolt (fire, damage, powering the rod). Both cases are in `game/trident.rs`. The enchantment effect code only reads `ignite` and `explode` post-attack effects and cannot check weather or location conditions, so the two effects (`summon_entity`, `play_sound`) are applied directly there, following `channeling.json`. ## Vanilla reference - `data/minecraft/enchantment/channeling.json`: `minecraft:post_attack` (victim, `weather_check` thundering, `this` can see the sky, direct attacker is a trident) and `minecraft:hit_block` (thundering, trident, lightning rod that can see the sky). Both run `summon_entity` for `lightning_bolt`, then `play_sound` `item.trident.thunder` at volume 5. - `ThrownTrident.onHitEntity`: the post-attack effects run only when `hurtOrSimulate` succeeded. - `AbstractArrow.hitBlockEnchantmentEffects`: the hit location is clamped into the block (`BlockPos.clampLocationWithin`). - `SummonEntityEffect.apply`: the bolt appears at the victim's position or the hit location. - `Level.isThundering` and `BlockAndLightGetter.canSeeSky`. Not covered: the bolt's `cause` (only used for advancements), and the existing trident block collision still uses the trident's box rather than a point ray, so a trident that grazes the side of a rod may stick without the rod being the block its flight line hits. ## 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:19 +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#4050
No description provided.