Free fire Vishu

Minecraft Bedrock Edition Add-on: Miner Villager

Create a fully functional Minecraft Bedrock Edition mobile add-on named Miner Villager. The add-on must work on Android and use Minecraft Bedrock's supported behavior packs, resource packs, entity JSON, animations, and Script API where necessary.

Use this YouTube video as general inspiration for the idea of villagers working for the player:

  1. Miner Villager

Add a new entity named Miner Villager with its own spawn egg.

Appearance and texture

  • Design a custom Minecraft-style villager that resembles Steve.
  • Give him Steve-like blue clothing, miner overalls, work boots, a mining helmet with a lamp, and a pickaxe accessory.
  • Use a custom texture, model, animations, and sounds where supported.
  • Make him look like a Minecraft character, not a realistic human.
  • Give him a unique name tag and distinguishable appearance.

Work commands

The Miner Villager must respond to these player interactions:

  • Work for Me: Open a work menu.
  • Start Work: Begin the selected job.
  • Stop Work: Stop the current job.
  • Upgrade Level: Upgrade when the required materials and conditions are met.
  • Collect Items: Transfer collected resources to the player.

Use an in-game interaction menu or a reliable Bedrock-compatible alternative if custom chat commands are not practical.

Payment system

Before starting a job, the player must pay the Miner Villager with Iron Ingots.

Suggested starting payment:

  • Level 1: 3 Iron Ingots
  • Level 2: 5 Iron Ingots
  • Level 3: 8 Iron Ingots
  • Level 4: 12 Iron Ingots
  • Level 5: 16 Iron Ingots

Consume the payment only after checking that the player has enough Iron Ingots. Show a message when payment succeeds or when the player lacks the required materials.

  1. Five Miner Villager Levels

Level 1 — Beginner Miner

  • Collect nearby logs, wood, and basic stone resources.
  • Gather common resources within a configurable work area.
  • Return collected items to a personal inventory.
  • Show progress toward the next level.

Level 2 — Iron Miner

  • Mine suitable exposed iron ore and collect iron-related resources.
  • Gather coal and common underground resources.
  • Require the player to provide the necessary tools or materials when needed.

Level 3 — Advanced Miner

  • Search for additional ores, including copper, gold, and redstone.
  • Use a configurable mining area.
  • Avoid lava, deep drops, and other dangerous terrain.
  • Report when the work area is exhausted or unsafe.

Level 4 — Expert Miner

  • Prioritize valuable resources such as diamonds and lapis lazuli when accessible.
  • Use more efficient resource-gathering priorities.
  • Carry a larger inventory or deposit items in a designated storage chest.
  • Require suitable equipment and an appropriate upgrade payment.

Level 5 — Master Miner

  • Provide the most advanced resource-gathering behavior supported by Bedrock Edition.
  • Prioritize resources selected by the player.
  • Support a configurable work zone and storage destination.
  • Display a Master Miner title and special visual effects.

Level progression

  • Earn experience by completing jobs and delivering resources.
  • Show the current level and progress toward the next level.
  • Require both the specified experience and Iron Ingots to upgrade.
  • Save the villager's level, experience, inventory, job settings, and owner between sessions.
  • Prevent duplicate rewards, lost payments, and accidental repeated upgrades.
  1. Safe and Realistic Mining AI

The Miner Villager should behave like a working Minecraft NPC.

  • Walk to the selected work area.
  • Locate suitable blocks and perform supported mining actions.
  • Collect resources only when the game mechanics permit.
  • Return to the player or assigned storage when its inventory is full.
  • Stop when the job is complete, payment runs out if applicable, or the player issues Stop Work.
  • Avoid destroying the player's house, chests, farms, or protected blocks.
  • Do not break blocks outside the authorized work zone.
  • Provide status messages such as “Searching for ores,” “Mining in progress,” and “Returning to storage.”

Important: Do not simply teleport items into the player's inventory. Implement actual supported entity behavior and block interaction wherever possible. If fully autonomous mining is restricted by Bedrock's APIs, implement the closest functional alternative and clearly explain its limitations.

  1. Hunter Villager

Add a second custom entity called Hunter Villager, with its own spawn egg and custom texture.

Appearance

  • Give him a Steve-inspired outfit with green and brown clothing, a backpack, and explorer accessories.
  • Use a distinct color scheme so players can easily tell him apart from the Miner Villager.

Command: Hunt for Me

When the player interacts with the Hunter Villager, provide a Hunt for Me option.

  • Allow the player to select a hunting area.
  • Let the Hunter search for supported wild animals and collect their ordinary drops through legitimate game mechanics.
  • Allow the player to select which eligible animals to search for.
  • Make him return collected items to the player or assigned storage.
  • Add Start Hunting, Stop Hunting, and Collect Items options.
  • Prevent hunting inside protected areas or near the player's designated pets.
  • Save the hunter's owner, settings, and progress.
  • Show messages such as “Searching for animals,” “Hunting complete,” and “Returning with supplies.”
  1. Spawn Eggs and Creative Inventory

