import { world, system , ItemStack } from "@minecraft/server";

import "./bloomAttacks.js";
import "./bouldraxAttacks.js";
import "./cubeAttacks.js";
import "./controller.js";
import "./weapons.js";
import "./totems.js";
import "./twinWolfAttacks.js";

world.afterEvents.playerSpawn.subscribe((eventData) => {
    const player = eventData.player;
    const hasTag = player.hasTag("ecl_fe_book");
    if (!hasTag) {
        player.addTag("ecl_fe_book");
        const inventory = player.getComponent("inventory");
        const container = inventory.container;
        const book = new ItemStack("bunnystudios_rpg:book_spawn_egg");
        container.addItem(book);
    }
});