const flowerEffects = {
  "sapphire_meteors:verdrop_fruit": { effect: "minecraft:speed", duration: 600, amplifier: 0, name: "Speed" },
  "sapphire_meteors:floresta_fruit": { effect: "minecraft:regeneration", duration: 200, amplifier: 1, name: "Regeneration" },
  "sapphire_meteors:mambloom_fruit": { effect: "minecraft:fire_resistance", duration: 600, amplifier: 0, name: "Fire Resistance" },
  "sapphire_meteors:bloombyte_fruit": { effect: "minecraft:conduit_power", duration: 600, amplifier: 0, name: "Conduit Power" },
  "sapphire_meteors:echofluff_fruit": { effect: "minecraft:strength", duration: 600, amplifier: 0, name: "Strength" }
};

export const event = {
  onConsume(event) {
    const { source } = event;

    const effectData = flowerEffects[event.itemStack.typeId];
    if (!effectData) return;

    source.addEffect(effectData.effect, effectData.duration, { amplifier: effectData.amplifier });
    const message = `§aFruit Effect: ${effectData.name}`;
    source.runCommand(`title @s actionbar ${message}`);
  }
};