The bug is pretty straightforward, here is the code to replicate it:
public final class TestBlockBreak extends JavaPlugin implements Listener { @Override public void onEnable(){ this.getServer().getPluginManager().registerEvents(this, this); } @Override public void onDisable() {} @EventHandler public void onBreak(BlockBreakEvent e) { e.setDropItems(false); // The code in question here Player p = e.getPlayer(); int broken = 0; for (Material mat : Material.values()) { broken += p.getStatistic(Statistic.MINE_BLOCK, mat); } Bukkit.broadcastMessage("Blocks broken: " + broken); } }
Each time the broadcast is called, the number of blocks broken in the statistic does not change.
Do note: The version is behind yes, but this bug persists across any version of 1.18 - 1.18.2, I did not test this on any other version