Skip to main content

DoriosCore API reference

The API reference documents the supported programming surface available from:

import { Machine } from "DoriosCore/index.js";

The current public entry point exposes 103 runtime members and 93 type-only contracts. Members not exported by this entry point are implementation details and are intentionally excluded.

Classification

Primary Common addon developmentAdvanced Custom infrastructure and low-level controlCompatibility Supported for existing implementations

Machinery

MemberKindScopeDescription
BasicMachineClassPrimaryBase scheduled runtime shared by machines and generators.
MachineClassPrimaryProcessing-machine runtime with upgrades, costs, progress, and lifecycle helpers.
GeneratorClassPrimaryEnergy-producing runtime and output-mode helpers.
EnergyStorageClassPrimaryLarge-value energy storage and transfers.
FluidStorageClassPrimaryIndexed liquid storage, container interactions, display, and transfers.
GasStorageClassPrimaryIndexed gas storage with the same storage model as liquids.
MachineUpgradeRegistryClassPrimaryCompiles registered upgrade items and resolves machine boosts.

IO authoring and interfaces

MembersScopeDescription
registerIOInterface, registerIOInterfaceForBlockTagPrimaryRegister six-face item, liquid, and gas controls by block ID or block tag.
ensureBlockIOInterface, hasRegisteredIOInterfacePrimaryMaterialize or query a block's registered UI interface.
IOInterfacePrimaryObject facade containing the IO registration operations.
registerLinkNodeIO, getLinkNodeIODefinition, openLinkNodeIOFormPrimaryDefine and operate item, liquid, and gas routing for multiblock link-node ports.
InterfaceManager, encodeInterfaceSlot, decodeInterfaceSlot, stripInterfaceSlotCodeAdvancedLow-level entity-container interface and button infrastructure.

Liquid IO documents

These functions manage the normalized per-face IO document stored by compatible liquid containers. See Liquid IO documents.

DEFAULT_FLUID_IO_MODE, FLUID_CONFIG_VERSION, FLUID_CONFIG_KEY, FLUID_CONTAINER_FAMILY, FLUID_CONFIG_EVENT_NAMESPACE, SET_FLUID_CONFIG_EVENT_ID, registerFluidIODefinition, getFluidIODefinition, ensureFluidIOConfig, setFluidConfig, getFluidConfig, getFluidConfigRevision, getFluidStatus, getInputFluidIndices, getOutputFluidIndices, getFluidIODirectionMode, cycleFluidIODirectionMode, normalizeFluidConfig, cloneFluidConfig.

Gas IO documents

Gas containers expose a parallel document API. See Gas IO documents.

DEFAULT_GAS_IO_MODE, GAS_CONFIG_VERSION, GAS_CONFIG_KEY, GAS_CONTAINER_FAMILY, GAS_CONFIG_EVENT_NAMESPACE, SET_GAS_CONFIG_EVENT_ID, registerGasIODefinition, getGasIODefinition, ensureGasIOConfig, setGasConfig, getGasConfig, getGasConfigRevision, getGasStatus, getInputGasIndices, getOutputGasIndices, getGasIODirectionMode, cycleGasIODirectionMode, normalizeGasConfig, cloneGasConfig.

Container adapters

ResourceMembers
ItemsresolveItemContainerAt
LiquidsresolveFluidContainer, resolveFluidContainerAt, getFluidInputIndices, getFluidOutputIndices, getFluidContainerRevision, transferFluid, insertFluid, getFluidStorage
GasesresolveGasContainer, resolveGasContainerAt, getGasInputIndices, getGasOutputIndices, getGasContainerRevision, transferGas, insertGas, getGasStorage

Use these advanced adapters when transferring resources between arbitrary compatible targets. Normal Machine.processIO() calls already use the registered machine IO.

Runtime helpers

MemberScopeDescription
TickSchedulerPrimary / AdvancedDistributes closed-machine work across groups and exposes the active profile.
OutputTrackerAdvancedCaches enabled item, liquid, and gas output targets.
RotationPrimaryHandles placement facing and wrench rotation.
ContainerSessionManagerAdvancedTracks open helper-entity containers and player-specific sessions.
ButtonItemStack, loadButtonItemStack, ButtonManagerCompatibilityExisting polling-based container buttons. Prefer registered interfaces for new IO controls.
addOpenUICount, removeOpenUICountAdvancedMaintains the open-UI counter used by scheduling and rendering.

