events.listen('item.right_click', event => {
    
  if (event.item.id == 'kubejs:delight_builder') {
	  if (event.player.world.isOverworld()) {
	  
	event.player.playSound('rats:biplane_loop');
	
	// the simpler way
	/*
	event.server.runCommandSilent('execute as ' + event.player.name + ' run loot spawn ' +event.player.x + ' ' + event.player.y + ' ' + event.player.z +' loot kubejs:blocks/lootblock_builder');
	*/
	event.server.runCommandSilent('execute as ' + event.player.name + ' run summon minecraft:falling_block ' + event.player.x + ' ' + (event.player.y+150) + ' ' + event.player.z + ' {BlockState:{Name:"kubejs:lootblock_builder"},Time:30}');
	
	event.server.runCommandSilent('execute as ' + event.player.name + ' run particle atmospheric:morado_blossom ' + event.player.x + ' ' + event.player.y + ' ' + event.player.z + ' 1 20 1 4 300');
      
    if (!event.player.isCreativeMode()) {
    
    event.item.setCount(event.item.getCount() - 1)
    }
	  }
    }
});