import { world, ItemStack} from "@minecraft/server";
import './interactions'
import './durability'

world.afterEvents.playerSpawn.subscribe(e => {
    const player = e.player;
    if (!player.hasTag("gs_cb_firstjoin")) {
        const inventory = player.getComponent("inventory").container;

        const guideBook = new ItemStack("gs_cb:guide_book", 1);
        const settingsItem = new ItemStack("gs_cb:settings", 1);

        inventory.addItem(guideBook);
        inventory.addItem(settingsItem);

        player.addTag("gs_cb_firstjoin");
    }
});

