Skip to main content

DoriosLib documentation

DORIOS ADDON DEVELOPMENT

DoriosLib

The general-purpose library shared by UtilityCraft and Dorios addons. Work with blocks, inventories, items, dependency discovery, cross-addon registries, link nodes, commands, messages, time, math, text, and safe JSON through one stable public entry point.

Stable public entry point

Import DoriosLib as one namespace from DoriosLib/index.js. Deep imports from its internal folders are not part of the supported addon API.

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

const label = DoriosLib.text.formatIdentifier("minecraft:diamond_sword");
const inventory = DoriosLib.entity.getInventory(player);

What is DoriosLib?

DoriosLib is the shared JavaScript foundation used across Dorios Studios projects. It standardizes common operations that otherwise become duplicated and subtly incompatible between addons: safe inventory access, component registration, dependency discovery, cross-addon payload dispatch, block helpers, link-node resolution, messages, item construction, and utility functions.

It is correct to call its public surface an API. In this documentation, API means the namespaces, functions, constants, and type contracts that addon scripts can consume. DoriosLib is not an HTTP service and does not make web requests.

FOUNDATION

Blocks, entities, items, and players

Read states, resolve facing, manage inventories, health and equipment, create item stacks, apply durability, and safely give items.

AUTOMATION

Containers and link nodes

Resolve inventories behind blocks or entities, enforce item IO policies, move stacks, and route physical multiblock ports to logical owners.

INTEGRATION

Registries and dependencies

Register components, commands, UtilityCraft content, and addon metadata through stable cross-addon protocols.

UTILITIES

Math, messages, text, time, and JSON

Use consistent formatting, scheduling, safe serialization, random helpers, coordinates, duration formatting, and player messaging.

Responsibilities

ProjectResponsibility
DoriosLibGeneral Dorios utilities, startup registries, dependency discovery, item containers, and link-node infrastructure.
DoriosCoreMachinery runtime: machines, generators, energy, indexed liquids and gases, machinery IO, upgrades, scheduling, and multiblocks.
UtilityCoreUtilityCraft-owned gameplay systems, including machinery networks.
Your addonConcrete gameplay behavior, content definitions, registrations, and addon-specific reusable systems.

DoriosLib does not replace DoriosCore, and DoriosCore does not replace DoriosLib. A UtilityCraft extension normally uses both.

Requirements

  • A Minecraft Bedrock project using the Script API version supported by UtilityCraft.
  • UtilityCraft 3.5.0 or newer enabled in the world.
  • The DoriosLib alias resolved by the project's build or Regolith configuration.
  • @minecraft/server types when editor IntelliSense or type checking is required.

The UtilityCraft Addon Template provides a functional project with the correct dependency aliases, load order, registrations, machines, fluids, gases, UI, and multiblocks.

Keep the library read-only

Addons consume DoriosLib; they do not patch it. Put addon-owned helpers in your own folder and import the public namespace where needed.

BP/scripts/
├─ DoriosLib/ # Shared dependency: do not modify
├─ DoriosCore/ # Machinery dependency: do not modify
├─ MYADDON_CORE/ # Addon-owned reusable behavior
├─ config/ # Registrations and data
├─ features/ # Concrete gameplay features
└─ main.js # Explicit startup order
  1. Follow Get started for imports, initialization, and load order.
  2. Read Library boundaries before creating addon-owned wrappers or protocols.
  3. Browse the API overview to choose the correct namespace.
  4. Open the namespace page for complete signatures, parameter rules, return values, and examples.
  5. Compare production use with UtilityCraft and the focused Addon Template.

API at a glance

NamespaceUse it for
blockBlock states, facing, adjacency, entity lookup, and type checks.
containerItem IO documents, resolution, insertion, and transfers.
entityInventories, health, and equipment.
itemItemStack creation, type checks, durability, and Unbreaking-aware damage.
linkNodePhysical port resolution and per-port item, liquid, or gas IO overrides.
registryUtilityCraft payloads, custom components, and custom commands.
dependenciesAddon discovery and minimum-version validation.
math, text, time, utilsGeneral reusable helpers.

The complete API reference tracks 186 runtime paths and 43 type-only contracts from the current DoriosLib/index.js declaration.