Nicola Geyer

Create a comprehensive Minecraft Bedrock Add-on (Behavior and Resource Pack) that implements a complete economic and banking system with Swiss currency.

Here are the detailed specifications for the mod:

  1. CUSTOM CURRENCY (CHF):
  • Add custom money items representing all real Swiss Franc (CHF) coins and banknotes (e.g., 5 Rappen, 10 Rappen, 20 Rappen, 50 Rappen, 1 Franken, 2 Franken, 5 Franken, and notes like 10, 20, 50, 100, 200, 1000 CHF).
  • The money should look realistic yet fit the Minecraft aesthetic.
  1. ATM / BANKOMAT & VAULTS (TRESORE):
  • Recipe for the ATM: Complete left and right columns made of Iron Ingots, center-middle slot is a Glass Pane, bottom-middle slot is Redstone Dust.
  • Each player starts with 3 ATM items in their inventory.
  • When placed and interacted with, the ATM opens a UI with access to 2 types of vaults:

a) Server Vault: Contains infinite money. Players can withdraw money from it. b) Private Vault: Players can deposit and withdraw their own personal money safely. Other players cannot access private vaults.

  • Security / Rules for Server Vault:

- Withdrawal is only allowed if at least 2 players are currently online on the server. - Every time someone withdraws money from the Server Vault, a chat notification is instantly sent to ALL online players showing who withdrew how much.

  1. MONITOR / BILSCHIRM:
  • Recipe for the Monitor: Diamonds in the bottom-left and bottom-right corners, bottom-middle and the entire middle row made of Iron Ingots, top row made of Glass.
  • Each player starts with 2 monitor items.
  • Functionality: The monitor acts as a display screen showing:

- How much total money each player currently has / owns. - A live log history of who withdrew how much money and when. - Tax deduction details.

  1. AUTOMATIC TAX SYSTEM (STÜÜRÄ):
  • Every 20 In-game days, the system automatically runs a tax calculation.
  • It automatically deducts 5% of the money that a player has withdrawn from the Server Vault within the last 20 in-game days, and returns it back to the Server Vault.
  • If a player has no money left, their balance can go into negative numbers.
  • When taxes are processed, a chat message is broadcasted to everyone, and the screen/monitor updates to show who paid how much tax.

Please generate all necessary custom items, blocks (ATMs and Monitors), UI elements, and functions to make this fully functional in Minecraft Bedrock Edition.

Kodari AI
KodariSep 20 at 8:38 pm 1
SwissBankSystem
A complete Minecraft Bedrock economic add-on featuring Swiss Franc currency items (coins and banknotes), interactive ATM blocks with server and private vaults, monitor blocks displaying player balances and transaction logs, and an automatic 5% tax system that runs every 20 in-game days. Includes withdrawal notifications, multi-player server vault security, and realistic Swiss-themed item textures.

Place both folders in the world’s development_behavior_packs and development_resource_packs directories, or import them as packs and activate both together. Enable the Beta APIs / Script API experiment required by your Bedrock version.

Nicola Geyer

Please fix and update the previous Minecraft Bedrock Add-on (Behavior and Resource Pack). We need to simplify the crafting recipes so they are super easy to test and verify in-game:

  1. ATM / BANKOMAT RECIPE:
  • Change the crafting recipe so that a player can craft an ATM using 9 Dirt blocks (fill the entire 3x3 crafting grid completely with Dirt).
  1. MONITOR / BILDSCHIRM RECIPE:
  • Change the crafting recipe so that a player can craft a Monitor using 8 Dirt blocks in a ring shape—meaning fill the entire 3x3 crafting grid with Dirt, except for the exact center slot (leave the middle slot empty).
  1. STARTING ITEMS:
  • Keep the feature that players start with 3 ATMs and 2 Monitors in their inventory at the beginning (if possible), or ensure they are easily craftable with the new Dirt recipes.
  1. CORE MECHANICS TO KEEP:
  • Keep the custom CHF currency, the Server Vault (infinite money with online-player check and chat notification when withdrawing), the Private Vault, and the automatic 5% tax system every 20 in-game days.

Please generate the updated .mcaddon download file with these fixed crafting recipes.

Kodari AI
KodariSep 21 at 4:28 am 1
  1. Update the ATM and Monitor recipes to the requested Dirt patterns.

  2. Verify starting-item behavior and preserve the vault, withdrawal notification, currency, and tax mechanics.

  3. Package the updated Behavior and Resource Packs as a .mcaddon download archive.

Updated the add-on recipes:

  • ATM: 3×3 grid filled entirely with Dirt — 9 Dirt blocks.

  • Monitor: Dirt ring — 8 Dirt blocks with the center slot empty.

  • Starting items preserved: players receive 3 ATMs and 2 Monitors on their first spawn.

  • Core mechanics preserved: CHF currency, Server Vault, two-player withdrawal requirement, global withdrawal notifications, Private Vault, monitor logs, and 5% tax processing every 20 in-game days.

Updated files:

  • SwissBank_BP/recipes/atm.json

  • SwissBank_BP/recipes/monitor.json

Place both packs in the world and enable them together:

  • SwissBank_BP → Behavior Pack

  • SwissBank_RP → Resource Pack

