Pular para o conteúdo principal

Machine Definition

The machine_definition entry describes a machine type entirely from the panel. Placing its spawnItem creates a live instance that ticks autonomously, renders its hologram, persists across restarts and opens its menu on right-click.

Core

FieldDefaultDescription
processingTypeSMELTINGThe machine's behavior. See processing types.
behaviors[]Explicit behavior set; leave empty to auto-derive from processingType.
criteria / modifiers / triggers[]Standard triggerable fields, checked/fired when the definition is used.

Slots

FieldDefaultDescription
inputSlots1Input slots for items to process.
outputSlots1Output slots for results.
hasFuelSlottrueWhether the machine has a dedicated fuel slot.
upgradeSlots0Upgrade module slots (0 = upgrades disabled).
shearsSlots0Shear storage slots (SHEARING machines).
filterSlots0Filter slots (SORTING machines).
maxPerSlot64Max items per inventory slot.
liquidTankCapacity0Liquid tank capacity in millibuckets (0 = no tank).

Recipes & Fuel

Recipes and fuels use material name strings (e.g. IRON_INGOT), resolved at runtime.

recipes — list of MachineRecipeSpec:

FieldDefaultDescription
inputMaterial / outputMaterial""Input and output materials.
outputAmount1Output count.
cookTime200Processing duration in ticks.
fuelCost0Fuel units per operation.
energyCost0Energy units per operation.
liquidInputName / liquidInputAmount"" / 0Liquid consumed (millibuckets).
liquidOutputName / liquidOutputAmount"" / 0Liquid produced (millibuckets).

fuelTypes — list of MachineFuelSpec: material, burnTime (ticks), fuelValue (units).

Energy

FieldDefaultDescription
energyCapacity0Storage capacity (0 = no energy system). Used by ENERGY_CELL.
energyGenerationPerTick0Output of ENERGY_GENERATOR machines.
energyConsumptionPerTick0Draw of consumer machines.

Consumers must be linked to the grid before they draw. The pool is shared per world in the public build; energy physically lives in the ENERGY_CELL machines.

Tiers & Upgrades

allowedUpgrades — which MachineUpgradeTypes this machine accepts (SPEED, YIELD, ENERGY_EFFICIENCY, FORTUNE, RANGE, FILTER). Empty = refuses upgrades.

upgradeSpecs — list of MachineUpgradeSpec: material, type, magnitude (SPEED/YIELD multiply; FORTUNE is a 0–1 chance; RANGE adds blocks; FILTER adds slots).

tiers — list of MachineTierSpec, ascending; the highest unlocked wins and stacks multiplicatively with modules:

FieldDefaultDescription
name""Display name (e.g. T2).
researchNode""Research gate. Public build: blank = unlocked; non-blank = locked.
speedMultiplier / yieldMultiplier / energyMultiplier1.0Operation modifiers.
fortuneChance0.0Chance (0–1) to double an operation's output.

Archetype-specific

FieldDefaultUsed by
chargeables / chargeRatePerSecond[] / 0CHARGING — items fillable with energy (charge rides in the item's persistent data).
assemblerModeSPAWNASSEMBLER — SPAWN (ingredients + energy → entity) or COLLECT (harvest nearby produce).
assemblerEntityType / assemblerIngredients"" / []ASSEMBLER — target entity and per-operation ingredients.
assemblerEnergyCost / assemblerInterval / assemblerRange0 / 100 / 5.0ASSEMBLER — cost, cadence (ticks), COLLECT radius.
vacuumRange0.0VACUUM — collection radius in blocks.
shearRange / shearInterval5.0 / 100SHEARING — radius and cadence.

CONVEYOR, GENERATOR and VOID reuse existing fields rather than adding their own:

ArchetypeConfigured with
CONVEYORThe single output slot is the belt buffer (outputSlots ≥ 1 + guiStorageRef). Direction is the placement yaw. Throughput scales with hopperTransferAmount and the SPEED modifier.
GENERATOREach recipe with a blank inputMaterial is produced into the outputs on the first recipe's cookTime. Optional energyCost powers it. Products only spawn when they all fit.
VOIDItems in the input slots are deleted. With filterSlots set, only items matching a filter are destroyed; with none, everything fed in is voided.

Automation & Redstone

Every placed machine ticks autonomously on its owning region, so hoppers, redstone and processing all run without a viewer and are safe under Folia. Pure transforms (recipes, generators) also catch up the work missed while their chunk was unloaded, capped at 30 minutes and bounded by available inputs, fuel and energy.

FieldDefaultDescription
hopperInterval / hopperTransferAmount100 / 1Data-driven hopper automation (0 interval = disabled). Pulls from a container above into the inputs; pushes finished products into adjacent containers.
redstoneModeIGNOREIGNORE, DISABLE_WHEN_POWERED (a signal pauses it) or REQUIRE_POWER (only runs while powered). A paused machine advances no progress and pays nothing.
ejectWhenPoweredfalseWhen powered, ejects finished products into adjacent containers even without a hopper.
redstoneComparatorOutputNONEWhat a neighbouring comparator reads: PROGRESS, INPUT_FILL, OUTPUT_FILL or ENERGY_FILL (0–15). Requires BTC-CORE.
redstonePulseOnCompletefalseEmit a short redstone pulse each time an operation completes. Requires BTC-CORE.
redstonePulseTicks4Duration of the completion pulse in ticks.
observação

Comparator output and completion pulses need a block to emit redstone, which no plain Bukkit block can do. They are driven through the BTC-CORE server hook (BTCCoreAPI.setEmittedRedstonePower); on a server without it these fields are simply inert. Redstone inputs (redstoneMode, ejectWhenPowered) work everywhere.

Visuals & Hologram

FieldDefaultDescription
spawnItememptyItem that places the machine and is returned on pickup.
visualTypeNONENONE, FURNITURE or CUSTOM_BLOCK (CraftEngine ids below).
furnitureId / customBlockId""CraftEngine model ids.
alignWithPlayerYawtrueAlign placed furniture with the player's yaw.
hologramEnabledtrueToggle the status hologram.
hologramOffsetHeight1.2Height above the machine block.
hologramProgressBarFormatSupports %bar%, %percent%, %time_left%.
hologramIdleMessage / hologramActiveMessage / hologramLowEnergyMessage / hologramFullMessageMiniMessage status lines.

Limits & Persistence

FieldDefaultDescription
machineLimit0Max instances per player (0 = unlimited). Bypass: machine.protection.bypass.
perIslandLimit / islandLimitUpgradeKey0 / ""Island-scoped limits — inert in the public build (no island system).
storageRefemptyRequiredmachine_data_artifact persisting instances.
guiStorageRefemptySTORAGE machines — OmniGUI storage entry backing the stored items (one group per instance).