Closed HashimTheArab closed 3 years ago
After some testing, InventoryTransactionPacket is still sent (not sure if its 100% of the time) when theres pot lag, but PlayerInteractEvent is not at all
Every person whos ever PvP'd on a Pocketmine server can confirm this
This can be fixed super easily through plugins (haha plugin go brrt), but regardless
It's caused because of these few lines:
What could be done instead of checking if the item in hand equals the item in the slot, do a check if the hotbar slot in the packet is 0 >= and <= 9 and that the item given in the InventoryTransactionPacket equals the item in the player's inventory in the given hotbar slot (<- probably bad explanation but whatever)
I don't see why those lines would cause a problem unless the server-side itemstacks were modified externally.
This was done on 3.19.1+dev with 0 plugins, if you'd like me to do it on the latest commit, I can re-do the video
This behaviour also happens on vanilla (local world), which just shows how broken the game is: https://streamable.com/enfu3d
ethan has a point tbh
The most obvious explanation for this that jumps to mind is that the server doesn't know about the change of held item slot by the time the transaction arrives, because the MobEquipmentPacket
that updates the selected slot hasn't arrived yet. This can most likely be fixed by updating the server-side held-item index to whatever the transaction says it should be.
This happens with many items, examples being ender pearls and splash potions. A video is attached below showing first the actual result, and second the expected result.
Steps to reproduce the issue
OS and versions
Plugins
Core v3.1.0, MineReset v3.2.0, MultiWorld v1.5.2, PurePerms v2.0.0
Crashdump, backtrace or other files
https://user-images.githubusercontent.com/13991048/114323341-b5ee7980-9af2-11eb-8259-5137972c801b.mp4