I have the following script...
BlockEvents.broken(event => {
const {block, player} = event;
if ( !player ) return;
console.info(player.getUseItem());
console.info(player.handSlots[0].get );
if ( block.equals( 'phantasm:crystal_spike' ) || block.equals('phantasm:crystal_spike_tip') ) {
event.block.popItem('phantasm:crystal_spike_tip');
}
});
I'd like for the item to drop only if the block was broken with the correct tools, how would I do that?
It would also be nice if it didn't drop the item in creative but that doesn't really matter.