// Listen to player login event
onEvent('player.logged_in', event => {
  // Check if player doesn't have "starting_items" stage yet
  if (!event.player.stages.has('starting_items')) {
    // Add the stage
    event.player.stages.add('starting_items')
    // Give some items to player
    event.player.inventory.set(0, 'minecraft:iron_sword')
    event.player.setHeadArmorItem('minecraft:iron_helmet')
    event.player.setChestArmorItem('minecraft:iron_chestplate')
    event.player.setLegsArmorItem('minecraft:iron_leggings')
    event.player.setFeetArmorItem('minecraft:iron_boots')
    event.player.inventory.set(7, 'xercamusic:guitar')
    event.player.inventory.set(8, 'minecraft:painting')
  }
})