pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Inventory not fully cleaned using clearAll() #3340

Closed enricoangelon closed 4 years ago

enricoangelon commented 4 years ago

Issue description

Steps to reproduce the issue

  1. Make a plugin that gives you a item (test with wooden sword in hand, better if you give one different for each slot), then teleports you in another world and then clear inventory with clearAll()
  2. You see the other slots cleaned but the first one in hand no

OS and versions

Plugins

Just the private core that does the same as i wrote ahead

Crashdump, backtrace or other files

dktapps commented 4 years ago

once again, if you have nothing better to say than "me too", please just shut up, or give the issue a thumbsup if you must... commenting like this pollutes everyone's notifications for no good reason

TheNewHEROBRINEX commented 4 years ago

This bug happens if you clear the inventory in EntityDamageByEntityEvent and I think it is because the server sends the item again to update its meta: https://github.com/pmmp/PocketMine-MP/blob/stable/src/pocketmine/Player.php#L2594

dktapps commented 4 years ago

thanks for the insight. I would surmise that this issue is in the same lane as #2010.