Bedrock Energistics Core

APIs for creating tech add-ons for Minecraft: Bedrock Edition.

Bedrock Energistics Core handles the parts every tech add-on would otherwise have to build for itself — networks, storage, machine UI — so that machines from separate add-ons can be placed side by side and work together.


Features

Works Together

Machines using these APIs work with each other even if they're from different add-ons.

// Add-on A defines a storage type, then fills
// the network with it.
registerStorageType({
  id: "example:steam",
  category: StandardStorageCategory.Gas,
  texture: "steam",
  name: "steam",
});

generate(block, "example:steam", 10);
// Add-on B consumes it. No shared code and no
// dependency between them, just the same ID.
const steam = getMachineStorage(block, "example:steam");

if (steam >= STEAM_PER_OPERATION) {
  setMachineStorage(
    block,
    "example:steam",
    steam - STEAM_PER_OPERATION
  );
}

Machine UI

Easily create machine UI.

A Basic Refinery machine screen with energy and oil storage bars, a progress arrow, and an output slot
Screenshot from Bedrock Energistics.
registerMachine({
  description: {
    id: "example:basic_refinery",
    ui: {
      elements: {
        // A storage bar takes four slots, so the
        // next one starts four slots later.
        energyBar: {
          type: "storageBar",
          startIndex: 0,
          defaults: { type: "energy" },
        },
        oilBar: {
          type: "storageBar",
          startIndex: 4,
          defaults: { type: "oil" },
        },
        progressArrow: {
          type: "progressIndicator",
          indicator: "arrow",
          index: 8,
        },
        outputSlot: {
          type: "itemSlot",
          slotId: 0,
          index: 9,
        },
      },
    },
  },
  // ...
});

Simple

Simple APIs for basic machines, while still having more powerful APIs for more complicated machines.

// A working generator, in three lines.
export const passiveGeneratorComponent = {
  onTick({ block }) {
    generate(block, "energy", 2);
  },
};
// And the full APIs when a machine needs them.
export const itemSpawnerComponent = {
  onTick({ block }) {
    const energy = getMachineStorage(block, "energy");
    if (energy < ENERGY_CONSUMPTION) return;

    const spawnLoc = Vector3Utils.add(block.location, VECTOR3_UP);
    block.dimension.spawnItem(new ItemStack("example:item"), spawnLoc);

    setMachineStorage(block, "energy", energy - ENERGY_CONSUMPTION);
  },
};

Marketplace Creators

Marketplace creators using Bedrock Energistics Core.

Featured Content

Featured add-ons, worlds, and other content using Bedrock Energistics Core.