Alix

Build the Minecraft Mob Fusion Lab mod. Edition: Bedrock Edition. Choose the appropriate mod development approach for this edition. Include a functional lab starting area, two input tubes, fusion mechanics, and fused discoveries excluded from the Creative inventory.Also make models for the fused mobs the player/you makes

Kodari AI
KodariOct 10 at 3:24 am 1
MobFusionLab
MobFusionLab is a Bedrock Edition mod that adds a functional fusion laboratory to Minecraft. Players construct a lab with a central fusion chamber and two input tubes, where they place two different mobs to trigger a fusion process. The mod includes custom fusion mechanics with a progress bar and particle effects, producing unique fused creatures with combined abilities and appearances. All fused discoveries are excluded from the Creative inventory, only obtainable through the fusion process. The mod features custom 3D models for every possible fusion combination, along with custom behaviors, sounds, and animations for each fused mob. Players can experiment with different mob pairings to discover over 20 unique fusion results, each with distinct traits and combat capabilities.

I’ll create a Bedrock behavior/resource pack with an auto-built lab, two sample tubes, and script-driven fusion. Custom fused-mob models need to be made in Kodari Studio and brought in through a workspace; this addon will use vanilla mob appearances meanwhile.

  1. Add linked Bedrock behavior and resource packs.

  2. Define the lab core, input tubes, and DNA sample items.

  3. Add the starter-area setup and fusion logic; discoveries will only spawn through fusion, not from Creative inventory.

Created a Bedrock Edition add-on targeting 1.21.80+: it builds a starter lab, lets players load DNA samples into two input tubes, and spawns a named fusion discovery when they activate the core. Discoveries are created by the fusion script, not added to Creative inventory.

Fused mobs currently use vanilla appearances. Create custom models in Kodari Studio, then bring them into this project through a workspace.

Kodari can make mistakes. Review important code before using.
Files
behavior_pack
resource_pack
Code
14 389
behavior_pack/scripts/main.js
import { world } from "@minecraft/server";

const sampleKinds = {
  "mobfusion:cow_sample": "Cow",
  "mobfusion:pig_sample": "Pig",
  "mobfusion:chicken_sample": "Chicken",
  "mobfusion:slime_sample": "Slime",
  "mobfusion:fox_sample": "Fox"
};

const discoveries = {
  "Chicken|Fox": { type: "minecraft:fox", name: "Fowl Fox" },
  "Chicken|Slime": { type: "minecraft:slime", name: "Cluck Slime" },
  "Cow|Pig": { type: "minecraft:mooshroom", name: "Moo-Pork" },
  "Cow|Slime": { type: "minecraft:slime", name: "Jelly Cow" },
  "Pig|Slime": { type: "minecraft:magma_cube", name: "Magma Hog" }
};

const tubeContents = new Map();
let starterLabBuilt = false;

function blockKey(block) {
  const { x, y, z } = block.location;
  return `${block.dimension.id}:${x},${y},${z}`;
}

function consumeSelectedItem(player) {
  const inventory = player.getComponent("minecraft:inventory")?.container;
  if (!inventory) return false;

  const slot = player.selectedSlotIndex;
  const item = inventory.getItem(slot);
  if (!item) return false;

  if (item.amount > 1) {
    item.amount -= 1;
    inventory.setItem(slot, item);
  } else {
    inventory.setItem(slot, undefined);
  }
  return true;
}

function buildStarterLab(player) {
  if (starterLabBuilt) return;
  starterLabBuilt = true;

  const dimension = player.dimension;
  const centerX = Math.floor(player.location.x) + 4;
  const centerZ = Math.floor(player.location.z) + 4;
  const floorY = Math.floor(player.location.y) - 1;
  const labY = floorY + 1;

  for (let x = centerX - 3; x <= centerX + 3; x++) {
    for (let z = centerZ - 3; z <= centerZ + 3; z++) {
      const edge = Math.abs(x - centerX) === 3 || Math.abs(z - centerZ) === 3;
      dimension.getBlock({ x, y: floorY, z })?.setType(edge ? "minecraft:polished_andesite" : "minecraft:stone_bricks");
    }
  }

  dimension.getBlock({ x: centerX - 3, y: labY, z: centerZ - 3 })?.setType("minecraft:glowstone");
  dimension.getBlock({ x: centerX + 3, y: labY, z: centerZ - 3 })?.setType("minecraft:glowstone");
  dimension.getBlock({ x: centerX - 3, y: labY, z: centerZ + 3 })?.setType("minecraft:glowstone");
  dimension.getBlock({ x: centerX + 3, y: labY, z: centerZ + 3 })?.setType("minecraft:glowstone");

  dimension.getBlock({ x: centerX - 1, y: labY, z: centerZ })?.setType("mobfusion:input_tube");
  dimension.getBlock({ x: centerX + 1, y: labY, z: centerZ })?.setType("mobfusion:input_tube");
  dimension.getBlock({ x: centerX, y: labY, z: centerZ + 1 })?.setType("mobfusion:lab_core");

  player.sendMessage("§aMob Fusion Lab initialized. Insert DNA samples into both glass tubes, then activate the red core.");
}

function insertSample(event) {
  const { block, player, itemStack } = event;
  if (block.typeId !== "mobfusion:input_tube" || !itemStack) return;

  const sample = sampleKinds[itemStack.typeId];
  if (!sample) return;

  const key = blockKey(block);
  if (tubeContents.has(key)) {
    player.sendMessage("§eThis tube already contains a sample.");
    return;
  }

  if (!consumeSelectedItem(player)) return;
  tubeContents.set(key, sample);
  player.sendMessage(`§b${sample} DNA loaded into the input tube.`);
}

function activateCore(event) {
  const { block, player } = event;
  if (block.typeId !== "mobfusion:lab_core") return;

  const { x, y, z } = block.location;
  const leftTube = block.dimension.getBlock({ x: x - 1, y, z: z - 1 });
  const rightTube = block.dimension.getBlock({ x: x + 1, y, z: z - 1 });
  if (leftTube?.typeId !== "mobfusion:input_tube" || rightTube?.typeId !== "mobfusion:input_tube") {
    player.sendMessage("§cThe core needs one input tube on each side, one block behind it.");
    return;
  }

  const leftKey = blockKey(leftTube);
  const rightKey = blockKey(rightTube);
  const first = tubeContents.get(leftKey);
  const second = tubeContents.get(rightKey);
  if (!first || !second) {
    player.sendMessage("§eLoad a DNA sample into both tubes before fusing.");
    return;
  }

  const pair = [first, second].sort();
  const recipeKey = `${pair[0]}|${pair[1]}`;
  const discovery = discoveries[recipeKey] ?? {
    type: "minecraft:slime",
    name: `${pair[0]}-${pair[1]} Fusion`
  };

  try {
    const fused = block.dimension.spawnEntity(discovery.type, { x: x + 0.5, y: y + 1, z: z + 0.5 });
    fused.nameTag = `§d${discovery.name}`;
    tubeContents.delete(leftKey);
    tubeContents.delete(rightKey);
    player.sendMessage(`§dDiscovery created: ${discovery.name}!`);
  } catch {
    player.sendMessage("§cFusion failed here. Clear the space above the core and try again.");
  }
}

world.afterEvents.playerSpawn.subscribe((event) => {
  if (event.initialSpawn) buildStarterLab(event.player);
});

world.afterEvents.playerInteractWithBlock.subscribe((event) => {
  insertSample(event);
  activateCore(event);
});