Add two separate spawn eggs:

  1. Miner Villager Spawn Egg
  2. Hunter Villager Spawn Egg

Both must have unique names, distinguishable icons, proper entity identifiers, and working spawn behavior. Make them available in the Creative inventory and ensure their textures load correctly.

  1. User Interface

Create a simple Minecraft-style menu for both villagers.

For Miner Villager, show:

  • Villager name
  • Current level
  • Experience progress
  • Iron payment required
  • Job selection
  • Work area selection
  • Start Work and Stop Work
  • Inventory and Collect Items
  • Upgrade Level

For Hunter Villager, show:

  • Hunting status
  • Hunting area
  • Eligible target selection
  • Start Hunting and Stop Hunting
  • Inventory and Collect Items

Use clear English labels and simple, mobile-friendly controls.

  1. Technical Requirements
  • Target Minecraft Bedrock Edition on Android mobile.
  • Use compatible behavior-pack and resource-pack formats.
  • Include valid manifest files, UUIDs, entity definitions, textures, animations, and scripts where needed.
  • Use stable, supported APIs for the selected Minecraft version.
  • Avoid Java Edition-only code, Forge, and Fabric.
  • Include appropriate permissions and dependencies.
  • Preserve villager data after the world is saved and reloaded.
  • Avoid excessive CPU usage and limit scanning to the assigned work area.
  • Do not claim a feature works unless it has been implemented and tested.
  1. Required Deliverables

Create the complete add-on project, not just a concept or sample code.

Provide:

  1. The complete Behavior Pack.
  2. The complete Resource Pack.
  3. All custom entity textures and required assets.
  4. All entity JSON files and scripts.
  5. A properly configured manifest for each pack.
  6. A ready-to-import ".mcaddon" file if supported by your tools.
  7. Installation instructions for Minecraft Bedrock on Android.
  8. A feature checklist identifying what works, what has been tested, and any API limitations.

Before finishing, validate the JSON files, verify that both spawn eggs work, test the payment and leveling systems, and check that the villagers' saved data persists after restarting the world.

Final goal: Create a playable Minecraft Bedrock mobile add-on in which the player hires a Steve-inspired Miner Villager to gather resources through five progression levels and a separate Hunter Villager to collect eligible animal drops. Both NPCs must have their own spawn eggs, working commands, payment or job settings, and persistent progress.

Kodari AI
KodariOct 12 at 5:25 am 13
MinerHunterVillagers
Creates two custom Bedrock Edition villager NPCs with spawn eggs: a Steve-inspired Miner Villager with five progression levels, iron ingot payment system, configurable work zones, and autonomous block mining; plus a Hunter Villager that searches for eligible animals and collects drops. Both feature custom textures, models, animations, interaction menus, persistent data storage, and mobile-friendly UI controls. Includes complete behavior and resource packs with manifests, entity JSONs, and Script API implementations for job management, inventory collection, leveling, and world-save persistence.
  1. Build the Bedrock behavior/resource pack foundation and Miner Villager.

  2. Add the Hunter Villager, shared menus, persistence, and spawn eggs.

  3. Include mobile installation steps and clearly document API and mining limitations.

1. Miner Villager foundation

I’m creating the two Bedrock packs, a persistent worker inventory, paid work sessions, level-up checks, configurable scan radius, and the Miner’s custom assets. Scripted block gathering is explicitly bounded and conservative; it cannot reproduce vanilla tool durability or loot calculations.

3. Packaging notes and verification status

I’m adding custom humanoid geometry and Android setup notes. I can’t run Minecraft Bedrock or produce a ZIP archive here, so the notes will separate implemented behavior from untested behavior and API limits.

Created the unpacked Bedrock add-on project with Behavior and Resource Packs, both villagers, menus, recipes, custom textures, geometry, and idle animations. Android setup steps are in README.md.

Survival recipes

  • Miner Villager Spawn Egg: 1 egg + 3 iron ingots + 1 coal.

  • Hunter Villager Spawn Egg: 1 egg + 3 bones + 2 string.

  • Both eggs are also in the Creative Nature inventory.

Implemented, but not Bedrock-tested: Miner payments, pickaxe checks, work modes, bounded gathering, XP and upgrades; Hunter target and radius selection, melee/pickup behaviors, and manual item collection. Villager settings and inventories are designed to persist with the entities, but persistence has not been verified across a world restart.

