[PR #6310] [CLOSED] Native mods: a mob's equipment changes, LivingEquipmentChangeEvent #6789

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6310
Author: @MSedgeMC
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: feat/md-mob-equipment


📝 Commits (1)

  • c2470f5 Native mods: a mob's equipment changes, LivingEquipmentChangeEvent

📊 Changes

4 files changed (+162 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+8 -0)
➕ crates/horizon-client/src/game/native_equipment.rs (+122 -0)
📝 crates/horizon-client/src/game/native_hooks.rs (+20 -0)
➕ tools/native-hook-fragments/living_equipment_change.json (+12 -0)

📄 Description

A mob's equipment slot taking a different item must be heard by the mods, as
NeoForge's LivingEquipmentChangeEvent reports it.

native_on_equip covers only a player's slots. Mob kept its equipment with
no per-tick comparison, so a mod could not react to a mob putting on armour,
picking up an item or being dressed (an armour stand), and the connected
Living: breathing, and equipment changes of mobs item was half missing.

Proven: cargo test -q -p horizon-client --bin horizon-client native_equipment on the
build VM: 2 passed, 0 failed (559 filtered out), the two new tests among them.

Not proven: not fired in a running game: no unit test builds a client
game with a mob in it, so the per-tick comparison and the hook are proven by
the extracted comparisons and by compiling, not by watching a zombie equip.


🔄 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/6310 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/md-mob-equipment` --- ### 📝 Commits (1) - [`c2470f5`](https://github.com/horizon-rust/horizon/commit/c2470f5262fc82c5545fa55c681703b41d0d9caa) Native mods: a mob's equipment changes, LivingEquipmentChangeEvent ### 📊 Changes **4 files changed** (+162 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+8 -0) ➕ `crates/horizon-client/src/game/native_equipment.rs` (+122 -0) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+20 -0) ➕ `tools/native-hook-fragments/living_equipment_change.json` (+12 -0) </details> ### 📄 Description A mob's equipment slot taking a different item must be heard by the mods, as NeoForge's `LivingEquipmentChangeEvent` reports it. `native_on_equip` covers only a player's slots. `Mob` kept its equipment with no per-tick comparison, so a mod could not react to a mob putting on armour, picking up an item or being dressed (an armour stand), and the connected `Living: breathing, and equipment changes of mobs` item was half missing. **Proven:** `cargo test -q -p horizon-client --bin horizon-client native_equipment` on the build VM: 2 passed, 0 failed (559 filtered out), the two new tests among them. **Not proven:** not fired in a running game: no unit test builds a client game with a mob in it, so the per-tick comparison and the hook are proven by the extracted comparisons and by compiling, not by watching a zombie equip. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:40 +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#6789
No description provided.