[PR #4672] [MERGED] Advancement triggers: durability ranges, killing_blow on all KilledTrigger uses, player bystanders #5770

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4672
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/35-trig


📝 Commits (1)

  • ecd85c4 Advancement triggers: item durability ranges, killing_blow on every KilledTrigger, players as lightning bystanders

📊 Changes

7 files changed (+112 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -5)
📝 crates/horizon-client/src/game/advancements.rs (+28 -5)
📝 crates/horizon-client/src/game/combat.rs (+42 -0)
📝 crates/horizon-client/src/game/creatures.rs (+9 -2)
📝 crates/horizon-client/src/game/enchant_effects.rs (+1 -1)
📝 crates/horizon-client/src/game/lightning.rs (+23 -0)
📝 crates/horizon-client/src/game/mounts.rs (+1 -1)

📄 Description

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

Part of #3520

Rows:

  • ItemDurabilityTrigger.trigger / ItemDurabilityTrigger.TriggerInstance.matches: the trigger already fired; it now gets the new damage value and tests durability (maxDamage - newDamage) and delta (damageValue - newDamage) like vanilla, not only item.
  • KilledTrigger.trigger / KilledTrigger.TriggerInstance.matches: player_killed_entity already tested killing_blow; entity_killed_player (killing blow from the combat tracker's last entry) and kill_mob_near_sculk_catalyst (killed mob + its last damage) now go through the same KilledTrigger path instead of ignoring entity/killing_blow.
  • LightningStrikeTrigger.trigger: already ported; the bystanders now include the players inside the 30-block box that the bolt did not strike (vanilla's getEntities returns every entity, not only mobs).

Already on main / skipped (no change here): LightningStrikeTrigger.TriggerInstance.matches (trigger_lightning_strike), MinecraftServer.sendDifficultyUpdate (hub.rs join/respawn/dimension, commands.rs and lan_actions.rs on a change), LocalChatSession.createMessageEncoder (open secure-chat PRs #4375-#4377).

Vanilla followed: ItemStack.applyDamage, ItemDurabilityTrigger, KilledTrigger, CatalystListener, LightningBolt.tick.

Tests: no new unit test (the logic sits in Game closures); killing_blow_needs_the_fireball covers the predicate. fmt and clippy -p horizon-client --all-targets -D warnings clean.

Limits: item entities are not bolt bystanders; the dragon's kill still passes no killing blow.

🤖 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/4672 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/35-trig` --- ### 📝 Commits (1) - [`ecd85c4`](https://github.com/horizon-rust/horizon/commit/ecd85c497f6a09a29e7936892651d83d1ddf89a4) Advancement triggers: item durability ranges, killing_blow on every KilledTrigger, players as lightning bystanders ### 📊 Changes **7 files changed** (+112 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -5) 📝 `crates/horizon-client/src/game/advancements.rs` (+28 -5) 📝 `crates/horizon-client/src/game/combat.rs` (+42 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+9 -2) 📝 `crates/horizon-client/src/game/enchant_effects.rs` (+1 -1) 📝 `crates/horizon-client/src/game/lightning.rs` (+23 -0) 📝 `crates/horizon-client/src/game/mounts.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 Rows: - `ItemDurabilityTrigger.trigger` / `ItemDurabilityTrigger.TriggerInstance.matches`: the trigger already fired; it now gets the new damage value and tests `durability` (`maxDamage - newDamage`) and `delta` (`damageValue - newDamage`) like vanilla, not only `item`. - `KilledTrigger.trigger` / `KilledTrigger.TriggerInstance.matches`: `player_killed_entity` already tested `killing_blow`; `entity_killed_player` (killing blow from the combat tracker's last entry) and `kill_mob_near_sculk_catalyst` (killed mob + its last damage) now go through the same `KilledTrigger` path instead of ignoring `entity`/`killing_blow`. - `LightningStrikeTrigger.trigger`: already ported; the bystanders now include the players inside the 30-block box that the bolt did not strike (vanilla's `getEntities` returns every entity, not only mobs). Already on main / skipped (no change here): `LightningStrikeTrigger.TriggerInstance.matches` (`trigger_lightning_strike`), `MinecraftServer.sendDifficultyUpdate` (hub.rs join/respawn/dimension, commands.rs and lan_actions.rs on a change), `LocalChatSession.createMessageEncoder` (open secure-chat PRs #4375-#4377). Vanilla followed: `ItemStack.applyDamage`, `ItemDurabilityTrigger`, `KilledTrigger`, `CatalystListener`, `LightningBolt.tick`. Tests: no new unit test (the logic sits in `Game` closures); `killing_blow_needs_the_fireball` covers the predicate. fmt and `clippy -p horizon-client --all-targets -D warnings` clean. Limits: item entities are not bolt bystanders; the dragon's kill still passes no killing blow. 🤖 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:14:53 +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#5770
No description provided.