import * as Minecraft from "mojang-minecraft"

Minecraft.world.events.tick.subscribe((tick) => {
    for (const player of Minecraft.world.getPlayers()) {
        if (player.isSneaking) {
            player.runCommand(`scoreboard players set @s sneaking 1`)
        } else {
            player.runCommand(`scoreboard players set @s sneaking 0`)
        }
    }
})

Minecraft.world.events.tick.subscribe((tick) => {
    for (const player of Minecraft.world.getPlayers()) {
        if (player.getComponent("minecraft:health").current == 0) {
            player.runCommand(`scoreboard players set @s teradie 1`)
        } else {
            player.runCommand(`scoreboard players set @s teradie 0`)
        }
    }
})

