Skip to main content

Understand the Project Structure

The template is intentionally larger than one machine example. A working UtilityCraft extension needs both packs, shared libraries, addon-owned scripts, resource definitions, UI routing, and validation tools.

Root structure​

UtilityCraft-Addon-Template/
β”œβ”€β”€ BP/ Behavior Pack source
β”œβ”€β”€ RP/ Resource Pack source
β”œβ”€β”€ data/ Regolith project data
β”œβ”€β”€ docs/ Template-specific implementation notes
β”œβ”€β”€ tools/ Build and validation scripts
β”œβ”€β”€ types/ Editor types for public libraries
β”œβ”€β”€ build/ Generated complete pack exports
β”œβ”€β”€ dist/ Generated script-only bundle
β”œβ”€β”€ config.json Regolith project and profiles
β”œβ”€β”€ jsconfig.json JavaScript checking and import aliases
β”œβ”€β”€ package.json Validation and bundle commands
└── README.md Repository overview

Edit source files under BP, RP, and the relevant root configuration. Do not edit generated output under build, dist, or .regolith; the next build can replace it.

Behavior Pack​

BP/
β”œβ”€β”€ blocks/ Block definitions
β”œβ”€β”€ entities/ Machine helpers, resources, and multiblock entities
β”œβ”€β”€ functions/ Test functions such as example/kit
β”œβ”€β”€ items/ Tools, upgrades, capsules, and UI display items
β”œβ”€β”€ item_catalog/ Creative inventory organization
β”œβ”€β”€ loot_tables/ Loot used by examples
β”œβ”€β”€ recipes/ Normal Minecraft crafting recipes
β”œβ”€β”€ scripts/
β”‚ β”œβ”€β”€ DoriosCore/ Read-only machinery library snapshot
β”‚ β”œβ”€β”€ DoriosLib/ Read-only shared library snapshot
β”‚ β”œβ”€β”€ ExampleCore/ Reusable code owned by this addon
β”‚ β”œβ”€β”€ config/ Registrations sent to UtilityCraft
β”‚ β”œβ”€β”€ examples/ Concrete blocks and runtime examples
β”‚ └── main.js Script entry and initialization order
└── manifest.json BP identity, script module, APIs, and dependencies

scripts/main.js​

The entry point establishes the order in which the project starts:

import "DoriosCore/index.js";
import * as DoriosLib from "DoriosLib/index.js";

import "ExampleCore/index.js";
import "./config/index.js";
import "./examples/index.js";

DoriosLib.registry.install();
DoriosLib.container.initialize();
DoriosLib.linkNode.initializeLinkNodeIO();

Registrations are imported before DoriosLib.registry.install() is called. This lets every module declare its block components, item components, and integration payloads before the registry installs them.

scripts/config​

This folder contains data registered into public UtilityCraft systems, including recipes, upgrades, fluids, gases, fuels, loot, plants, and related integrations.

Use DoriosLib from its public root:

import * as DoriosLib from "DoriosLib/index.js";

scripts/examples​

This folder contains concrete runtime behavior:

  • component-driven utility blocks;
  • scripted machines;
  • passive and active generators;
  • agriculture examples;
  • multiblock controllers and ports.

When creating a real addon, rename this organizational layer if a different name makes its purpose clearer.

scripts/ExampleCore​

ExampleCore demonstrates reusable logic owned by the extension, including custom subclasses based on public DoriosCore classes.

For a real project:

  1. Rename it to something explicit such as MYADDON_CORE.
  2. Update its alias in config.json, jsconfig.json, tools/bundle.mjs, and tools/regolith-bundle.mjs.
  3. Import only your own public files from concrete machine scripts.

Never place addon behavior inside DoriosCore or DoriosLib.

Resource Pack​

RP/
β”œβ”€β”€ entity/ Client entities for fluids, gases, and helpers
β”œβ”€β”€ models/ Block geometries
β”œβ”€β”€ texts/ Language files and language list
β”œβ”€β”€ textures/ Block, item, entity, and UI textures
β”œβ”€β”€ ui/
β”‚ β”œβ”€β”€ _ui_defs.json Registers addon-owned UI files
β”‚ β”œβ”€β”€ chest_screen.json
β”‚ └── example_machinery.json
β”œβ”€β”€ blocks.json Block sound and visual registration
└── manifest.json RP identity and dependencies

The addon does not copy UtilityCraft's ui_core.json. Its own UI files reference shared controls directly with names such as @uc.machine_name, @uc.energy_bar, and @uc.io_tab.

Use the Machine UI Core reference when a UI tutorial asks you to select or configure a shared control.

Types and editor support​

types/
β”œβ”€β”€ DoriosCore/index.d.ts
└── DoriosLib/index.d.ts

These declarations help the editor understand public methods, parameters, and return values. They do not replace the runtime folders under BP/scripts.

jsconfig.json connects public import names to the corresponding declarations and addon-owned source folders.

Build and verification tools​

File or commandPurpose
config.jsonRegolith packs, compiler plugins, aliases, and build profiles.
npm run checkJavaScript type check plus resource and catalog verification.
npm run verify:importsRejects private or relative DoriosCore imports.
tools/regolith-bundle.mjsBundles scripts inside a Regolith build.
tools/bundle.mjsCreates the standalone dist/scripts/main.js bundle.
tools/generate-resource.ps1Scaffolds complete liquid or gas display resources.

Ownership rule​

LocationMay your addon modify it?
BP/scripts/DoriosCoreNo. Update the dependency as a complete library snapshot.
BP/scripts/DoriosLibNo. Update the dependency as a complete library snapshot.
BP/scripts/ExampleCoreYes. Rename and develop it as addon-owned code.
BP/scripts/configYes. Own your registrations and payloads.
BP/scripts/examplesYes. Replace examples with your actual content.
BP/blocks, entities, items, recipesYes. Use your own identifiers and definitions.
RP addon assets and UI filesYes. Use your namespace and licensed assets.
build, dist, .regolithNo. These are generated outputs.

Ready for the first machine​

You are ready to continue when you can answer:

  • Which file starts the addon scripts?
  • Where should a concrete machine component be registered?
  • Where should a reusable custom machine class live?
  • Which two library folders must remain unmodified?
  • Which two pack folders must be enabled in the world?

The next course section, Your First Machine, will build on this structure.