import { world } from "@minecraft/server";
import { CAMOUFLAGE_POTION } from "./specific/camouflagePotion";
import { COLD_ROTTEN_FLESH } from "./specific/coldRottenFlesh";
import { IGUANA_MEAT } from "./specific/iguanaMeat";


world.afterEvents.itemCompleteUse.subscribe(ev => {
    const {itemStack, source, useDuration} = ev;
    const typeId = itemStack.typeId

    if (CAMOUFLAGE_POTION.equalsItemId(typeId)) CAMOUFLAGE_POTION.onConsume(source)
    if (IGUANA_MEAT.isConsumed(typeId)) IGUANA_MEAT.onConsume(source)
    if (COLD_ROTTEN_FLESH.isConsumed(typeId)) COLD_ROTTEN_FLESH.onConsume(source)
})