The project is updated, but this environment cannot emit a binary .mcaddon archive directly. To create the importable file:

  1. Zip SwissBank_BP and rename it to SwissBank_BP.mcpack.

  2. Zip SwissBank_RP and rename it to SwissBank_RP.mcpack.

  3. Place both .mcpack files into one ZIP archive.

  4. Rename that archive to SwissBank.mcaddon.

  5. Open SwissBank.mcaddon with Minecraft Bedrock.

Kodari can make mistakes. Review important code before using.
Files
SwissBank_BP
SwissBank_RP
Code
26 1,011
SwissBank_BP/scripts/main.js
import { world, system, ItemStack } from "@minecraft/server";
import { ActionFormData, ModalFormData } from "@minecraft/server-ui";

const ATM_ID = "swissbank:atm";
const MONITOR_ID = "swissbank:monitor";
const STATE_KEY = "swissbank:state";
const TAX_DAY_KEY = "swissbank:last_tax_day";
const STARTER_TAG = "swissbank_starter";

const MONEY = {
  "swissbank:5_rappen": 5,
  "swissbank:10_rappen": 10,
  "swissbank:20_rappen": 20,
  "swissbank:50_rappen": 50,
  "swissbank:1_franken": 100,
  "swissbank:2_franken": 200,
  "swissbank:5_franken": 500,
  "swissbank:10_chf": 1000,
  "swissbank:20_chf": 2000,
  "swissbank:50_chf": 5000,
  "swissbank:100_chf": 10000,
  "swissbank:200_chf": 20000,
  "swissbank:1000_chf": 100000
};

const DENOMINATIONS = Object.entries(MONEY).sort((a, b) => b[1] - a[1]);
const interactionCooldown = new Map();

function emptyState() {
  return {
    players: {},
    logs: []
  };
}

function getState() {
  const raw = world.getDynamicProperty(STATE_KEY);

  if (typeof raw !== "string") {
    return emptyState();
  }

  try {
    const parsed = JSON.parse(raw);
    if (!parsed.players) parsed.players = {};
    if (!parsed.logs) parsed.logs = [];
    return parsed;
  } catch {
    return emptyState();
  }
}

function saveState(state) {
  world.setDynamicProperty(STATE_KEY, JSON.stringify(state));
}

function ensurePlayer(player, state) {
  if (!state.players[player.id]) {
    state.players[player.id] = {
      name: player.name,
      privateBalance: 0,
      withdrawnThisPeriod: 0,
      totalWithdrawn: 0,
      lastTax: 0,
      totalTax: 0
    };
  } else {
    state.players[player.id].name = player.name;
  }

  return state.players[player.id];
}

function formatChf(cents) {
  const sign = cents < 0 ? "-" : "";
  return `${sign}CHF ${(Math.abs(cents) / 100).toFixed(2)}`;
}

function parseChf(value) {
  const number = Number(String(value).replace(",", "."));

  if (!Number.isFinite(number) || number <= 0) {
    return 0;
  }

  return Math.round(number * 100);
}

function getInventory(player) {
  const component = player.getComponent("minecraft:inventory");
  return component ? component.container : undefined;
}

function getPhysicalBalance(player) {
  const inventory = getInventory(player);
  if (!inventory) return 0;

  let total = 0;

  for (let slot = 0; slot < inventory.size; slot++) {
    const item = inventory.getItem(slot);
    if (item && MONEY[item.typeId]) {
      total += MONEY[item.typeId] * item.amount;
    }
  }

  return total;
}

function giveMoney(player, cents) {
  const inventory = getInventory(player);
  if (!inventory || cents <= 0) return;

  let remaining = cents;

  for (const [typeId, value] of DENOMINATIONS) {
    const count = Math.floor(remaining / value);
    remaining %= value;

    let stacksRemaining = count;

    while (stacksRemaining > 0) {
      const stackSize = Math.min(stacksRemaining, 64);
      const item = new ItemStack(typeId, stackSize);
      const leftover = inventory.addItem(item);

      if (leftover && leftover.amount > 0) {
        player.dimension.spawnItem(leftover, player.location);
      }

      stacksRemaining -= stackSize;
    }
  }
}

function removePhysicalMoney(player) {
  const inventory = getInventory(player);
  if (!inventory) return 0;

  let total = 0;

  for (let slot = 0; slot < inventory.size; slot++) {
    const item = inventory.getItem(slot);

    if (!item || !MONEY[item.typeId]) continue;

    total += MONEY[item.typeId] * item.amount;
    inventory.setItem(slot, undefined);
  }

  return total;
}

function addLog(state, entry) {
  state.logs.push({
    ...entry,
    day: world.getDay(),
    time: world.getTimeOfDay()
  });

  if (state.logs.length > 50) {
    state.logs.splice(0, state.logs.length - 50);
  }
}

function showNotice(player, title, body) {
  new ActionFormData()
    .title(title)
    .body(body)
    .button("Close")
    .show(player)
    .catch(() => {});
}

function askAmount(player, title, callback) {
  new ModalFormData()
    .title(title)
    .textField("Amount in CHF", "Example: 25.50", "10")
    .show(player)
    .then((response) => {
      if (response.canceled) return;
      callback(parseChf(response.formValues[0]));
    })
    .catch(() => {});
}

function serverWithdraw(player) {
  const onlinePlayers = world.getPlayers().length;

  if (onlinePlayers < 2) {
    showNotice(
      player,
      "Server Vault Locked",
      "At least 2 players must be online before money can be withdrawn from the Server Vault."
    );
    return;
  }

  askAmount(player, "Withdraw from Server Vault", (amount) => {
    if (amount <= 0) {