A KubeJS addon that lets you write recipes for Industrial Foregoing and create your own machine addons.
Requeriments
Drop this in kubejs/server_scripts/:
ServerEvents.recipes(event => {
// Crusher (the pickaxe action in the Stonework Factory)
event.recipes.industrialforegoing.crusher(
'minecraft:gravel', // output <- note: output comes first
'minecraft:cobblestone' // input
)
// Dissolution Chamber
event.recipes.industrialforegoing.dissolution_chamber(
['minecraft:dirt', 'minecraft:sand'], // input items, may be empty
Fluid.of('minecraft:water', 500), // input fluid
Item.of('minecraft:diamond', 2), // output item
200 // time in ticks
).outputFluid(Fluid.of('minecraft:lava', 100)) // optional
// Fluid Extractor
event.recipes.industrialforegoing.fluid_extractor(
'minecraft:oak_log', // block being tapped
'minecraft:stripped_oak_log', // block left behind
0.05, // break chance, 0.0 - 1.0
Fluid.of('industrialforegoing:latex', 8)
)
// Stonework Factory - generate
event.recipes.industrialforegoing.stonework_generate(
'minecraft:obsidian',
1000, 1000, // water / lava needed
0, 1000 // water / lava consumed
)
// Laser Drill - ore
event.recipes.industrialforegoing.laser_drill_ore(
{ item: 'minecraft:diamond', count: 1 }, // output
'industrialforegoing:red_laser_lens', // catalyst lens
[{
biome_filter: { whitelist: [], blacklist: [] },
dimension_filter: { whitelist: [], blacklist: ['minecraft:the_end'] },
depth_min: 0,
depth_max: 255,
weight: 5 // higher = more common
}]
)
// Laser Drill - fluid
event.recipes.industrialforegoing.laser_drill_fluid(
Fluid.of('industrialforegoing:ether_gas', 10), // output
'industrialforegoing:purple_laser_lens', // catalyst lens
[{
biome_filter: { whitelist: [], blacklist: [] },
dimension_filter: { whitelist: [], blacklist: [] },
depth_min: -64,
depth_max: 256,
weight: 8
}],
{ entity: { type: 'minecraft:wither' }, data: {}, display: '' } // optional
)
})
Rarity is a list, so one ore can have different weights at different depths. All five fields are mandatory — Industrial Foregoing's codec has no defaults.
Removing works on the same keys the mod uses:
event.remove({ type: 'industrialforegoing:laser_drill_ore', output: 'minecraft:diamond' })
Register brand new efficiency, speed, processing and range addons. This one is a startup item type, so it goes in kubejs/startup_scripts/:
StartupEvents.registry('item', event => {
event.create('netherite_speed_addon', 'industrialforegoing:addon')
.speedTier(4) // matches IF's tier formulas
.displayName('Netherite Speed Addon')
event.create('hybrid_addon', 'industrialforegoing:addon')
.speed(3) // or set raw augment values
.efficiency(0.5) // lower is better
.processing(2)
.rarity('epic')
})
| Raw value | Tier preset | Augment |
|---|---|---|
speed(v) |
speedTier(n) → 1 + n |
Speed |
efficiency(v) |
efficiencyTier(n) → 1 - n * 0.1 |
Efficiency |
processing(v) |
processingTier(n) → 1 + n |
Processing |
range(v) |
rangeTier(n) → n |
Range |
augment(type, v) |
— | anything, including other mods' types |
The result behaves exactly like a built-in addon:
.texture(...)displayName, maxStackSize, rarity, tooltip, glow, …) still worksGive it a recipe like any other item:
ServerEvents.recipes(event => {
event.recipes.industrialforegoing.dissolution_chamber(
['minecraft:redstone', 'minecraft:glass_pane', '#c:gears/diamond', 'minecraft:sugar'],
Fluid.of('industrialforegoing:latex', 1000),
'kubejs:netherite_speed_addon',
200
)
})
Huge thanks to:
This addon is only glue between their two projects. Go support them.
Full documentation, argument tables and the remaining details are in WIKI in the repository.