You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shulkerboxes are meant to drop themselves when they are broken by a player in creative mode and their inventory isn't empty.
Because of how block breaking is implemented in PocketMine-MP it is currently impossible to let a block drop anything while the player is in creative mode. https://github.com/pmmp/PocketMine-MP/blob/master/src/world/World.php#L1653
Steps to reproduce the issue
Go into creative mode.
Place a shulkerbox and fill its inventory with items.
Break the shulkerbox and see that it doesn't drop.
Possible solutions
The block class could get two additional functions which would be called in the World::useBreakOn(...) function when a player breaks a block in creative mode.
Block::getCreativeDrops() : Item[] which returns the drops of that block while the player would be in creative mode. The function would simply return an empty array while the ShulkerBox class could overwrite that function to implement the block dropping.
Block::getCreativeXpDrop() : int which would be the creative mode opposite of Block::getXpDropForTool(Item) : int which would return the dropped amount of xp when the block is broken in creative mode. At the moment, this function had no use. Right now furnaces don't give xp, either when collecting from them or when breaking them. (Furnaces don't produce xp #4418) If this would be added in the future, the Block::getCreativeXpDrop() : int function could be used to let the xp also drop when a furnace is broken by a player in creative mode.
The text was updated successfully, but these errors were encountered:
Issue description
Shulkerboxes are meant to drop themselves when they are broken by a player in creative mode and their inventory isn't empty.
Because of how block breaking is implemented in PocketMine-MP it is currently impossible to let a block drop anything while the player is in creative mode.
https://github.com/pmmp/PocketMine-MP/blob/master/src/world/World.php#L1653
Steps to reproduce the issue
Possible solutions
World::useBreakOn(...)
function when a player breaks a block in creative mode.Block::getCreativeDrops() : Item[]
which returns the drops of that block while the player would be in creative mode. The function would simply return an empty array while the ShulkerBox class could overwrite that function to implement the block dropping.Block::getCreativeXpDrop() : int
which would be the creative mode opposite ofBlock::getXpDropForTool(Item) : int
which would return the dropped amount of xp when the block is broken in creative mode. At the moment, this function had no use. Right now furnaces don't give xp, either when collecting from them or when breaking them. (Furnaces don't produce xp #4418) If this would be added in the future, theBlock::getCreativeXpDrop() : int
function could be used to let the xp also drop when a furnace is broken by a player in creative mode.The text was updated successfully, but these errors were encountered: