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

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

let daysPassed = 0;

function dayCount() {
    if (player.isSleeping) {
        daysPassed += 1
        world.sendMessage("Days Passed " + daysPassed)

    }
    else if (system.currentTick % 24000 === 0) {
        daysPassed += 1;
        world.sendMessage("Days Passed: " + daysPassed);
    }
}

system.run(dayCount);
