Ruku Kiso

Create an items mod for mc bedrock where there is Megumin's hat that gives +10 hearts and her eye patch which gives +10 defence and her cape which gives 30 defence, hat in helmet slot and cape in chestplate slot and eye patch in boots area and add her staff which gives the exact same explosion specialeffect magic circle and make the range go upto 200 blocks range and deals explosion damage upto 50 blocks radius

Kodari AI
KodariOct 6 at 8:35 am 1
MeguminEquipmentMod
Creates a Minecraft Bedrock items mod featuring Megumin-themed equipment. Adds a hat (helmet slot) granting +10 hearts, an eye patch (boots slot) granting +10 defense, and a cape (chestplate slot) granting +30 defense. Includes Megumin's staff weapon that triggers the signature explosion special effect with a magic circle visual. The staff has a 200-block attack range and deals explosion damage within a 50-block radius, replicating Megumin's iconic explosion ability.
  1. Create Bedrock behavior/resource packs and define the four custom items with the requested equipment slots.

  2. Add script logic for the 10-heart bonus, 10/30-point defense, and 200-block staff targeting with a 50-block-radius explosion and magic-circle effect.

  3. Use vanilla item icons as placeholders; custom artwork and wearable models can be added separately.

Created a Bedrock behavior pack and resource pack with Megumin’s hat, eyepatch, cape, and staff.

  • The hat adds 10 hearts; the eyepatch gives 10 defense points; the cape gives 30. Defense reduces damage by 4% per point, capped at 80%.

  • The staff targets up to 200 blocks away and deals up to 50 damage within a 50-block radius, with damage falling off toward the edge. Its cast creates an explosion and a particle magic circle.

  • Get the items with /give @s kodari:megumin_hat, /give @s kodari:megumin_eyepatch, /give @s kodari:megumin_cape, and /give @s kodari:megumin_staff.

The pack currently uses vanilla icons rather than custom art. Texture generation is disabled for this project; enable it in Settings → Generation, or at https://kodari.ai/settings?tab=features. Custom 3D wearable models can be made in Kodari Studio (paid plans) and brought into this project through a workspace.

Ruku Kiso

Make the range upto 300 blocks and make the staff 3d

Kodari AI
KodariOct 6 at 8:38 am 1
  1. Increase the staff’s targeting range to 300 blocks.

  2. Check the staff’s item/model setup and make it 3D.

The staff now targets up to 300 blocks. I can’t create a 3D model directly in this project; make the staff model in Kodari Studio → 3D Models (available on paid plans), then bring it into this project through a workspace.

Ruku Kiso

https://skfb.ly/oAqOX use this link to get the staff model

Kodari AI
KodariOct 6 at 9:07 am 1

I can’t fetch the Sketchfab model directly into the project. If the creator allows downloads, download it and import it into Kodari Studio → 3D Models (available on paid plans), then bring it into this project through a workspace. Check the model’s license before using it.

Ruku Kiso

I'm done

Kodari AI
KodariOct 6 at 9:35 am 1

Great—the staff range is set to 300 blocks. For the 3D model, import the downloaded asset into Kodari Studio and add it to the project workspace.

Ruku Kiso

Ready the mod

Kodari AI
KodariOct 6 at 9:37 am 1
  1. Link the behavior pack to its resource pack so Bedrock loads both together.

  2. Add a small build script that bundles the packs into an importable .mcaddon.

The add-on is set up for packaging. Run python3 build_mcaddon.py to create MeguminItems.mcaddon, then open that file in Minecraft Bedrock to import both packs.

The staff’s 300-block range is unchanged. Its 3D model is not included—the Sketchfab asset hasn’t been imported, so the pack still uses placeholder icons. Create or import the model in Kodari Studio, then add it to the resource pack.

Ruku Kiso

No 3d staff needed prepare for export

Kodari AI
KodariOct 6 at 9:39 am 1

The add-on is ready to export without a 3D staff model. Run python3 build_mcaddon.py to create MeguminItems.mcaddon, then open it with Minecraft Bedrock to import it.

Ruku Kiso

Where is the compress option

Kodari AI
KodariOct 6 at 9:47 am 1

There isn’t a separate Compress button. The packaging script is in the project’s root as build_mcaddon.py. Run python3 build_mcaddon.py to create MeguminItems.mcaddon, then export or download that file.

Kodari can make mistakes. Review important code before using.
Files
behavior_pack
resource_pack
build_mcaddon.py
Code
11 331
behavior_pack/scripts/main.js
import { EquipmentSlot, system, world } from "@minecraft/server";

