Hi there! I am wanting a plugin that does not drop blocks when broken when a player's inventory is full. Thanks
For the checking if the inventory is full, should I only check for all the slots being full, or if the stack of the item that is being broken hasnt reached 64 should I still allow the player to break the block. Edit: To Clarify, Do you want to cancel the block breaking if the player wouldn't be able to pick up the broken block, or if their inventory is full of types of items.
^ I already know this, I meant do you want to cancel the block droppping if their inventory is full of types of items or if its completely full of that item. This is hard to explain, here's a visual. Would you consider that players Inventory full and cancel the block break , or do you want them to be able to break only 1 more sand, or do you want them to be able to break 1 more of any item. Im going to assume you want the 1 more sand option but please respond.
You can use /gamerule keepInventory true to prevent player inventory loss, but I'm not sure of anything to stop drops with out preventing the players from even breaking the blocks.
@Sethburster as far as i understand @Scrubletz he want to cancel the item being picked up, not the breakEvent itself. @tcwolf12 thats an easy one, just cancel the PlayerPickupItemEvent, and/or remove the Item entity.
Just read his message @Lordloss. It says, " does not drop blocks when broken". Which would be cancelling the Block Break event. But I am not sure if @Scrubletz still wants the block to be broken? Or should the break just be cancelled
@Sethburster He wants to prevent the item dropping, not the breaking itself. I read his message, but obviously you didnt get the difference between block dropping and breaking...
It's fine if the block break is just cancelled replying with a message: "Your inventory is full" or something