Easy NPC

Easy NPC

2M Downloads

[Bug] Trading open command doesn't work on dedicated server

DedMaxim opened this issue ยท 1 comments

commented

Minecraft and Mod version ๐Ÿž
Minecraft 1.20.1
Forge 47.3.11, also tried 47.3.5 - same result
Easy NPC 5.6.0 / no other mods installed
Windows 10 20H2
Intel Xeon E5-2680v2
Nvidia GTX 1070
Nvidia driver 560.81

Describe the bug ๐Ÿž
Execution of "/easy_npc trading open {UUID}" command on a dedicated server returns an error. Error message:
Could not parse command: Cannot invoke "de.markusbordihn.easynpc.network.message.ServerNetworkMessageHandlerInterface.requestDataSync(java.util.UUID)" because the return value of "de.markusbordihn.easynpc.network.NetworkMessageHandlerManager.getServerHandler()" is null
...ding open 66cc4ed4-2657-42a3-97be-0a8adcb19d14<--[HERE]

To Reproduce โš™๏ธ
Steps to reproduce the behavior:

  1. Create a dedicated server and a client for it, join the server.
  2. Place an NPC and add any trading for it.
  3. Run the command /easy_npc trading open {UUID}

Expected behavior โœ”๏ธ
Trading screen opens

Screens... Video! ๐Ÿ“ธ
Video demonstration
https://drive.google.com/file/d/1FEXM2Ae_geveHb8v9slLD3netD3bWlj-/view?usp=sharing

Debugging ๐Ÿ› ๏ธ
debug.log from the server
debug.log
latest.log from the server
latest.log
latest.log from the client
latest.log

Additional context ๐Ÿ“
Was working fine in 4.5.1. And yes, I did fix all trades after upgrade. And I also tried fresh installes, as demonstrated in the video I provided

commented

Thank you for the detailed report. On a dedicated server, the command is executed server-side and may sometimes fail to correctly detect the nearest player.

I'll work on a fix for this, but in the meantime, you can bypass this issue by specifying the player directly at the end of the command, like so:
/easy_npc trading open 63941185-4a98-4410-80c2-bf369388207b Dev
or
/easy_npc trading open 63941185-4a98-4410-80c2-bf369388207b @p