-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
None
-
This server is running CraftBukkit version git-Spigot-2040c4c-1872231 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
-
Yes
Block.BreakBlockNaturually(ItemStack tool) does not seem to respect the tool being used. For example, if the block is diamond ore and the tool is a wooden pick, the block should break but not drop diamonds. Similarly, some blocks, if broken with hands (tool = AIR) should not drop the block at all. It appears as if this parameter has no effect.
If it is used, breaking blocks with bare hands will drop the block. Breaking blocks with incorrect tools will drop drops.
Test plugin:
public class TestPlugin extends JavaPlugin implements Listener { @Override public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler public void onBlockBreak(BlockBreakEvent e) { ItemStack inHand = e.getPlayer().getInventory().getItemInMainHand(); Bukkit.getLogger().info("Breaking block " + e.getBlock() + " with " + inHand); e.setCancelled(true); e.getBlock().breakNaturally(inHand); } }