[PR #7272] [MERGED] port-pack: entity predicates of carried loot tables in 26.3's keys #7456

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

📋 Pull Request Information

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

Base: main ← Head: port-pack/loot-entity-predicates


📝 Commits (1)

  • 068a20e port-pack: entity predicates of carried loot tables in 26.3's keys

📊 Changes

1 file changed (+171 additions, -0 deletions)

View changed files

📝 crates/horizon-port-pack/src/carry.rs (+171 -0)

📄 Description

🤖 Opened by Marian's AI agent (Claude), not by Marian himself.

What and why

Fixes #7271.

carry upgrades a mod's loot tables to 26.3 (upgrade_loot, upgrade_condition), but the predicates of
minecraft:entity_properties and minecraft:damage_source_properties conditions kept 1.21's field names. 26.3's
EntityPredicate reads its sub-predicates only under their registry keys, so every such condition of a carried table
was false: a drop that needs a burning mob, a sheep of one colour or a player killer never happened.

Now the predicate is rewritten in place, as 26.3's own tables are written:

  • type -> minecraft:entity_type; distance, movement, location, stepping_on, movement_affected_by,
    effects, nbt, flags, equipment, periodic_tick, team, slots, components, predicates ->
    minecraft:<field>; vehicle, passenger, targeted_entity the same, recursively;
  • type_specific {"type": k, ...} -> minecraft:type_specific/<k> (slime is cube_mob); a variant kind's
    variant and a sheep's color go to minecraft:components (minecraft:<kind>/variant, minecraft:sheep/color),
    and a variant kind with nothing else left is the component alone; a player's looking_at and a lightning bolt's
    entity_struck are upgraded too;
  • damage_source_properties: its direct_entity and source_entity.

A predicate already in 26.3's shape is left as it is (the test runs the upgrade twice).

Test: entity_predicates_get_26_3_keys (flags in a function's condition, type and vehicle with a frog variant, a
damage source with equipment, a slime's size, a sheep's colour).

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

26.3's EntityPredicate codec (entity_type, distance, movement, location, stepping_on, movement_affected_by, effects, nbt, flags, equipment, vehicle, passenger, targeted_entity, periodic_tick, team, slots, components, predicates, type_specific) and EntitySubPredicates (the minecraft:type_specific/<kind> keys, slime as cube_mob), and the variant components (DataComponents.*_VARIANT, SHEEP_COLOR), checked against the 26.3 data's own loot tables. Harness: none yet; the parity job picks the carry harnesses that apply.

Self-check

pr_ready (tools/pr_ready.py --quick on Marian_PC, against origin/main at 406ad19e4, 3 min 17 s)

Check Result
Scope ✅ 1 files, +171 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 612 run, FAILED (failures=14, skipped=2) (2 min 16 s)
rustfmt ✅ (11 s)
clippy ✅ (5 s)
tests: horizon-port-pack ✅ 103 passed (5 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (5 s)
launcher tests ✅ 437 passed (27 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The Python tests' 14 failures are all in tests/test_pre_push.py and fail the same way on a clean origin/main (406ad19e4) on this Windows machine (the pre-push hook tests); nothing in this branch touches Python or the hooks.

🤖 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/7272 **Author:** [@mmmaarian03-crypto](https://github.com/mmmaarian03-crypto) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `port-pack/loot-entity-predicates` --- ### 📝 Commits (1) - [`068a20e`](https://github.com/horizon-rust/horizon/commit/068a20e36fe87b2458c62a531e35742f25d08b31) port-pack: entity predicates of carried loot tables in 26.3's keys ### 📊 Changes **1 file changed** (+171 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-port-pack/src/carry.rs` (+171 -0) </details> ### 📄 Description > 🤖 Opened by Marian's AI agent (Claude), not by Marian himself. ## What and why Fixes #7271. `carry` upgrades a mod's loot tables to 26.3 (`upgrade_loot`, `upgrade_condition`), but the predicates of `minecraft:entity_properties` and `minecraft:damage_source_properties` conditions kept 1.21's field names. 26.3's `EntityPredicate` reads its sub-predicates only under their registry keys, so every such condition of a carried table was false: a drop that needs a burning mob, a sheep of one colour or a player killer never happened. Now the predicate is rewritten in place, as 26.3's own tables are written: - `type` -> `minecraft:entity_type`; `distance`, `movement`, `location`, `stepping_on`, `movement_affected_by`, `effects`, `nbt`, `flags`, `equipment`, `periodic_tick`, `team`, `slots`, `components`, `predicates` -> `minecraft:<field>`; `vehicle`, `passenger`, `targeted_entity` the same, recursively; - `type_specific {"type": k, ...}` -> `minecraft:type_specific/<k>` (`slime` is `cube_mob`); a variant kind's `variant` and a sheep's `color` go to `minecraft:components` (`minecraft:<kind>/variant`, `minecraft:sheep/color`), and a variant kind with nothing else left is the component alone; a player's `looking_at` and a lightning bolt's `entity_struck` are upgraded too; - `damage_source_properties`: its `direct_entity` and `source_entity`. A predicate already in 26.3's shape is left as it is (the test runs the upgrade twice). Test: `entity_predicates_get_26_3_keys` (flags in a function's condition, type and vehicle with a frog variant, a damage source with equipment, a slime's size, a sheep's colour). ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference 26.3's `EntityPredicate` codec (`entity_type`, `distance`, `movement`, `location`, `stepping_on`, `movement_affected_by`, `effects`, `nbt`, `flags`, `equipment`, `vehicle`, `passenger`, `targeted_entity`, `periodic_tick`, `team`, `slots`, `components`, `predicates`, `type_specific`) and `EntitySubPredicates` (the `minecraft:type_specific/<kind>` keys, `slime` as `cube_mob`), and the variant components (`DataComponents.*_VARIANT`, `SHEEP_COLOR`), checked against the 26.3 data's own loot tables. Harness: none yet; the parity job picks the carry harnesses that apply. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Marian_PC, against origin/main at 406ad19e4, 3 min 17 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +171 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 612 run, FAILED (failures=14, skipped=2) (2 min 16 s) | | rustfmt | ✅ (11 s) | | clippy | ✅ (5 s) | | tests: horizon-port-pack | ✅ 103 passed (5 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (5 s) | | launcher tests | ✅ 437 passed (27 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The Python tests' 14 failures are all in `tests/test_pre_push.py` and fail the same way on a clean origin/main (406ad19e4) on this Windows machine (the pre-push hook tests); nothing in this branch touches Python or the hooks. 🤖 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 06:39:45 +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#7456
No description provided.