// This script gives players items only when they first join
onEvent('player.logged_in', event => {
    let player = event.player;
    let data = player.persistentData;

    if (!data.hasJoinedBefore) {
        // Mark the player as having joined before
        data.hasJoinedBefore = true;
        
        // Give items
        player.give(Item.of('modernlife:flashlight', '{Damage:0}'));
        player.give(Item.of('pamhc2foodextended:cookoutmealitem', 1));
        player.give(Item.of('pamhc2foodextended:chickenkatsuitem', 18));

    }
});
