events.listen('item.right_click', event => {
    
  if (event.item.id == 'kubejs:food_bag') {

	event.player.playSound('tconstruct:frypan_hit');

	event.server.runCommandSilent('execute as ' + event.player.name + ' run loot spawn ' + event.player.x + ' ' + event.player.y + ' ' + event.player.z + ' loot kubejs:blocks/lootblock_food');
      
    if (!event.player.isCreativeMode()) {
    
    event.item.setCount(event.item.getCount() - 1)
    }
    }
});