import { world, system } from "@minecraft/server";
import { giveGuideBook } from "../C/GiveGuide";
import { setupRecipes } from "../C/RecipeUnlock";
export function runPlayerSpawnEvent(log) {
    world.afterEvents.playerSpawn.subscribe((event) => {
        giveGuideBook(event.player, log);
        setupRecipes(event.player, log);
        const player = event.player;
        const dimension = player.dimension;
        const objective = world.scoreboard.getObjective("kicu_mmad_HasSpawned");
        const scoreboardIdentity = player.scoreboardIdentity;
        if (!scoreboardIdentity || !objective.getParticipants().includes(scoreboardIdentity)) {
            objective.setScore(player, 1);
            system.runTimeout(() => {
                dimension
                    .getEntities({ location: player.location, families: ["kicu_mmad_nest"], maxDistance: 100 })
                    .forEach((nest) => {
                    nest.remove();
                });
                dimension
                    .getEntities({ location: player.location, families: ["kicu_mmad_wild_mount"], maxDistance: 100 })
                    .forEach((nest) => {
                    nest.remove();
                });
            }, 10);
        }
    });
}

//# sourceMappingURL=../../../../../_KiCuMountsBPDebug/kicu/mmad/ESS/PlayerSpawnEvent.js.map