Limitations: Miner gathering removes whitelisted exposed blocks and adds mapped items; it does not use vanilla mining loot or tool durability, and it cannot guarantee protection for every player-built structure. Neither villager has automatic return or chest storage. Custom sounds are not included. I could not launch Bedrock to validate pack imports, JSON schemas, menus, or AI behavior, and this environment cannot package a .mcaddon; the project contains the two pack folders instead.

Kodari can make mistakes. Review important code before using.
Files
MinerVillager_BP
MinerVillager_RP
README.md
Code
24 1,095
MinerVillager_BP/scripts/main.js
import "./hunter.js";
import { ItemStack, system, world } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";

const MINER = "minerworks:miner_villager";
const IRON_COST = [0, 3, 5, 8, 12, 16];
const UPGRADE_COST = [0, 5, 8, 12, 16, 0];
const LEVEL_XP = [0, 0, 25, 75, 150, 250];
const PICKAXES = ["", "minecraft:wooden_pickaxe", "minecraft:stone_pickaxe", "minecraft:iron_pickaxe", "minecraft:diamond_pickaxe", "minecraft:netherite_pickaxe"];
const RADII = [6, 10, 14];
const MODES = ["Balanced", "Wood & Stone", "Ore Priority"];
const PROTECTED_BLOCKS = new Set([
  "minecraft:chest", "minecraft:trapped_chest", "minecraft:barrel",
  "minecraft:crafting_table", "minecraft:furnace", "minecraft:blast_furnace", "minecraft:smoker",
  "minecraft:farmland", "minecraft:wheat", "minecraft:carrots", "minecraft:potatoes", "minecraft:beetroots",
  "minecraft:oak_door", "minecraft:spruce_door", "minecraft:birch_door", "minecraft:jungle_door",
  "minecraft:acacia_door", "minecraft:dark_oak_door", "minecraft:mangrove_door", "minecraft:cherry_door",
  "minecraft:bed"
]);
const ORE_DROPS = [
  { suffix: "coal_ore", minLevel: 2, item: "minecraft:coal", amount: 1 },
  { suffix: "iron_ore", minLevel: 2, item: "minecraft:raw_iron", amount: 1 },
  { suffix: "copper_ore", minLevel: 3, item: "minecraft:raw_copper", amount: 1 },
  { suffix: "gold_ore", minLevel: 3, item: "minecraft:raw_gold", amount: 1 },
  { suffix: "redstone_ore", minLevel: 3, item: "minecraft:redstone", amount: 4 },
  { suffix: "lapis_ore", minLevel: 4, item: "minecraft:lapis_lazuli", amount: 4 },
  { suffix: "diamond_ore", minLevel: 4, item: "minecraft:diamond", amount: 1 }
];

world.afterEvents.playerInteractWithEntity.subscribe(({ player, target }) => {
  if (target.typeId !== MINER) return;
  const owner = target.getDynamicProperty("owner");
  if (typeof owner === "string" && owner !== player.id) {
    player.sendMessage("This Miner Villager belongs to another player.");
    return;
  }
  if (typeof owner !== "string") target.setDynamicProperty("owner", player.id);
  refreshName(target);
  showMinerMenu(player, target);
});

function levelOf(entity) {
  return Math.max(1, Math.min(5, Number(entity.getDynamicProperty("level") ?? 1)));
}

function xpOf(entity) {
  return Math.max(0, Number(entity.getDynamicProperty("xp") ?? 0));
}

function refreshName(entity) {
  const level = levelOf(entity);
  entity.nameTag = level === 5 ? "Master Miner | Level 5" : `Miner Villager | Level ${level}`;
}

function inventoryOf(entity) {
  return entity.getComponent("minecraft:inventory")?.container;
}

function playerInventory(player) {
  return player.getComponent("minecraft:inventory")?.container;
}

function itemCount(container, typeId) {
  if (!container) return 0;
  let total = 0;
  for (let slot = 0; slot < container.size; slot++) {
    const item = container.getItem(slot);
    if (item?.typeId === typeId) total += item.amount;
  }
  return total;
}

function consumeItem(container, typeId, count) {
  for (let slot = 0; slot < container.size && count > 0; slot++) {
    const item = container.getItem(slot);
    if (item?.typeId !== typeId) continue;
    const removed = Math.min(count, item.amount);
    count -= removed;
    if (removed === item.amount) container.setItem(slot, undefined);
    else {
      item.amount -= removed;
      container.setItem(slot, item);
    }
  }
}

function hasPickaxe(container, level) {
  return !PICKAXES[level] || itemCount(container, PICKAXES[level]) > 0;
}

