[PR #2973] [MERGED] Fire the summoned, container loot and recipe crafted advancement triggers #4726

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

📋 Pull Request Information

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

Base: main ← Head: fix/advancement-triggers-summon-loot-craft


📝 Commits (5)

  • f620900 Fire summoned_entity for built golems and the respawned dragon
  • 33c15a6 Fire player_generates_container_loot when a loot roll is opened
  • 3dc9586 Fire recipe_crafted when a crafting, stonecutter or smithing result is taken
  • 8428ff0 Merge main into fix/advancement-triggers-summon-loot-craft
  • 74d986c Merge main into this branch

📊 Changes

11 files changed (+237 additions, -18 deletions)

View changed files

📝 crates/horizon-client/src/advancements.rs (+16 -0)
📝 crates/horizon-client/src/game.rs (+9 -3)
📝 crates/horizon-client/src/game/advancements.rs (+49 -0)
📝 crates/horizon-client/src/game/brush.rs (+4 -2)
📝 crates/horizon-client/src/game/commands.rs (+43 -0)
📝 crates/horizon-client/src/game/dragon.rs (+32 -4)
📝 crates/horizon-client/src/game/golems.rs (+29 -0)
📝 crates/horizon-client/src/game/lan_crafting.rs (+9 -1)
📝 crates/horizon-client/src/game/minecarts.rs (+12 -0)
📝 crates/horizon-client/src/menu.rs (+19 -5)
📝 crates/horizon-client/src/stations.rs (+15 -3)

📄 Description

What and why

Several advancements could never be finished, because the code never fired their triggers:

  • Iron, snow and copper golems a player builds now fire summoned_entity for players within 5 blocks of the golem. The end dragon respawn fires it for the new dragon, for every player alive within 192 blocks of the fight (the host and each guest, so it works in single player too). This unlocks adventure/summon_iron_golem and end/respawn_dragon.
  • Opening a chest, trapped chest or chest minecart whose loot table has not been rolled yet fires player_generates_container_loot. So does the first brush of a suspicious sand or gravel block. This unlocks nether/loot_bastion and adventure/salvage_sherd. Opening marks the roll as unpacked, so a second open does not fire again, and the container saves its items instead of its table (as vanilla does).
  • Taking a crafting result (click or shift-click, 2x2 and table), a stonecutter result, or a smithing result fires recipe_crafted with the recipe id and the stacks that went in. This unlocks adventure/trim_with_any_armor_pattern and adventure/craft_decorated_pot_using_only_sherds.
  • Smithing and stonecutter results now also unlock their recipe in the recipe book when taken, as crafting already did (vanilla awardUsedRecipes).

Vanilla reference

  • world/level/block/CarvedPumpkinBlock.java:100-106 (spawnGolemInWorld, box inflated by 5), copper golem at :82
  • world/level/dimension/end/EnderDragonFight.java:286 (setRespawnStage(END))
  • world/RandomizableContainer.java:77 (unpackLootTable), world/level/block/entity/RandomizableContainerBlockEntity.java (createMenu)
  • world/entity/vehicle/ContainerEntity.java:98 (chest minecart), world/level/block/entity/BrushableBlockEntity.java:92
  • server/level/ServerPlayer.java:1673 (triggerRecipeCrafted), world/inventory/RecipeCraftingHolder.java:17 (awardUsedRecipes), world/inventory/ResultSlot.java:58, world/inventory/SmithingMenu.java:72, world/inventory/StonecutterMenu.java:65
  • advancements/triggers/RecipeCraftedTrigger.java (matches), advancements/triggers/LootTableTrigger.java (loot_tables)

Not done: furnace result takes also fire recipe_crafted in vanilla (AbstractFurnaceBlockEntity.java:423), but no advancement reads it. Chest boats have no loot table in Horizon, so there is nothing to fire.

Self-check

clippy and fmt pass for horizon-client. Not run in game.


🔄 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/2973 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/advancement-triggers-summon-loot-craft` --- ### 📝 Commits (5) - [`f620900`](https://github.com/horizon-rust/horizon/commit/f6209003de22c1759d3d046e727b6b6901bb950e) Fire summoned_entity for built golems and the respawned dragon - [`33c15a6`](https://github.com/horizon-rust/horizon/commit/33c15a6d79cc0f9ee1df07883b875900caca6174) Fire player_generates_container_loot when a loot roll is opened - [`3dc9586`](https://github.com/horizon-rust/horizon/commit/3dc958611c40b52d6a33dbbd19f2f14ba164becc) Fire recipe_crafted when a crafting, stonecutter or smithing result is taken - [`8428ff0`](https://github.com/horizon-rust/horizon/commit/8428ff0f59d1fef3fb67623c0cf4caabc1ddfde4) Merge main into fix/advancement-triggers-summon-loot-craft - [`74d986c`](https://github.com/horizon-rust/horizon/commit/74d986ca445ac1c0b65417a6717ed5ef252a9fcb) Merge main into this branch ### 📊 Changes **11 files changed** (+237 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/advancements.rs` (+16 -0) 📝 `crates/horizon-client/src/game.rs` (+9 -3) 📝 `crates/horizon-client/src/game/advancements.rs` (+49 -0) 📝 `crates/horizon-client/src/game/brush.rs` (+4 -2) 📝 `crates/horizon-client/src/game/commands.rs` (+43 -0) 📝 `crates/horizon-client/src/game/dragon.rs` (+32 -4) 📝 `crates/horizon-client/src/game/golems.rs` (+29 -0) 📝 `crates/horizon-client/src/game/lan_crafting.rs` (+9 -1) 📝 `crates/horizon-client/src/game/minecarts.rs` (+12 -0) 📝 `crates/horizon-client/src/menu.rs` (+19 -5) 📝 `crates/horizon-client/src/stations.rs` (+15 -3) </details> ### 📄 Description ## What and why Several advancements could never be finished, because the code never fired their triggers: - Iron, snow and copper golems a player builds now fire `summoned_entity` for players within 5 blocks of the golem. The end dragon respawn fires it for the new dragon, for every player alive within 192 blocks of the fight (the host and each guest, so it works in single player too). This unlocks `adventure/summon_iron_golem` and `end/respawn_dragon`. - Opening a chest, trapped chest or chest minecart whose loot table has not been rolled yet fires `player_generates_container_loot`. So does the first brush of a suspicious sand or gravel block. This unlocks `nether/loot_bastion` and `adventure/salvage_sherd`. Opening marks the roll as unpacked, so a second open does not fire again, and the container saves its items instead of its table (as vanilla does). - Taking a crafting result (click or shift-click, 2x2 and table), a stonecutter result, or a smithing result fires `recipe_crafted` with the recipe id and the stacks that went in. This unlocks `adventure/trim_with_any_armor_pattern` and `adventure/craft_decorated_pot_using_only_sherds`. - Smithing and stonecutter results now also unlock their recipe in the recipe book when taken, as crafting already did (vanilla `awardUsedRecipes`). ## Vanilla reference - `world/level/block/CarvedPumpkinBlock.java:100-106` (`spawnGolemInWorld`, box inflated by 5), copper golem at `:82` - `world/level/dimension/end/EnderDragonFight.java:286` (`setRespawnStage(END)`) - `world/RandomizableContainer.java:77` (`unpackLootTable`), `world/level/block/entity/RandomizableContainerBlockEntity.java` (`createMenu`) - `world/entity/vehicle/ContainerEntity.java:98` (chest minecart), `world/level/block/entity/BrushableBlockEntity.java:92` - `server/level/ServerPlayer.java:1673` (`triggerRecipeCrafted`), `world/inventory/RecipeCraftingHolder.java:17` (`awardUsedRecipes`), `world/inventory/ResultSlot.java:58`, `world/inventory/SmithingMenu.java:72`, `world/inventory/StonecutterMenu.java:65` - `advancements/triggers/RecipeCraftedTrigger.java` (`matches`), `advancements/triggers/LootTableTrigger.java` (`loot_tables`) Not done: furnace result takes also fire `recipe_crafted` in vanilla (`AbstractFurnaceBlockEntity.java:423`), but no advancement reads it. Chest boats have no loot table in Horizon, so there is nothing to fire. ## Self-check clippy and fmt pass for horizon-client. Not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:29 +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#4726
No description provided.