Harvey Byrne

Teleport Staff Moderate build Adds a staff that teleports the user on use, deals instant damage, and calls lightning on enemies.

Teleport Staff · Right-click to teleport to the targeted block location.

One-Hit Kill · Attacks with the staff instantly defeat any target.

Lightning Strike · Summons lightning on enemies, dealing damage but not to the user. Make it a Minecraft mod for bedrock mobile

Kodari AI
KodariSep 11 at 7:45 pm 1
TeleportStaffMod
Adds a craftable Teleport Staff to Minecraft Bedrock. Right-clicking the staff teleports the player to the targeted block location. Attacking mobs with the staff instantly defeats them with a one-hit kill mechanic. Additionally, striking enemies summons a lightning bolt that damages the target without harming the user. The staff has durability and can be repaired. Crafted with an ender pearl, blaze rod, and diamond in a vertical pattern. Fully compatible with Fabric 26.2, featuring custom textures, recipes, and enchantment support.

I’ll build this as a Bedrock mobile add-on rather than a Fabric Java mod, since Fabric mods cannot run on Bedrock. It will include a custom teleport staff, targeted-block teleportation, instant-kill attacks, and lightning strikes that exclude the wielder.

Created a Bedrock mobile add-on with:

  • Teleport Staff

    • Crafted with an ender pearl, diamond, and blaze rod.

    • Use while looking at a block within 64 blocks to teleport.

    • Prevents teleporting into occupied spaces.

  • One-Hit Kill

    • Hitting any entity with the staff instantly defeats it.

  • Lightning Strike

    • Summons lightning at defeated targets.

    • Grants the wielder temporary protection from the lightning.

  • Resource pack

    • Includes the staff name and blaze-rod-based icon.

Import both folders as behavior/resource packs into a Bedrock world, then craft the staff in a crafting table.

Kodari can make mistakes. Review important code before using.
Files
behavior_packs
resource_packs
Code
7 234
behavior_packs/kodari_staff/scripts/main.js
import { EquipmentSlot, system, world } from "@minecraft/server";

const STAFF_ID = "kodari:teleport_staff";
const MAX_TELEPORT_DISTANCE = 64;

function isStaff(itemStack) {
  return itemStack?.typeId === STAFF_ID;
}

function getMainHandItem(entity) {
  const equippable = entity.getComponent("minecraft:equippable");
  return equippable?.getEquipment(EquipmentSlot.Mainhand);
}

function notify(player, message) {
  player.sendMessage(`§d[Teleport Staff]§r ${message}`);
}

function useTeleportStaff(player) {
  const hit = player.getBlockFromViewDirection({
    maxDistance: MAX_TELEPORT_DISTANCE,
    includeLiquidBlocks: false,
    includePassableBlocks: false
  });

  if (!hit) {
    notify(player, "Look at a block within 64 blocks.");
    return;
  }

  const destination = {
    x: hit.block.location.x + 0.5,
    y: hit.block.location.y + 1,
    z: hit.block.location.z + 0.5
  };
  const blockX = Math.floor(destination.x);
  const blockY = Math.floor(destination.y);
  const blockZ = Math.floor(destination.z);
  const feetBlock = player.dimension.getBlock({ x: blockX, y: blockY, z: blockZ });
  const headBlock = player.dimension.getBlock({ x: blockX, y: blockY + 1, z: blockZ });

  if (!feetBlock?.isAir || !headBlock?.isAir) {
    notify(player, "There is not enough room to teleport there.");
    return;
  }

  try {
    player.teleport(destination, {
      dimension: player.dimension,
      keepVelocity: false,
      rotation: player.getRotation()
    });
    player.dimension.playSound("mob.endermen.portal", destination);
    notify(player, "Teleported.");
  } catch {
    notify(player, "That location cannot be reached.");
  }
}

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

  event.cancel = true;
  system.run(() => useTeleportStaff(event.source));
});

world.afterEvents.entityHitEntity.subscribe((event) => {
  const attacker = event.damagingEntity;
  const target = event.hitEntity;

  if (attacker.typeId !== "minecraft:player" || !isStaff(getMainHandItem(attacker))) {
    return;
  }

  if (target.id === attacker.id) {
    return;
  }

  const strikeLocation = {
    x: target.location.x,
    y: target.location.y,
    z: target.location.z
  };

  system.run(() => {
    try {
      target.kill();
    } catch {
      try {
        target.applyDamage(10000);
      } catch {
        return;
      }
    }

    try {
      attacker.addEffect("resistance", 10, {
        amplifier: 255,
        showParticles: false
      });
      attacker.dimension.spawnEntity("minecraft:lightning_bolt", strikeLocation);
      notify(attacker, "Target eliminated by lightning.");
    } catch {
      notify(attacker, "Target eliminated.");
    }
  });
});