
const $Items = Java.loadClass('net.minecraft.world.item.Items')
const $Pickaxe = Java.loadClass('net.minecraft.world.item.PickaxeItem')

const mod_id = "chisel_chipped_integration";
BlockEvents.broken( event => {
    if(!event.player.creative) {
        if (event.block.id.includes(mod_id)) {
            let heldItem = event.player.getMainHandItem();
    
            if(!(heldItem.item instanceof $Pickaxe)) {
                let drops = event.block.getDrops(event.player, $Items.DIAMOND_PICKAXE);
                
                drops.forEach( item => {
                    event.block.popItem(item)
                })
            }
        }
    }
})