const HAT_ID = "kodari:megumin_hat";
const EYEPATCH_ID = "kodari:megumin_eyepatch";
const CAPE_ID = "kodari:megumin_cape";
const STAFF_ID = "kodari:megumin_staff";
const activeHealthBoosts = new Set();
const bypassedDamage = new Set();

function getEquipment(player) {
  return player.getComponent("minecraft:equippable");
}

system.runInterval(() => {
  for (const player of world.getAllPlayers()) {
    try {
      const equipment = getEquipment(player);
      const wearingHat = equipment?.getEquipment(EquipmentSlot.Head)?.typeId === HAT_ID;

      if (wearingHat) {
        player.addEffect("health_boost", 40, { amplifier: 4, showParticles: false });
        activeHealthBoosts.add(player.id);
      } else if (activeHealthBoosts.delete(player.id)) {
        player.removeEffect("health_boost");
      }
    } catch (error) {
      console.warn(`Could not update Megumin equipment for ${player.name}: ${error}`);
    }
  }
}, 20);

world.beforeEvents.entityHurt.subscribe((event) => {
  const player = event.hurtEntity;
  if (player.typeId !== "minecraft:player" || bypassedDamage.delete(player.id)) return;

  const equipment = getEquipment(player);
  let defense = 0;
  if (equipment?.getEquipment(EquipmentSlot.Feet)?.typeId === EYEPATCH_ID) defense += 10;
  if (equipment?.getEquipment(EquipmentSlot.Chest)?.typeId === CAPE_ID) defense += 30;
  if (defense === 0) return;

  event.cancel = true;
  const reducedDamage = event.damage * (1 - Math.min(defense * 0.04, 0.8));
  if (reducedDamage <= 0) return;

  const source = event.damageSource;
  const damageOptions = { cause: source.cause };
  if (source.damagingEntity) damageOptions.damagingEntity = source.damagingEntity;
  if (source.damagingProjectile) damageOptions.damagingProjectile = source.damagingProjectile;

  system.run(() => {
    bypassedDamage.add(player.id);
    try {
      player.applyDamage(reducedDamage, damageOptions);
    } catch (error) {
      console.warn(`Could not apply reduced damage to ${player.name}: ${error}`);
    } finally {
      system.runTimeout(() => bypassedDamage.delete(player.id), 1);
    }
  });
});

function spawnMagicCircle(dimension, center) {
  for (const radius of [2, 4]) {
    for (let i = 0; i < 64; i++) {
      const angle = (Math.PI * 2 * i) / 64;
      dimension.spawnParticle("minecraft:enchanting_table_particle", {
        x: center.x + Math.cos(angle) * radius,
        y: center.y + 0.15,
        z: center.z + Math.sin(angle) * radius,
      });
    }
  }

  for (let spoke = 0; spoke < 8; spoke++) {
    const angle = (Math.PI * 2 * spoke) / 8;
    for (let step = 0; step <= 12; step++) {
      const radius = 2 + (step / 12) * 2;
      dimension.spawnParticle("minecraft:enchanting_table_particle", {
        x: center.x + Math.cos(angle) * radius,
        y: center.y + 0.15,
        z: center.z + Math.sin(angle) * radius,
      });
    }
  }
}

world.afterEvents.itemUse.subscribe((event) => {
  if (event.itemStack.typeId !== STAFF_ID || event.source.typeId !== "minecraft:player") return;

  const player = event.source;
  const dimension = player.dimension;
  const view = player.getViewDirection();
  const rayHit = player.getBlockFromViewDirection({ maxDistance: 300 });
  const center = rayHit
    ? {
        x: rayHit.block.location.x + 0.5,
        y: rayHit.block.location.y + 0.5,
        z: rayHit.block.location.z + 0.5,
      }
    : {
        x: player.location.x + view.x * 300,
        y: player.location.y + view.y * 300,
        z: player.location.z + view.z * 300,
      };

  try {
    dimension.spawnParticle("minecraft:huge_explosion_emitter", center);
    dimension.playSound("random.explode", center, { volume: 2, pitch: 0.8 });
    spawnMagicCircle(dimension, center);
  } catch (error) {
    console.warn(`Could not create the staff's explosion effect: ${error}`);
  }

  for (const target of dimension.getEntities({ location: center, maxDistance: 50 })) {
    if (target.id === player.id || !target.getComponent("minecraft:health")) continue;

    const dx = target.location.x - center.x;
    const dy = target.location.y - center.y;
    const dz = target.location.z - center.z;
    const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
    const damage = 50 * (1 - distance / 50);
    if (damage <= 0) continue;

    try {
      target.applyDamage(damage, { cause: "magic", damagingEntity: player });
    } catch (error) {
      console.warn(`Could not damage entity ${target.typeId}: ${error}`);
    }
  }
});