[PR #2148] [CLOSED] Sneaking players no longer open villager trades or shake their heads #4049

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2148
Author: @kacpherek
Created: 10/26/2026
Status: ❌ Closed

Base: main ← Head: fix/villager-sneak-no-trade


📝 Commits (1)

  • 37c602c Sneaking players can no longer trade with or upset villagers

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/trading.rs (+6 -2)

📄 Description

What and why

Shift + right-click on a villager opened the trading screen, and on a baby villager or one with no offers it made the villager shake its head. In vanilla a sneaking player gets neither: the villager does nothing.

interact_trader now returns early for a villager when the acting player is sneaking, so the click goes on to the other interactions like any click that the villager ignores. Wandering traders are unchanged, because vanilla has no sneak check for them.

The check reads the same ShiftLeft key state as the other mob interactions. A LAN guest's sneak is already put into keys for the duration of their action, so it works for guests too.

Vanilla reference

  • Villager.mobInteract: returns super.mobInteract when the hand item is a villager spawn egg, the villager is dead, trading or sleeping, or player.isSecondaryUseActive(). Only after that does it shake the head of a baby or open the offers.
  • WanderingTrader.mobInteract: checks the spawn egg, alive, trading and baby only. No sneak check.

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/2148 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/villager-sneak-no-trade` --- ### 📝 Commits (1) - [`37c602c`](https://github.com/horizon-rust/horizon/commit/37c602cd9b9f78971d7aa0af0468dcf3bd502309) Sneaking players can no longer trade with or upset villagers ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/trading.rs` (+6 -2) </details> ### 📄 Description ## What and why Shift + right-click on a villager opened the trading screen, and on a baby villager or one with no offers it made the villager shake its head. In vanilla a sneaking player gets neither: the villager does nothing. `interact_trader` now returns early for a villager when the acting player is sneaking, so the click goes on to the other interactions like any click that the villager ignores. Wandering traders are unchanged, because vanilla has no sneak check for them. The check reads the same `ShiftLeft` key state as the other mob interactions. A LAN guest's sneak is already put into `keys` for the duration of their action, so it works for guests too. ## Vanilla reference - `Villager.mobInteract`: returns `super.mobInteract` when the hand item is a villager spawn egg, the villager is dead, trading or sleeping, or `player.isSecondaryUseActive()`. Only after that does it shake the head of a baby or open the offers. - `WanderingTrader.mobInteract`: checks the spawn egg, alive, trading and baby only. No sneak check. ## 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:17 +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#4049
No description provided.