function showMinerMenu(player, entity) {
  if (!entity.isValid) return;
  const level = levelOf(entity);
  const xp = xpOf(entity);
  const next = level < 5 ? LEVEL_XP[level + 1] : LEVEL_XP[5];
  const required = IRON_COST[level];
  const radius = Number(entity.getDynamicProperty("radius") ?? RADII[0]);
  const mode = Number(entity.getDynamicProperty("mode") ?? 0);
  const working = entity.getDynamicProperty("working") === true;
  const status = String(entity.getDynamicProperty("status") ?? "Idle");
  const progress = level < 5 ? `${xp}/${next} XP` : `${xp} XP (maximum level)`;
  const form = new ActionFormData()
    .title(level === 5 ? "Master Miner" : "Miner Villager")
    .body(`Level: ${level}\nExperience: ${progress}\nWork payment: ${required} Iron Ingots\nWork area: ${radius} blocks\nJob: ${MODES[mode]}\nStatus: ${status}`)
    .button(working ? "Stop Work" : "Start Work")
    .button("Change Work Area")
    .button("Select Job")
    .button("Collect Items")
    .button("Upgrade Level")
    .button("Close");

  form.show(player).then((response) => {
    if (response.canceled || !entity.isValid || response.selection === undefined) return;
    if (response.selection === 0) {
      if (entity.getDynamicProperty("working") === true) stopWork(player, entity, "Work stopped.");
      else startWork(player, entity);
    } else if (response.selection === 1) {
      const current = Number(entity.getDynamicProperty("radius") ?? RADII[0]);
      const index = RADII.indexOf(current);
      const nextRadius = RADII[(index + 1 + RADII.length) % RADII.length];
      entity.setDynamicProperty("radius", nextRadius);
      player.sendMessage(`Work area radius set to ${nextRadius} blocks. Start work again to center it here.`);
    } else if (response.selection === 2) {
      const mode = Number(entity.getDynamicProperty("mode") ?? 0);
      const nextMode = (mode + 1) % MODES.length;
      entity.setDynamicProperty("mode", nextMode);
      player.sendMessage(`Miner job set to ${MODES[nextMode]}.`);
    } else if (response.selection === 3) {
      collectItems(player, entity);
    } else if (response.selection === 4) {
      upgradeLevel(player, entity);
    } else {
      return;
    }
    showMinerMenu(player, entity);
  });
}

function startWork(player, entity) {
  const level = levelOf(entity);
  const inventory = playerInventory(player);
  const cost = IRON_COST[level];
  if (!inventory) {
    player.sendMessage("Your inventory is unavailable; no payment was taken.");
    return;
  }
  if (!hasPickaxe(inventory, level)) {
    player.sendMessage(`Bring a ${PICKAXES[level].replace("minecraft:", "").replaceAll("_", " ")} to start this job. No payment was taken.`);
    return;
  }
  if (itemCount(inventory, "minecraft:iron_ingot") < cost) {
    player.sendMessage(`You need ${cost} Iron Ingots to start. No payment was taken.`);
    return;
  }

  consumeItem(inventory, "minecraft:iron_ingot", cost);
  const location = entity.location;
  entity.setDynamicProperty("ox", Math.floor(location.x));
  entity.setDynamicProperty("oy", Math.floor(location.y));
  entity.setDynamicProperty("oz", Math.floor(location.z));
  entity.setDynamicProperty("cursor", 0);
  entity.setDynamicProperty("working", true);
  entity.setDynamicProperty("status", "Searching for resources");
  player.sendMessage(`Payment accepted: ${cost} Iron Ingots. Searching for resources.`);
}

function stopWork(player, entity, message) {
  entity.setDynamicProperty("working", false);
  entity.setDynamicProperty("status", "Idle");
  player.sendMessage(message);
}

function upgradeLevel(player, entity) {
  const level = levelOf(entity);
  if (level >= 5) {
    player.sendMessage("This Miner Villager is already at Master level.");
    return;
  }
  const requiredXp = LEVEL_XP[level + 1];
  const iron = UPGRADE_COST[level];
  const inventory = playerInventory(player);
  if (xpOf(entity) < requiredXp) {
    player.sendMessage(`Level ${level + 1} requires ${requiredXp} total XP.`);
    return;
  }
  if (!inventory || itemCount(inventory, "minecraft:iron_ingot") < iron) {
    player.sendMessage(`Level ${level + 1} requires ${iron} Iron Ingots. No payment was taken.`);
    return;
  }
  consumeItem(inventory, "minecraft:iron_ingot", iron);
  entity.setDynamicProperty("level", level + 1);
  entity.setDynamicProperty("working", false);
  entity.setDynamicProperty("status", "Idle");
  refreshName(entity);
  player.sendMessage(`Upgrade complete: ${entity.nameTag}. Paid ${iron} Iron Ingots.`);
}

function collectItems(player, entity) {
  const source = inventoryOf(entity);
  const destination = playerInventory(player);