Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancelling PlayerTradeEvent levels up the villager and locks trades #11693

Open
SergioK29 opened this issue Dec 1, 2024 · 0 comments · May be fixed by #11730
Open

Cancelling PlayerTradeEvent levels up the villager and locks trades #11693

SergioK29 opened this issue Dec 1, 2024 · 0 comments · May be fixed by #11730
Labels

Comments

@SergioK29
Copy link

Expected behavior

Cancelling playertradeevent and/or setrewardexp false and setincreasetradeuses false when they are trading with a villager should prevent the trade with the villager

Observed/Actual behavior

it prevents the movement of items but the villager still gets xp and increases trade uses

Steps/models to reproduce

@EventHandler(ignoreCancelled = true)
  public void onTradeWithVillager(PlayerTradeEvent event) {
      event.setCancelled(true);
      event.setRewardExp(false);
      event.setIncreaseTradeUses(false);
  }

Plugin and Datapack List

My plugin

Paper version

This server is running Paper version 1.21.3-DEV-master@27e4ddc (2024-12-01T01:34:59Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.3-DEV-5f0932b (MC: 1.21.3)

Other

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant