import { world } from "@minecraft/server";
import * as ArmorUtility from "../U/ArmorUtility";
import { applyPhoenixArmorInvincibility } from "../A/PhoenixArmor";
import { ArmorType } from "../DATA/ArmorConfig";
export function runEntityHealthChangedAfterEvent(log) {
    world.afterEvents.entityHealthChanged.subscribe((event) => {
        const entity = event.entity;
        try {
            if (entity && entity.isValid()) {
                const entityId = entity.typeId;
                if (entityId === "minecraft:player" && event.newValue < event.oldValue) {
                    if (ArmorUtility.getArmorType(entity) === ArmorType.Phoenix) {
                        applyPhoenixArmorInvincibility(log, entity, event.newValue);
                    }
                }
            }
        }
        catch { }
    });
}

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