Resource lore

RESOURCE_LORE_MARKERS, buildEnergyLoreLine, buildFluidLoreLine, buildGasLoreLine, createResourceLore, parseResourceLore, getResourcesFromItem, and restoreResourceSnapshot serialize stored resources into a placed machine's dropped item and restore them after placement.

These functions are advanced APIs. Machine.spawnEntity(), Machine.onDestroy(), Generator.spawnEntity(), and Generator.onDestroy() already handle the normal lifecycle.

Multiblocks

MemberKindDescription
MultiblockFacadeStructure detection, activation, deactivation, entity lookup, link-node activation, and constants.
MultiblockMachineClassComponent-scaled processing controller with progress, output, and information-label helpers.
MultiblockGeneratorClassMultiblock generator controller with fill behavior and addon-owned activation calculations.

Protocol constants

Advanced integrations can use TICK_GROUP_PROPERTY_ID, TICK_GROUP_COUNTS_PROPERTY_ID, DEFAULT_ENTITY_ID, DEFAULT_SCHEDULER_PROFILE, SET_SCHEDULER_PROFILE_EVENT_ID, SET_TICK_SPEED_EVENT_ID, REGISTER_GAS_ITEM_EVENT_ID, REGISTER_GAS_HOLDER_EVENT_ID, and REGISTER_MACHINE_UPGRADE_EVENT_ID.

Prefer the corresponding classes and DoriosLib registries over sending protocol events manually.

See DoriosCore script events for the supported cross-addon and command payloads.

Type-only contracts

The declaration file also exposes 93 editor contracts. They are documented beside the member that consumes or returns them rather than as independent runtime values.

AreaTypes
Core configurationDirectionName, CardinalDirectionName, TransferMode, OutputTransferType, SchedulerProfileId, NormalizedValue, Bounds, MachineEntityConfig, BaseMachineConfig, MachineRuntimeConfig, GeneratorRuntimeConfig, MachineSettings, GeneratorSettings, Requirement, FillBlocksConfig, PlacementEventLike, DestroyEventLike, InteractionEventLike, ProgressOptions, WarningOptions, MachineBoosts, MachineUpgradeRegistration, CompiledMachineUpgrade, BasicMachineOptions
IO authoringItemIOModeConfig, ItemIOGroupConfig, FluidIOModeConfig, LiquidIOGroupConfig, GasIOModeConfig, GasIOGroupConfig, IOInterfaceConfig, LinkNodeItemGroupConfig, LinkNodeIndexedGroupConfig, LinkNodeItemIOConfig, LinkNodeIndexedIOConfig, LinkNodeIOConfig, LinkNodeIOGroup, LinkNodeResourceDefinition, LinkNodeIODefinition, ProcessIOLimits, ProcessIOSummary
Interface buttonsInterfaceButtonDefinition, InterfaceDefinition, RegisteredInterfaceButton, RegisteredInterfaceDefinition, InterfaceButtonContext, InterfaceButtonDescriptor, PressedInterfaceButtons
Resource containersResolvedItemContainer, FaceFluidIndexConfig, SimpleFluidConfig, ComplexFluidConfig, FluidConfig, FluidIOMode, FluidIODefinition, ResolvedFluidContainer, FluidContainerTarget, FluidTransferOptions, FluidInsertOptions, FaceGasIndexConfig, SimpleGasConfig, ComplexGasConfig, GasConfig, GasIOMode, GasIODefinition, ResolvedGasContainer, GasContainerTarget, GasTransferOptions, GasInsertOptions, FluidContainerData, FluidHolderData, SelectedInventoryItem, GasContainerData, GasHolderData, StoredResourceEntry, StoredResourceSnapshot
Scheduling and sessionsSchedulerProfileConfig, ContainerSession, ContainerSessionEntry, ButtonPressEvent, ButtonPressCallback, ButtonDefinition, ButtonWatcher
MultiblocksDetectedStructure, ActivationContext, MachineActivationContext, InteractionHandlers, MachineStats, MultiblockStructureDetector, MultiblockActivationManager, MultiblockDeactivationManager, MultiblockEntityManager, MultiblockConstants