pmmp / PocketMine-MP

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

ItemBreakSound plays when Durable item is placed in Item Frame in survival mode #6029

Open Nerahikada opened 1 year ago

Nerahikada commented 1 year ago

Issue description

When a survival or adventure mode player places a durable item in an Item Frame, an ItemBreakSound is played.

When a Item Frame is interacted, the number of items is decremented, and when it reaches zero, the item is considered broken and the sound is played. https://github.com/pmmp/PocketMine-MP/blob/19e3d339f6c119fb30b49e2a502b69882fee310f/src/block/ItemFrame.php#L140 https://github.com/pmmp/PocketMine-MP/blob/19e3d339f6c119fb30b49e2a502b69882fee310f/src/player/Player.php#L1559-L1561

Steps to reproduce the issue

  1. Change the player's game mode to survival or adventure mode
  2. Place durable items such as wooden swords in the Item Flame

OS and versions

dktapps commented 1 year ago

Have you tested this or is it hypothetical? I don't see how this would happen unless the item actually did break.

dktapps commented 1 year ago

Looks like this commit may be responsible: https://github.com/pmmp/PocketMine-MP/commit/95263795a8174d443d6b42d9f338cb24df3686fb

Nerahikada commented 1 year ago

I tested it

https://github.com/pmmp/PocketMine-MP/assets/15967582/ea9fd1d0-221f-40b0-8919-9225338baa49