jpenilla / WanderingTrades

Spigot plugin to create custom trades for Wandering Traders (and Villagers).
https://www.spigotmc.org/resources/wanderingtrades.79068/
MIT License
28 stars 9 forks source link

Lag spike/crash when player's head is generated as a trade #223

Open Parthodys opened 9 months ago

Parthodys commented 9 months ago

Describe the bug Sometimes when a player talks to a Wandering Trader and it happens to have a player's head, the server lags/crashes for a moment. https://pastebin.com/h4XzxJvu

To Reproduce Steps to reproduce the behavior:

  1. Have lots of potential players for heads
  2. Talk to a Wandering Trader with playerhead trades enabled
  3. Server lags, disconnecting everyone and almost crashes
  4. If server recovers, the head is tradeable

Expected behavior Player head trade generated without lag. If there are too many heads to choose from, implement some maximum search time or something.

Server Software and Version:

Additional context We have had this issue before when running 1.19, updating server & plugin to 1.20.2 did not fix this issue. We have also attempted to limit the amount of players whose heads can be traded by only granting the permission to certain ranks. We also have Bedrock users via Geyser with a dot in front of their names.

Parthodys commented 1 week ago

Was anything done with this one?