[PR #2221] [MERGED] Fire the villager_trade advancement trigger on trades #4114

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

📋 Pull Request Information

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

Base: main ← Head: fix/villager-trade-trigger


📝 Commits (1)

  • a5fa40d Fire the villager_trade trigger so What a Deal! can be earned

📊 Changes

3 files changed (+50 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/advancements.rs (+21 -0)
📝 crates/horizon-client/src/game/lan_trading.rs (+6 -1)
📝 crates/horizon-client/src/game/trading.rs (+23 -5)

📄 Description

What and why

Trading with a villager or wandering trader never fired the minecraft:villager_trade advancement trigger, so "What a Deal!" (adventure/trade) and "Star Trader" (adventure/trade_at_world_height) could not be earned.

The trigger is now fired for every trade made, with the trading mob and the offer's result item, for the player at the trade window.

On a server, a guest's trade ran in host code outside the guest's turn, so its traded_with_villager statistic went to the host. The statistic and the trigger now run as the guest, so they land in the guest's own statistics and advancements.

Vanilla reference

  • AbstractVillager.notifyTrade: CriteriaTriggers.TRADE.trigger(player, this, offer.getResult()) for a ServerPlayer.
  • TradeTrigger.trigger / TriggerInstance.matches: player, villager and item conditions.
  • MerchantResultSlot.checkTakeAchievements: the traded_with_villager statistic, per trade.

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/2221 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/villager-trade-trigger` --- ### 📝 Commits (1) - [`a5fa40d`](https://github.com/horizon-rust/horizon/commit/a5fa40d2eea6609a3c567601059cdcf29415c4a3) Fire the villager_trade trigger so What a Deal! can be earned ### 📊 Changes **3 files changed** (+50 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/advancements.rs` (+21 -0) 📝 `crates/horizon-client/src/game/lan_trading.rs` (+6 -1) 📝 `crates/horizon-client/src/game/trading.rs` (+23 -5) </details> ### 📄 Description ## What and why Trading with a villager or wandering trader never fired the `minecraft:villager_trade` advancement trigger, so "What a Deal!" (`adventure/trade`) and "Star Trader" (`adventure/trade_at_world_height`) could not be earned. The trigger is now fired for every trade made, with the trading mob and the offer's result item, for the player at the trade window. On a server, a guest's trade ran in host code outside the guest's turn, so its `traded_with_villager` statistic went to the host. The statistic and the trigger now run as the guest, so they land in the guest's own statistics and advancements. ## Vanilla reference - `AbstractVillager.notifyTrade`: `CriteriaTriggers.TRADE.trigger(player, this, offer.getResult())` for a `ServerPlayer`. - `TradeTrigger.trigger` / `TriggerInstance.matches`: `player`, `villager` and `item` conditions. - `MerchantResultSlot.checkTakeAchievements`: the `traded_with_villager` statistic, per trade. ## 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:46 +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#4114
No description provided.