import { EntityComponentTypes, EntityHealthComponent, world } from "@minecraft/server";
export function extinguish_fire() {
    const players = world.getAllPlayers();
    players.forEach((player) => {
        const onfire = player.getComponent(EntityComponentTypes.OnFire);
        if (onfire && onfire.onFireTicksRemaining > 0) {
            player.extinguishFire(false);
        }
        else {
            const health = player.getComponent(EntityHealthComponent.componentId);
            if (health.currentValue < 20) {
                health.setCurrentValue(health.currentValue + 1);
            }
        }
    });
}