Skip to content

Wiki English

NadienDev 🔥 edited this page Dec 1, 2026 · 3 revisions

KubeJS Infinity Extras

🇪🇸 Versión en español: Wiki-Spanish · Home

What is KubeJS Infinity Extras?

KubeJS Infinity Extras is an addon for KubeJS that adds script support for many tech and magic mods. With it you can, from your KubeJS scripts:

  • Create recipes for those mods' machines (AE2 inscriber, NuclearCraft processors, Extended Crafting tables, Mekanism reactors, XyCraft extractor…), with their own format and options.
  • Register new content: storage cells, singularities, molten fluids, tool materials, gems, bosses, Curios slots, data models, particles and much more.
  • Change how mods behave: the loot and shape of AE2 meteorites, reactor fuels, villager trades, portal activators, and so on.

Everything you create shows up in JEI. Every integration loads only when its mod is installed: drop the addon into any pack and use only the parts you care about. The ones whose mod is missing simply don't exist.

Installation

  1. Install KubeJS, Rhino and Just Enough Items (JEI): they are the only required dependencies.
  2. Put KubeJS Infinity Extras in the mods folder.
  3. Install the mods you want to use (AE2, NuclearCraft, Curios…). All of them are optional.
  4. Start the game once so KubeJS creates the kubejs/ folder in the instance.

Script folders and when they load

KubeJS reads scripts from three folders inside kubejs/. Every section of this wiki says which folder each part goes in:

Folder What for When it reloads
startup_scripts/ Registries: items, blocks, fluids, Curios slots, materials, gems… Only on game restart
server_scripts/ Recipes, tags, trades, loot, server and player events With /reload
client_scripts/ JEI, tooltips and everything only the client sees With F3 + T (resource reload)

If something doesn't show up after editing a registry script, restart the game: registries can't be reloaded while it runs.

How calls are written

Every integration follows the same rules, so once you learn one you know how to use the rest:

  • Recipes: event.recipes.<mod>.<type>(result, inputs...), always inside ServerEvents.recipes(event => { ... }). The result comes first, then the inputs.
  • Options: added as chained methods after the call: .time(300), .energy(60), .mode('cool')… Any option you leave out uses its default value (each section lists it).
  • Registries: <Mod>Events.registry('<type>', event => { event.create('kubejs:my_thing')... }) in startup_scripts, also with chained methods.
  • No shortcuts: calls are written in full (event.recipes.nuclearcraft.alloy_smelter(...)), and no { ... } objects are needed for options.
// kubejs/server_scripts/recipes.js
ServerEvents.recipes(event => {
  event.recipes.ae2.inscriber('kubejs:cell_component_4m', 'kubejs:cell_component_1m') // result, input
    .top('ae2:engineering_processor')       // top press
    .bottom('ae2:calculation_processor')    // bottom press
    .press()                                // the presses are consumed

  event.recipes.nuclearcraft.alloy_smelter('4x minecraft:copper_ingot', ['3x #c:ingots/tin', 'minecraft:iron_ingot'])
    .time(300)                              // processing time
    .energy(60)                             // energy per tick
})

Value formats

Value How to write it Example
Item id, with the count in front when needed 'minecraft:diamond', '4x minecraft:iron_ingot'
Item tag # in front '#c:ingots/tin'
Fluid Fluid.of(id, mB) Fluid.of('minecraft:water', 1000)
Mekanism chemical 'amountx id' '500x mekanism:oxygen'
Block id, or id with properties in brackets 'minecraft:furnace[lit=true]'
Time ticks (20 ticks = 1 second) .time(200)

How to read each section

Every mod has its own section in the contents. In each one you will find:

  1. What the integration does and which mods it needs.
  2. Which folder each part goes in (startup_scripts, server_scripts or client_scripts).
  3. The signature of every recipe, registry or event.
  4. A table with all its chained methods, what they do and their default value.
  5. An example of every method, ready to copy.

To create recipes without writing code, see the KubeJS Recipe Maker: an in-game tool that writes the recipe to kubejs/server_scripts/generated_<mod>.js.

When something doesn't work

  • Check logs/kubejs/startup.log, logs/kubejs/server.log and logs/kubejs/client.log: KubeJS Infinity Extras writes every error there with the script and line.
  • A misspelled method or an invalid value never crashes the game: it is reported in the log and that recipe or option is skipped.
  • Make sure that integration's mod is installed: if it isn't, its events and recipes don't exist.

Contents


Ad Astra integration

Ad Astra ships no KubeJS support of its own. KubeJS Infinity Extras adds recipe types for every Ad Astra machine (compressor, Etrionic Blast Furnace, Cryo Freezer, Fuel Refinery, Oxygen Loader, NASA Workbench, space stations) and a startup registry to add or override planets.

Required mods: Ad Astra (KubeJS Infinity Extras loads this only when Ad Astra is installed)

Part Script folder
AdAstraEvents.registry('planets', ...) startup_scripts
event.recipes.ad_astra.* server_scripts

"Ad Astra: Planets" has its own KubeJS plugin (AdAstraPlanetsEvents, event.recipes.adastraplanets.*), independent from this page.

Value formats

Value Format
Item input 'minecraft:iron_ingot', '#c:ingots/iron'
Item output 'ad_astra:steel_ingot', '2x ad_astra:steel_plate', Item.of('ad_astra:steel_plate', 2)
Sized input '64x #c:plates/iron' (space station materials)
Fluid input '100x #minecraft:water', '25x ad_astra:oxygen', Fluid.of('ad_astra:oil', 5) (mB)
Fluid output '4x ad_astra:oxygen', Fluid.of('ad_astra:fuel', 5) (mB)

Planets (startup)

AdAstraEvents.registry('planets', event => { event.create(id) ... })

Planets are data driven (data/<ns>/planets/<id>.json). The dimension must already exist (vanilla, another mod or a data pack): this only makes Ad Astra treat it as a planet (rocket destination, gravity, oxygen, temperature...). Re-using an existing id such as 'ad_astra:mars' overrides that planet.

Method Description Default
.dimension(id) Dimension of the planet the planet id
.name(text) (alias .displayName) English name (lang key planet.<dimension ns>.<dimension path>) title-cased dimension
.lang(key) Own translation key, copied to the planet key for every locale none
.oxygen(bool) Breathable atmosphere true
.temperature(n) Temperature in °C 20
.gravity(n) Gravity in m/s² 9.807
.solarPower(n) Solar panel output 16
.solarSystem(id) Solar system 'ad_astra:solar_system'
.orbit(id) Orbit dimension (space stations) none
.tier(n) Rocket tier needed 1
.additionalLaunchDimension(id) Launching from this dimension counts as this planet (adds one) none
.additionalLaunchDimensions([ids]) Replaces the whole extra launch dimension list []
AdAstraEvents.registry('planets', event => {
    event.create('kubejs:the_end_planet')
        .dimension('minecraft:the_end')            // dimension treated as the planet
        .name('The End')                           // English name (alias: .displayName())
        .oxygen(false)                             // no breathable air
        .temperature(-40)                          // °C
        .gravity(4.5)                              // m/s²
        .solarPower(8)                             // solar panel output
        .solarSystem('ad_astra:solar_system')      // solar system it belongs to
        .orbit('ad_astra:earth_orbit')             // orbit dimension for space stations
        .tier(3)                                   // rocket tier needed
        .additionalLaunchDimension('minecraft:the_nether') // launching from the Nether counts as this planet

    event.create('kubejs:overworld_copy')
        .dimension('minecraft:overworld')
        .displayName('Overworld Copy')             // alias of .name()
        .lang('planet.kubejs.overworld_copy')      // own translation key
        .additionalLaunchDimensions(['minecraft:the_nether', 'minecraft:the_end']) // replaces the whole list

    // Override a built-in planet: Mars becomes breathable
    event.create('ad_astra:mars')
        .dimension('ad_astra:mars')
        .oxygen(true)
        .temperature(-65)
        .gravity(3.72076)
        .solarPower(12)
        .orbit('ad_astra:mars_orbit')
        .tier(2)
})

Machine recipes

The processing machines share two chained methods; only the defaults change.

Method Description
.cookingTime(ticks) (aliases .time, .ticks) Processing time
.energy(n) (alias .energyPerTick) FE per tick
Type Signature cookingTime default energy default
compressing (Compressor) compressing(result, ingredient[, cookingTime, energy]) 100 20
alloying (Etrionic Blast Furnace) alloying(result, [1 to 4 ingredients][, cookingTime, energy]) 100 20
cryo_freezing (Cryo Freezer) cryo_freezing(fluidResult, ingredient[, cookingTime, energy]) 120 40
refining (Fuel Refinery) refining(fluidResult, fluidInput[, cookingTime, energy]) 1 30
oxygen_loading (Oxygen Loader) oxygen_loading(fluidResult, fluidInput[, cookingTime, energy]) 1 30
ServerEvents.recipes(event => {
    event.recipes.ad_astra.compressing('ad_astra:steel_plate', '#c:ingots/steel')
    event.recipes.ad_astra.compressing('9x ad_astra:desh_plate', '#c:storage_blocks/desh').cookingTime(800).energy(40) // time in ticks, FE per tick
    event.recipes.ad_astra.compressing('ad_astra:iron_plate', 'minecraft:iron_ingot', 60, 10)       // time and energy as arguments
    event.recipes.ad_astra.compressing('ad_astra:steel_plate', 'ad_astra:steel_block').time(400).energyPerTick(30) // aliases of .cookingTime() / .energy() (also .ticks())

    event.recipes.ad_astra.alloying('2x ad_astra:steel_ingot', ['minecraft:iron_ingot', 'minecraft:iron_ingot', '#minecraft:coals'])
    event.recipes.ad_astra.alloying('ad_astra:calorite_ingot', ['#c:ingots/ostrum', '#c:gems/diamond']).cookingTime(200).energy(60)

    event.recipes.ad_astra.cryo_freezing('50x ad_astra:cryo_fuel', 'minecraft:snow_block')
    event.recipes.ad_astra.cryo_freezing(Fluid.of('ad_astra:cryo_fuel', 200), 'minecraft:packed_ice').cookingTime(240).energy(80)

    event.recipes.ad_astra.refining('5x ad_astra:fuel', '10x #c:oil')
    event.recipes.ad_astra.refining('10x ad_astra:fuel', '5x minecraft:lava').energy(60)

    event.recipes.ad_astra.oxygen_loading('10x ad_astra:oxygen', '100x #c:water')
    event.recipes.ad_astra.oxygen_loading('25x ad_astra:oxygen', '25x ad_astra:oxygen', 1, 15)
})

NASA Workbench

event.recipes.ad_astra.nasa_workbench(result, [ingredients]) — exactly 14 ingredients, in GUI slot order: nose cone, 6 body blocks, fin, 2 tanks, fin, fin, engine, fin. No chained options.

ServerEvents.recipes(event => {
    event.recipes.ad_astra.nasa_workbench('ad_astra:tier_1_rocket', [
        'ad_astra:rocket_nose_cone',
        '#c:storage_blocks/iron', '#c:storage_blocks/iron', '#c:storage_blocks/iron',
        '#c:storage_blocks/iron', '#c:storage_blocks/iron', '#c:storage_blocks/iron',
        'ad_astra:rocket_fin',
        'ad_astra:steel_tank', 'ad_astra:steel_tank',
        'ad_astra:rocket_fin', 'ad_astra:rocket_fin',
        'ad_astra:steel_engine',
        'ad_astra:rocket_fin'
    ])
})

Space station

event.recipes.ad_astra.space_station_recipe(dimension, [sizedIngredients][, structure])

Method Description Default
.structure(id) Structure template placed in the orbit 'ad_astra:space_station'
ServerEvents.recipes(event => {
    event.recipes.ad_astra.space_station_recipe('ad_astra:moon_orbit', [
        '32x #c:plates/iron',
        '16x #c:ingots/steel',
        '8x #c:plates/desh'
    ])
    event.recipes.ad_astra.space_station_recipe('ad_astra:mars_orbit', ['64x #c:plates/steel', '32x #c:ingots/ostrum'])
        .structure('ad_astra:space_station') // structure template placed in the orbit
})


Agritech: Two and Agritech: Evolved integration

Adds planter recipes (crops and trees, basic and advanced planters) shown in each mod's JEI planter category, startup events for the fertilizer and soil modifier data maps, and the Agritech: Evolved durability_shapeless crafting recipe.

Required mods: Agritech: Two and/or Agritech: Evolved (KubeJS Infinity Extras loads each part only when its mod is installed)

Both mods share the same API: use agritechtwo / AgritechTwoEvents for Agritech: Two and agritechevolved / AgritechEvolvedEvents for Agritech: Evolved.

Part Script folder
AgritechTwoEvents.registry(...) / AgritechEvolvedEvents.registry(...) startup_scripts (needs a game restart)
Soil tags (ServerEvents.tags) server_scripts
event.recipes.agritechtwo.* / event.recipes.agritechevolved.* server_scripts

Not scriptable: Agritech: Evolved biomass burner fuels and capacitors (hard-coded items, values in the mod config). The Evolved composter uses NeoForge's compostables data map, which KubeJS itself can edit:

ServerEvents.generateData('after_mods', event => event.setCompostable('minecraft:stick', 0.3, false)) // plain KubeJS: 30% compost chance

Registry: fertilizers

AgritechTwoEvents.registry('fertilizers', event => { ... }) (same with AgritechEvolvedEvents) — NeoForge item data map of the mod.

Call Description
event.add(itemOrTag, speedMultiplier, yieldMultiplier) Adds or overrides a fertilizer (bone meal is 1.2 / 1.2)
event.remove(itemOrTag) Removes an entry, including the mod's own

Registry: soil_modifiers

AgritechTwoEvents.registry('soil_modifiers', event => { ... })

Call Description
event.add(itemOrTag, growthModifier) Soil growth modifier (dirt 0.475, farmland about 0.5+; higher is faster)
event.remove(itemOrTag) Removes an entry

A soil must also be in a soil tag used by the recipes (for example agritechtwo:dirt_soils).

// startup_scripts
AgritechTwoEvents.registry('fertilizers', event => {
  event.add('minecraft:rotten_flesh', 1.05, 1.0)  // item, speed multiplier, yield multiplier
  event.add('#c:fertilizers', 1.5, 1.3)           // a tag works too
  event.remove('minecraft:bone_meal')             // removes the mod's own entry
})

AgritechTwoEvents.registry('soil_modifiers', event => {
  event.add('minecraft:clay', 0.6)                // item, growth modifier
  event.add('minecraft:mud', 0.55)
  event.remove('minecraft:coarse_dirt')           // removes a soil modifier
})

AgritechEvolvedEvents.registry('fertilizers', event => {
  event.add('minecraft:glow_berries', 1.3, 1.1)   // same API for Agritech: Evolved
  event.remove('minecraft:bone_meal')
})

AgritechEvolvedEvents.registry('soil_modifiers', event => {
  event.add('minecraft:clay', 0.6)
  event.remove('minecraft:coarse_dirt')
})

Soil tags

Soils accepted by the recipes are item tags: <modid>:dirt_soils, :tree_soils, :farmland_soils, :sand_soils, :soul_sand_soils, ...

// server_scripts
ServerEvents.tags('item', event => {
  event.add('agritechtwo:dirt_soils', 'minecraft:clay')      // clay accepted by Agritech: Two dirt recipes
  event.add('agritechevolved:dirt_soils', 'minecraft:clay')  // same for Agritech: Evolved
})

Planter drops

Drops (the first argument) accept 'item' (always 1), '3x item' (always 3), '1-3x item' (1 to 3), or a list of those. Add more with .output(...).

Method Description Default
.output(item) Adds a drop (count 1) chance 1
.output(item, chance) Adds a drop with a chance (0-1) —
.output(item, min, max) Adds a drop with a count range chance 1
.output(item, min, max, chance) Count range and chance —
.soils(list) Replaces the accepted soils see below

Drops must be item ids (for example minecraft:sweet_berry_bush is only a block).

Crop

event.recipes.agritechtwo.crop(drops, seed[, soils]) / event.recipes.agritechevolved.crop(...) — soils default to #<modid>:dirt_soils.

Tree

event.recipes.agritechtwo.tree(drops, sapling[, soils]) / event.recipes.agritechevolved.tree(...) — soils default to #<modid>:tree_soils.

// server_scripts
ServerEvents.recipes(event => {
  event.recipes.agritechtwo.crop('1-3x minecraft:sweet_berries', 'minecraft:sweet_berries') // 1 to 3 berries, default dirt soils
    .output('minecraft:dead_bush', 0.05)                       // extra drop, 5% chance
  event.recipes.agritechtwo.crop('2x minecraft:cactus', 'minecraft:cactus', ['#agritechtwo:sand_soils']) // soils as 3rd argument
  event.recipes.agritechtwo.crop('1-4x minecraft:nether_wart', 'minecraft:nether_wart')
    .soils(['#agritechtwo:soul_sand_soils', 'minecraft:soul_soil']) // replaces the soils
  event.recipes.agritechtwo.crop('minecraft:melon_slice', 'minecraft:melon_seeds')
    .output('minecraft:melon_seeds')                           // extra drop, always 1
    .output('minecraft:glistering_melon_slice', 1, 2)          // extra drop, 1 to 2

  event.recipes.agritechtwo.tree('2-6x minecraft:oak_log', 'minecraft:oak_sapling') // default tree soils
    .output('minecraft:oak_sapling', 1, 2, 0.5)                // min, max, chance
    .output('minecraft:apple', 0.1)                            // chance

  event.recipes.agritechevolved.crop('minecraft:wheat', 'minecraft:wheat_seeds', ['#agritechevolved:farmland_soils'])
    .output('minecraft:wheat_seeds', 1, 2, 0.5)
  event.recipes.agritechevolved.tree('4x minecraft:cherry_log', 'minecraft:cherry_sapling')
    .output('minecraft:cherry_sapling', 0.4)
    .soils(['#agritechevolved:tree_soils', 'minecraft:moss_block'])

  event.remove({ type: 'agritechtwo:crop', input: 'minecraft:allium' })           // remove like any recipe
  event.remove({ type: 'agritechevolved:tree', input: 'minecraft:acacia_sapling' })
})

Durability shapeless (Agritech: Evolved only)

event.recipes.agritechevolved.durability_shapeless(result, ingredients, tool[, durabilityPerItem]) — crafting where every non-tool ingredient takes durability from the tool instead of consuming it (for example hoe + dirt = farmland).

Method Description Default
.durability(n) / .durabilityPerItem(n) / .durability_per_item(n) Durability taken per ingredient 1
.category(name) Crafting book category: building, redstone, equipment, misc misc
.group(name) Recipe book group none
event.recipes.agritechevolved.durability_shapeless('minecraft:dirt_path', ['minecraft:grass_block'], '#minecraft:shovels') // 1 durability per item
event.recipes.agritechevolved.durability_shapeless('2x minecraft:farmland', ['minecraft:dirt', 'minecraft:coarse_dirt'], '#minecraft:hoes', 2) // 2 per item
  .category('misc')           // crafting book category
  .group('kubejs_farmland')   // recipe book group
event.recipes.agritechevolved.durability_shapeless('minecraft:farmland', ['minecraft:rooted_dirt'], '#minecraft:hoes')
  .durability(3)              // durability per item (aliases: .durabilityPerItem(), .durability_per_item())


Apotheosis integration

Recipe types for every Apotheosis table (salvaging, reforging, gem cutting, smithing upgrades, sockets, potion charms and the special recipes) and startup registries for its data-driven content: gems, affix loot entries, invaders (bosses), elites, gear sets, rarities and affixes.

Required mods: Apotheosis 8.9.x (+ Placebo, Apothic Attributes) (KubeJS Infinity Extras loads this only when Apotheosis is installed)

Part Script folder
ApotheosisEvents.registry(...) startup_scripts
event.recipes.apotheosis.*, ApotheosisIngredients server_scripts

Registries (startup)

ApotheosisEvents.registry('<category>', event => { event.create(id) ... })

Entries are written into KubeJS' generated data pack (above mod data), so they load like normal data pack files, sync to clients, and can replace built-in entries. Ids without a namespace get kubejs. event.remove(id) removes an existing entry in every category.

Category Data folder Creates
gems gems Socketable gems
affix_loot_entries affix_loot_entries Items that can drop as random affix items
invaders apothic_invaders Apotheosis bosses
elites apothic_elites Chance for normal spawns to become a named, stronger mob
gear_sets gear_sets (Placebo) Equipment for invaders and elites
rarities rarities Item rarities
affixes affixes Affixes

Common methods

Method Applies to Description
.weight(n) / .quality(q) gems, affix loot entries, invaders, elites, gear sets, rarities, affixes Same weight in every world tier
.tierWeight(tier, weight[, quality]) same Per-tier weight: haven, frontier, ascent, summit, pinnacle (unlisted tiers = 0)
.tiers(...) gems, affix loot entries, invaders, elites Allowed world tiers
.dimensions(...) same Allowed dimensions
.biomes(...) same Allowed biomes or '#tag'
.stages(...) same Required game stages
.field(key, value) every builder One raw top-level JSON field
.json(object) every builder Merges raw JSON fields (advanced)

gems

Bonus classes: a loot category (helmet, chestplate, leggings, boots, shield, melee_weapon, trident, bow, breaker, shears; also 'apotheosis:shield'), a built-in group (armor, core_armor, lower_armor, light_weapon, ranged_weapon, tools, weapon_or_tool, weapons, anything) or a group declared with .gemClass(...). Bonus classes of one gem must not overlap.

Purity values: a list from cracked up [cracked, chipped, flawed, normal, flawless, perfect] (null skips a purity), or one number for every purity.

Method Description Default
.displayName(text) Name (lang item.apotheosis.gem.<id>)
.texture(texture) Gem texture Apotheosis' generic gem texture
.minPurity(purity) Lowest purity it drops at cracked
.unique([bool]) One per item false
.gemClass(key, ...categories) Declares a custom gem class (tooltip key gem_class.<key>)
.attribute(class, attribute, operation, values) Attribute bonus
.multiAttribute(class, descKey, m => m.modifier(attribute, operation, values)...) Several attributes in one bonus
.allStats(class, operation, values, ...attributes) Same values for several attributes
.durability(class, values) Durability bonus
.damageReduction(class, type, values) Types: physical, magic, fire, fall, explosion, projectile, lightning
.enchantment(class, enchantment[, mode], values) Mode single (default), existing, global
.mobEffect(class, effect, target, e => ...) Effect bonus; e.value(purity, duration, amplifier[, cooldown]), e.stacking(maxAmplifier)
.bonus(type, class) Any other bonus type (null class for fixed-class types)
.bonusField(key, value) Raw field of the last bonus
.bonusValue(purity, key, value) values.<purity>.<key> of the last bonus

Operations: add_value, add_multiplied_base, add_multiplied_total.

ApotheosisEvents.registry('gems', event => {
  event.create('kubejs:ruby')
    .displayName('Ruby Gem')                      // lang item.apotheosis.gem.kubejs:ruby
    .texture('kubejs:item/gems/ruby')             // gem texture
    .weight(40).quality(1.5)                      // same weight / quality in every world tier
    .dimensions('minecraft:the_nether')           // only drops in these dimensions
    .tiers('frontier', 'ascent', 'summit')        // only in these world tiers
    .stages('kubejs_nether_unlocked')             // only with these game stages
    .minPurity('chipped')                         // lowest purity it drops at
    .unique()                                     // one per item (also .unique(true / false))
    .gemClass('heavy', 'melee_weapon', 'breaker') // custom gem class (tooltip key gem_class.heavy)
    .attribute('heavy', 'minecraft:generic.attack_damage', 'add_value', [null, 1, 2, 3, 4, 6]) // attribute per purity
    .attribute('core_armor', 'minecraft:generic.max_health', 'add_value', [null, 2, 4, 6, 8, 12])
    .durability('shears', [0.1, 0.15, 0.2, 0.25, 0.3, 0.4])                  // durability bonus
    .damageReduction('helmet', 'fire', [null, null, null, 0.1, 0.15, 0.25])  // damage reduction of a type
    .enchantment('boots', 'minecraft:feather_falling', 'existing', [null, null, null, 1, null, 2]) // mode single | existing | global
    .enchantment('shield', 'minecraft:unbreaking', [1, 1, 2, 2, 3, 3])       // mode single
    .mobEffect('bow', 'minecraft:slowness', 'arrow_target', e => e           // potion effect bonus
      .value('flawed', 60, 0, 40)                 // purity, duration, amplifier, cooldown
      .value('perfect', 100, 1)                   // purity, duration, amplifier
      .stacking(3))                               // stacks on reapply up to amplifier 3
    .multiAttribute('trident', 'bonus.apotheosis:multi_attr.desc.and', m => m // several attributes in one bonus
      .modifier('minecraft:generic.attack_speed', 'add_multiplied_total', [0.05, 0.1, 0.15, 0.2, 0.25, 0.3])
      .modifier('minecraft:generic.movement_speed', 'add_multiplied_total', [-0.05, -0.05, -0.05, -0.05, -0.05, -0.05]))

  event.create('kubejs:prism')
    .tierWeight('ascent', 20, 1).tierWeight('summit', 40, 2) // per-tier weight and quality
    .tierWeight('pinnacle', 60)                   // per-tier weight only
    .biomes('#c:is_snowy')                        // only in these biomes (tag)
    .allStats('armor', 'add_multiplied_base', [0.01, 0.02, 0.03, 0.04, 0.05, 0.08],
      'minecraft:generic.armor', 'minecraft:generic.armor_toughness', 'minecraft:generic.max_health') // same values for several attributes
    .bonus('anti_gravity_arrow', 'bow')           // any other bonus type: type, gem class
      .bonusField('min_purity', 'flawless')       // raw field of the last bonus
    .bonus('leech_block', null)                   // fixed-class types take null
      .bonusValue('normal', 'heal_factor', 0.2)   // values.<purity>.<field> of the last bonus
      .bonusValue('normal', 'cooldown', 100)
    .bonus('bloody_arrow', null, { values: { perfect: { cooldown: 40 } } }) // fields as raw JSON: the only form this overload accepts
    .field('unique', false)                       // any raw top-level field
    .json({ min_purity: 'flawed' })               // raw JSON merged over the file: the only form .json accepts

  event.remove('apotheosis:core/ballast')         // remove a built-in gem
})

affix_loot_entries

Method Description Default
.item(item) Item that drops
.rarities(...rarities) Allowed rarities chosen by world tier
ApotheosisEvents.registry('affix_loot_entries', event => {
  event.create('kubejs:netherite_sword')
    .item('minecraft:netherite_sword')                   // item that drops
    .tierWeight('summit', 10, 1).tierWeight('pinnacle', 20, 2)
    .rarities('apotheosis:epic', 'apotheosis:mythic')    // allowed rarities
    .dimensions('minecraft:the_nether')

  event.create('kubejs:mace').item('minecraft:mace').weight(5)
  event.remove('apotheosis:golden_sword')
})

invaders and elites (shared boss methods)

Method Description Default
.name(text) / .nameComponent(Text...) / .randomName() Boss name
.bonusLoot(...lootTables) Extra loot tables
.gearSets(tier, ...sets) Gear set ids or '#tags' for one tier
.allTierGearSets(...sets) The same sets in every tier
.nbt(snbt) Entity NBT as SNBT ('{Glowing:1b}')
.mount(entity[, nbt]) Mount entity
.supportingEntity(entity[, x, y, z]) / (entity, nbt, x, y, z) Extra mobs with an offset
.finalizeSpawn(bool) Run vanilla spawn finalization
.spawnTypes(...) / .excludedSpawnTypes(...) Allowed / excluded spawn types (natural, spawn_egg...)
.spawnCondition(json) Raw spawn condition (advanced)

invaders only

Method Description Default
.entity(id) Entity type
.size(width, height) Spawn space needed 0.6 x 1.95
.stats(rarity, s => ...) One stats entry per rarity it can roll

elites only

Method Description Default
.entities(...ids) Entity ids or one '#tag'
.successChance(n) Chance a normal spawn becomes the elite 0.05
.stats(s => ...) Stats
.affixItem(chance, ...rarities) Chance of an affix item, optional rarities

Stats (s => s...)

Method Description
.enchantChance(n) Chance each non-affix item is enchanted
.enchantmentLevels(primary, secondary) Enchantment levels of the affix item / other items
.effect(effect, amplifier[, chance]) Potion effect
.attribute(attribute, operation, value) / (attribute, operation, min, max) Attribute modifier (fixed or random)
ApotheosisEvents.registry('invaders', event => {
  event.create('kubejs:frost_king')
    .entity('minecraft:stray')                    // entity type
    .size(0.75, 2.2)                              // spawn space needed
    .name('The Frost King')                       // fixed name
    .tierWeight('frontier', 30, 0.1).tierWeight('ascent', 50, 0.1).tierWeight('summit', 50, 0.1)
    .dimensions('minecraft:overworld').biomes('#c:is_snowy')
    .bonusLoot('apotheosis:entity/boss_drops')    // extra loot tables
    .gearSets('frontier', '#frontier_ranged')     // gear sets for one tier
    .gearSets('ascent', '#ascent_ranged', 'kubejs:frost_gear')
    .allTierGearSets('kubejs:frost_gear')         // the same sets in every tier
    .nbt('{Glowing:1b}')                          // entity NBT as SNBT
    .mount('minecraft:skeleton_horse')            // mount entity
    .supportingEntity('minecraft:stray', 1, 0, 1) // extra mob with an x, y, z offset
    .finalizeSpawn(false)                         // skip vanilla spawn finalization
    .excludedSpawnTypes('spawn_egg')              // spawn types it can't use
    .stats('apotheosis:rare', s => s              // stats for one rarity
      .enchantChance(0.3)                         // chance each non-affix item is enchanted
      .enchantmentLevels(25, 15)                  // primary / secondary enchantment levels
      .effect('minecraft:resistance', 0)          // effect, amplifier
      .effect('minecraft:speed', 1, 0.5)          // effect, amplifier, chance
      .attribute('minecraft:generic.max_health', 'add_value', 40, 70)   // random min..max
      .attribute('minecraft:generic.knockback_resistance', 'add_value', 0.5)) // fixed value
    .stats('apotheosis:epic', s => s
      .enchantmentLevels(35, 20)
      .attribute('minecraft:generic.max_health', 'add_value', 70, 100)
      .attribute('apothic_attributes:projectile_damage', 'add_multiplied_base', 0.3, 0.6))

  event.create('kubejs:nether_raider')
    .entity('minecraft:piglin_brute')
    .weight(20).quality(1)
    .randomName()                                 // random generated name
    .tiers('ascent', 'summit')
    .stages('kubejs_nether_unlocked')
    .mount('minecraft:hoglin', '{IsImmuneToZombification:1b}')               // mount entity with NBT
    .supportingEntity('minecraft:piglin')                                    // extra mob, no offset
    .supportingEntity('minecraft:piglin', '{IsImmuneToZombification:1b}', 2, 0, 0) // extra mob with NBT and offset
    .spawnTypes('natural')                        // only these spawn types
    .spawnCondition({ type: 'apotheosis:spawn_type', spawn_types: ['chunk_generation'] }) // raw JSON: the only form this method accepts
    .stats('apotheosis:rare', s => s.enchantmentLevels(20, 10))

  event.create('kubejs:named_knight')
    .entity('minecraft:vindicator')
    .weight(10)
    .nameComponent(Text.translate('boss.kubejs.knight').aqua()) // name as a text component

  event.remove('apotheosis:overworld/bogged')
})

ApotheosisEvents.registry('elites', event => {
  event.create('kubejs:pig_lord')
    .entities('minecraft:pig')                    // entity ids or one '#tag'
    .successChance(0.02)                          // chance a normal spawn becomes the elite
    .name('Pig Lord').weight(100)
    .supportingEntity('minecraft:pig')
    .affixItem(0.5, 'apotheosis:rare', 'apotheosis:epic')   // chance of an affix item, optional rarities
    .stats(s => s                                 // elite stats (no rarity)
      .attribute('minecraft:generic.max_health', 'add_value', 60)
      .attribute('minecraft:generic.scale', 'add_value', 0.5)
      .effect('minecraft:fire_resistance', 0))
})

gear_sets

Picked by id or by tag ('#frost').

Method Description
.weight(n) / .quality(q) Weight and quality
.tags(...tags) Tags the set belongs to
.mainhand(item, weight[, dropChance]) Mainhand option (repeat for several)
.offhand(...), .helmet(...), .chestplate(...), .leggings(...), .boots(...) Same for each slot
ApotheosisEvents.registry('gear_sets', event => {
  event.create('kubejs:frost_gear')
    .weight(20).quality(1)                        // weight and quality
    .tags('frost', 'ascent_ranged')               // bosses use them as '#frost'
    .mainhand('minecraft:bow', 10)                // item, weight
    .mainhand('minecraft:crossbow', 5, 0.1)       // item, weight, drop chance
    .offhand('minecraft:snowball', 1)             // offhand option
    .helmet('minecraft:chainmail_helmet', 10)     // helmet option
    .chestplate('minecraft:iron_chestplate', 10)  // chestplate option
    .leggings('minecraft:chainmail_leggings', 10) // leggings option
    .boots('minecraft:leather_boots', 10)         // boots option
})

rarities

Also add a reforging recipe and a salvaging recipe for its material.

Method Description
.displayName(text) Name (lang rarity.<id>)
.color('#RRGGBB' | n) Color
.material(item) Reforging / salvaging material
.sortIndex(n) Order (built-in: common 300 ... mythic 700)
.invaderSound(sound) Sound when an invader of this rarity spawns
.affix(type) One guaranteed affix: stat, basic_effect, ability
.chancedAffix(chance, type) Affix with a chance
.sockets(min, max) Socket range
.durability(min, max) Durability range
.componentRule(component, value) apotheosis:component rule
.rule(json) Any raw rule (advanced)
ApotheosisEvents.registry('rarities', event => {
  event.create('kubejs:legendary')
    .displayName('Legendary')                     // lang rarity.kubejs:legendary
    .color('#FF4500')                             // or 0xFF4500
    .material('minecraft:nether_star')            // reforging / salvaging material
    .sortIndex(800)                               // order (common 300 ... mythic 700)
    .invaderSound('minecraft:entity.wither.spawn') // sound when an invader of this rarity spawns
    .tierWeight('summit', 20, 2).tierWeight('pinnacle', 60, 3)
    .affix('stat').affix('stat').affix('stat')    // guaranteed affixes: stat | basic_effect | ability
    .affix('basic_effect').affix('ability')
    .chancedAffix(0.5, 'ability')                 // affix with a 50% chance
    .sockets(2, 4)                                // socket range
    .durability(0.4, 0.7)                         // durability range
    .componentRule('minecraft:rarity', 'epic')    // apotheosis:component rule
    .rule({ type: 'apotheosis:component', components: { 'minecraft:fire_resistant': {} } }) // raw JSON: the only form .rule accepts
})

affixes

Method Description Default
.attribute(attribute, operation) Attribute affix
.mobEffect(effect, target) Mob effect affix (e.g. target attack_target)
.damageReduction(type) Damage reduction affix
.enchantment(enchantment[, mode]) Enchantment affix: single, existing, global single
.type(type) Any other affix type (combine with .field)
.affixType(type) stat, basic_effect, ability stat for attributes, basic_effect otherwise
.categories(...) Loot categories (empty = all) all
.exclusiveWith(...affixes) Affixes it can't roll with
.value(rarity, value) / (rarity, min, max[, step]) Value per rarity
.effectValue(rarity, minDuration, maxDuration, amplifier[, cooldown]) Mob effect values per rarity
.stacking(limit) Mob effect stacks up to this amplifier
.displayName(text) / .suffix(text) Prefix name / suffix name
ApotheosisEvents.registry('affixes', event => {
  event.create('kubejs:armor/attribute/stalwart')
    .attribute('minecraft:generic.armor_toughness', 'add_value')   // attribute affix
    .categories('chestplate', 'leggings')                         // loot categories (empty = all)
    .value('apotheosis:rare', 1, 2)                               // min, max
    .value('apotheosis:epic', 2, 4, 0.5)                          // min, max, step
    .value('apotheosis:mythic', 5)                                // constant
    .affixType('stat')                                            // stat | basic_effect | ability
    .weight(25).quality(0.1)
    .exclusiveWith('apotheosis:armor/attribute/adamantine')       // can't roll together
    .displayName('Stalwart').suffix('of the Bulwark')             // prefix name / suffix name

  event.create('kubejs:sword/mob_effect/chilling')
    .mobEffect('minecraft:slowness', 'attack_target')             // mob effect affix
    .categories('melee_weapon')
    .effectValue('apotheosis:uncommon', 40, 80, 0, 200)          // duration min, max, amplifier, cooldown
    .effectValue('apotheosis:epic', 60, 100, 1)                  // without cooldown
    .stacking(3)                                                  // stacks up to amplifier 3
    .displayName('Chilling').suffix('of Frost')

  event.create('kubejs:armor/dmg_reduction/insulated')
    .damageReduction('lightning')                                 // damage reduction affix
    .categories('helmet', 'chestplate')
    .value('apotheosis:rare', 0.1, 0.2).value('apotheosis:mythic', 0.25, 0.4)
    .displayName('Insulated').suffix('of Grounding')

  event.create('kubejs:breaker/enchantment/delving')
    .enchantment('minecraft:efficiency', 'existing')              // single | existing | global
    .categories('breaker')
    .value('apotheosis:epic', 1, 2).value('apotheosis:mythic', 2, 3)
    .affixType('ability')

  event.create('kubejs:tool/enchantment/mending')
    .enchantment('minecraft:mending')                             // mode single
    .value('apotheosis:mythic', 1)

  event.create('kubejs:breaker/telepathic')
    .type('apotheosis:telepathic')                                // any other affix type
    .affixType('basic_effect')
    .field('rarities', ['apotheosis:epic', 'apotheosis:mythic'])  // raw field

  event.remove('apotheosis:armor/attribute/adamantine')
})

Recipes (server)

ApotheosisIngredients

Method Matches
ApotheosisIngredients.affixItem(rarity) Any affix item of that rarity
ApotheosisIngredients.gem(purity) Any gem of that purity
ApotheosisIngredients.gem(purity, ...gemIds) Those gems at that purity
ApotheosisIngredients.spawnEgg() Any spawn egg

Salvaging

event.recipes.apotheosis.salvaging(input) with chained outputs, or event.recipes.apotheosis.salvaging(outputs, input).

Method Description
.output(item, min, max) Output with a random count
.output(item, count) Output with a fixed count
.outputs([...]) Replaces the output list

Outputs given first: 'item' (1), '3x item' (1-3), '0-2x item' (0-2).

Reforging

event.recipes.apotheosis.reforging(rarity[, materialCost, sigilCost, levelCost])

Method Description Default
.materialCost(1-99) Rarity material cost 2
.sigilCost(0-99) Sigil of Rebirth cost 1
.levelCost(n) (alias .xpCost) Experience levels 10
.tables(...) Allowed blocks, or one '#tag' simple_reforging_table, reforging_table

Gem cutting

event.recipes.apotheosis.purity_upgrade(purity, [leftAlternatives], [rightAlternatives]) — sized ingredients. event.recipes.apotheosis.basic_gem_cutting(output, base, [top], [left], [right]) — sized alternatives.

Smithing and crafting

Signature Description
sized_upgrade_recipe(result, template, base, sizedAddition) Smithing upgrade with an addition count
add_sockets(input[, maxSockets]) Smithing item that adds a socket; .maxSockets(0-16), default 3
potion_charm_crafting(pattern, key) Shaped pattern with a potion; the result is a charm of that potion
socketing(), withdrawal(), supremacy(), unnaming(), malice() Special recipes without fields (re-add them after removing the built-in ones)
ServerEvents.recipes(event => {
  event.recipes.apotheosis.salvaging('minecraft:chainmail_helmet')
    .output('minecraft:chain', 1, 3)              // item, min, max
    .output('minecraft:iron_nugget', 2)           // item, fixed count
  event.recipes.apotheosis.salvaging('minecraft:iron_horse_armor')
    .outputs(['2-5x minecraft:iron_ingot', 'minecraft:leather']) // replaces the output list
  event.recipes.apotheosis.salvaging(['1-4x apotheosis:arcane_sands', '0-1x minecraft:nether_star'], ApotheosisIngredients.affixItem('kubejs:legendary')) // any affix item of that rarity
  event.recipes.apotheosis.salvaging('2x apotheosis:gem_dust', ApotheosisIngredients.gem('flawless'))                          // any gem of that purity
  event.recipes.apotheosis.salvaging('apotheosis:gem_dust', ApotheosisIngredients.gem('perfect', 'apotheosis:core/splendor'))  // those gems at that purity
  event.recipes.apotheosis.salvaging('minecraft:egg', ApotheosisIngredients.spawnEgg())                                        // any spawn egg

  event.recipes.apotheosis.reforging('kubejs:legendary', 3, 5, 40)
    .tables('apotheosis:reforging_table')         // allowed blocks (or one '#tag')
  event.recipes.apotheosis.reforging('apotheosis:rare')
    .materialCost(2)                              // rarity material cost
    .sigilCost(1)                                 // sigil cost
    .levelCost(15)                                // experience levels (alias: .xpCost())

  event.recipes.apotheosis.purity_upgrade('chipped', ['3x apotheosis:gem_dust'], ['9x minecraft:amethyst_shard', '3x minecraft:diamond'])
  event.recipes.apotheosis.basic_gem_cutting('minecraft:diamond', 'minecraft:coal_block', ['4x apotheosis:gem_dust'], ['minecraft:blaze_powder'], ['minecraft:ghast_tear'])

  event.recipes.apotheosis.sized_upgrade_recipe('minecraft:diamond_pickaxe', 'apotheosis:diamond_upgrade_smithing_template', 'minecraft:golden_pickaxe', '3x #c:gems/diamond')

  event.recipes.apotheosis.add_sockets('minecraft:echo_shard', 4)
  event.recipes.apotheosis.add_sockets('apotheosis:sigil_of_socketing').maxSockets(2) // socket limit (0-16)

  event.recipes.apotheosis.potion_charm_crafting(['GPG', 'GPG', 'GPG'], { G: 'minecraft:gold_ingot', P: 'minecraft:potion' })

  event.recipes.apotheosis.socketing()            // special recipes without fields
  event.recipes.apotheosis.withdrawal()
  event.recipes.apotheosis.supremacy()
  event.recipes.apotheosis.unnaming()
  event.recipes.apotheosis.malice()

  event.remove('apotheosis:salvaging/other/chain_armor')
})


Applied Energistics 2 integration

Recipes for every AE2 machine and in-world process, new storage cells, storage components and spatial cells, and control over what meteorites contain and how they generate. AE2 19.x ships no JEI plugin, so KubeJS Infinity Extras adds JEI categories for the inscriber, charger, transform, entropy manipulator and matter cannon.

Required mods: Applied Energistics 2 19.2.x (+ GuideME). KubeJS Infinity Extras loads this only when AE2 is installed.

Part Script folder
AE2Events.registry(...) (cells, components, spatial cells) startup_scripts
event.recipes.ae2.* recipes server_scripts
AE2Events.meteorite(...) server_scripts

Extra behavior: items dropped into lava for a lava transform recipe are no longer burned (AE2 only protected them from explosions).


Registries (startup)

Every registry accepts the usual KubeJS item options (.displayName(), .rarity(), .texture(), ...). Names: .displayName('...') sets the en_us name, .lang('key') uses your own translation key; with neither, the en_us name is generated from the id. Plain ids get the kubejs namespace.

Storage cells — AE2Events.registry('storage_cells', ...)

Real AE2 cells: they work in drives, ME chests and the cell workbench, with LED and byte/type tooltips.

Method Description Default
.itemCell() Stores items yes
.fluidCell() Stores fluids -
.keyType(id) Any AE key type id ('ae2:i' items, 'ae2:f' fluids, add-on types) 'ae2:i'
.kilobytes(n) / .capacity(n) Capacity in kilobytes 1
.bytesPerType(n) Bytes used per stored type kilobytes * 8
.totalTypes(n) Types per cell, 1-63 63 items, 18 others
.idleDrain(n) AE/t used in a drive 0.5 (1k) ... 2.5 (256k)
.driveModel(model) Model shown inside drives closest AE2 tier
.upgrade(item, max) Extra accepted upgrade card and its max count -
.noDefaultUpgrades() No fuzzy / inverter / equal distribution / void cards default cards on
.texture(path) Item texture AE2 housing of the closest tier + LED layer
.lang(key) Own translation key generated name

Storage components — AE2Events.registry('storage_components', ...)

Method Description Default
.kilobytes(n) / .capacity(n) Capacity in kilobytes 1
.texture(path) Item texture closest AE2 component
.lang(key) Own translation key generated name

Spatial cells — AE2Events.registry('spatial_cells', ...)

Method Description Default
.size(n) / .maxRegion(n) Largest n x n x n region 2
.texture(path) Item texture AE2 texture
.lang(key) Own translation key generated name

The same builders are available in StartupEvents.registry('item', ...) with the types ae2:storage_cell, ae2:storage_component and ae2:spatial_cell.

// kubejs/startup_scripts/ae2.js
AE2Events.registry('storage_cells', event => {
  event.create('kubejs:item_storage_cell_1m')                 // new cell id
    .displayName('1M ME Item Storage Cell')                   // en_us name
    .itemCell()                                               // stores items (default)
    .kilobytes(1024)                                          // capacity in kB
    .bytesPerType(8192)                                       // bytes used per type
    .totalTypes(63)                                           // max types, 1-63
    .idleDrain(3.0)                                           // AE/t in a drive
    .driveModel('ae2:block/drive/cells/256k_item_cell')       // look inside drives
    .upgrade('ae2:speed_card', 1)                             // extra accepted card, max 1

  event.create('kubejs:fluid_storage_cell_1m')
    .displayName('1M ME Fluid Storage Cell')
    .fluidCell()                                              // stores fluids
    .capacity(1024)                                           // alias of .kilobytes()
    .texture('kubejs:item/fluid_storage_cell_1m')             // own item texture

  event.create('kubejs:tiny_item_cell')
    .lang('ae2cells.kubejs.tiny_cell')                        // own translation key
    .keyType('ae2:i')                                         // AE key type: 'ae2:i' items, 'ae2:f' fluids
    .kilobytes(1)
    .totalTypes(5)
    .noDefaultUpgrades()                                      // no fuzzy / inverter / distribution / void cards
})

AE2Events.registry('storage_components', event => {
  event.create('kubejs:cell_component_1m')
    .lang('ae2cells.kubejs.component_1m')                     // own translation key
    .kilobytes(1024)                                          // capacity in kB
  event.create('kubejs:cell_component_16m')
    .displayName('16M ME Storage Component')
    .capacity(16384)                                          // alias of .kilobytes()
    .texture('kubejs:item/cell_component_16m')                // own item texture
})

AE2Events.registry('spatial_cells', event => {
  event.create('kubejs:spatial_storage_cell_64')
    .lang('ae2cells.kubejs.spatial_64')                       // own translation key
    .size(64)                                                 // largest 64x64x64 region
  event.create('kubejs:spatial_storage_cell_32')
    .maxRegion(32)                                            // alias of .size()
    .texture('kubejs:item/spatial_storage_cell_32')           // own item texture
})

StartupEvents.registry('item', event => {
  event.create('kubejs:item_storage_cell_4m', 'ae2:storage_cell').kilobytes(4096)          // cell type
  event.create('kubejs:cell_component_4m', 'ae2:storage_component').kilobytes(4096)        // component type
  event.create('kubejs:spatial_storage_cell_256', 'ae2:spatial_cell').size(256)            // spatial type
})

Recipes (server)

Inscriber

event.recipes.ae2.inscriber(result, middle[, mode])

Method Description Default
.top(ingredient) Top press slot empty
.bottom(ingredient) Bottom press slot empty
.middle(ingredient) Middle slot (also the 2nd argument) -
.inscribe() Presses are kept yes
.press() Every slot is used up -
.mode('inscribe' | 'press') Same as the two above 'inscribe'
event.recipes.ae2.inscriber('kubejs:cell_component_1m', 'ae2:cell_component_256k')
  .top('ae2:engineering_processor')       // top slot
  .bottom('ae2:calculation_processor')    // bottom slot
  .press()                                // every slot is used up

event.recipes.ae2.inscriber('ae2:printed_silicon', '#c:silicon')
  .top('ae2:silicon_press')               // press kept (inscribe mode is the default)

event.recipes.ae2.inscriber('4x ae2:sky_dust', 'ae2:sky_stone_block')
  .inscribe()                             // presses kept, explicit

event.recipes.ae2.inscriber('ae2:logic_processor', 'minecraft:redstone', 'press')   // mode as 3rd argument
  .top('ae2:printed_logic_processor')
  .bottom('ae2:printed_silicon')

event.recipes.ae2.inscriber('ae2:printed_calculation_processor', 'minecraft:quartz')
  .middle('#c:gems/certus_quartz')        // replace the middle slot
  .top('ae2:calculation_processor_press')
  .mode('inscribe')                       // 'inscribe' or 'press'

Charger

event.recipes.ae2.charger(result, ingredient) — no options.

event.recipes.ae2.charger('minecraft:glowstone_dust', 'minecraft:redstone')   // redstone charged into glowstone

In-world transform

event.recipes.ae2.transform(result, [ingredients]) — items thrown together turn into the result.

Method Description Default
.water() Thrown into water yes
.fluid(tag) Dropped into a fluid of this tag (# optional) -
.explosion() Items caught in an explosion -
event.recipes.ae2.transform('2x ae2:fluix_crystal', ['ae2:charged_certus_quartz_crystal', 'minecraft:redstone', 'minecraft:quartz'])  // water by default

event.recipes.ae2.transform('minecraft:nether_star', ['ae2:singularity', 'minecraft:wither_skeleton_skull'])
  .explosion()                            // items caught in an explosion

event.recipes.ae2.transform('minecraft:magma_cream', ['minecraft:slime_ball'])
  .fluid('#minecraft:lava')               // dropped into a fluid of this tag

event.recipes.ae2.transform('minecraft:clay_ball', ['minecraft:sand'])
  .water()                                // explicit water

Entropy manipulator

event.recipes.ae2.entropy(outputBlock, inputBlock) or event.recipes.ae2.entropy(inputBlock)

Method Description Default
.mode('heat' | 'cool') Manipulator mode 'heat'
.heat() / .cool() Short for .mode('heat') / .mode('cool') -
.inputBlock(block) Input block 1st/2nd argument
.inputFluid(fluid) Input is a fluid instead of a block -
.inputProperty(name, value) Accepted block state value (single value or list of values) any
.inputPropertyRange(name, min, max) Accepted inclusive range of a property any
.outputBlock(block) Resulting block 1st argument
.outputFluid(fluid) Result is a fluid -
.outputProperty(name, value) Block state value set on the result -
.keepProperties() Copy matching state (for example axis) from the input off
.drops(items...) Items dropped as well none
event.recipes.ae2.entropy('minecraft:netherrack', 'minecraft:magma_block')
  .mode('cool')                           // 'heat' (default) or 'cool'

event.recipes.ae2.entropy('minecraft:sponge', 'minecraft:wet_sponge')
  .heat()                                 // short for .mode('heat')
  .drops('minecraft:water_bucket')        // items dropped as well

event.recipes.ae2.entropy('minecraft:oak_log')
  .heat()
  .outputBlock('minecraft:stripped_oak_log')   // resulting block
  .keepProperties()                       // copy matching state (axis) from the input

event.recipes.ae2.entropy('minecraft:stone')
  .cool()                                 // short for .mode('cool')
  .inputBlock('minecraft:cobblestone')    // replace the input block
  .outputBlock('minecraft:stone')

event.recipes.ae2.entropy('minecraft:water')
  .cool()
  .inputFluid('minecraft:water')          // input is a fluid
  .outputBlock('minecraft:blue_ice')

event.recipes.ae2.entropy('minecraft:wheat')
  .heat()
  .inputProperty('age', 7)                // single accepted value
  .outputBlock('minecraft:wheat')
  .outputProperty('age', 0)               // state set on the result
  .drops('2x minecraft:bread')

event.recipes.ae2.entropy('minecraft:carrots')
  .cool()
  .inputPropertyRange('age', 0, 6)        // inclusive range
  .outputBlock('minecraft:carrots')
  .outputProperty('age', 7)

event.recipes.ae2.entropy('minecraft:snow')
  .heat()
  .inputProperty('layers', ['1', '2', '3'])   // list of accepted values
  .outputFluid('minecraft:water')         // result is a fluid

Matter cannon ammo

event.recipes.ae2.matter_cannon(ammo[, weight])

Method Description Default
.weight(n) Projectile weight (AE2 uses atomic mass) 32
event.recipes.ae2.matter_cannon('#c:nuggets/uranium', 238.03)   // weight as 2nd argument
event.recipes.ae2.matter_cannon('minecraft:flint')
  .weight(12)                             // projectile weight

Quartz cutting knife

event.recipes.ae2.quartz_cutting(result, [ingredients]) — shapeless crafting; the knife takes damage instead of being used up.

event.recipes.ae2.quartz_cutting('4x minecraft:stick', ['ae2:certus_quartz_cutting_knife', '#minecraft:planks'])   // knife is damaged, not used up

Storage cell upgrade

event.recipes.ae2.storage_cell_upgrade(resultCell, inputCell, inputComponent, resultComponent) — crafting the cell with a bigger component swaps them and gives the old component back.

event.recipes.ae2.storage_cell_upgrade('kubejs:item_storage_cell_1m', 'ae2:item_storage_cell_256k', 'kubejs:cell_component_1m', 'ae2:cell_component_256k')   // 256k cell + 1M component -> 1M cell, 256k component back

Storage cell disassembly

event.recipes.ae2.storage_cell_disassembly([items], cell) — shift + right click an empty cell to split it.

event.recipes.ae2.storage_cell_disassembly(['ae2:item_cell_housing', 'kubejs:cell_component_1m'], 'kubejs:item_storage_cell_1m')   // empty cell -> housing + component

Crafting unit transform

event.recipes.ae2.crafting_unit_transform(upgradedBlock, upgradeItem) — right click a crafting unit with the item.

event.recipes.ae2.crafting_unit_transform('ae2:256k_crafting_storage', 'kubejs:cell_component_1m')   // right click a crafting unit with the component

Meteorites — AE2Events.meteorite(event => ...) (server)

Changes what the mysterious cube gives, can place a container instead of the cube, and changes how new meteorites generate. It runs on every /reload. The loot starts with AE2's own: every press of #ae2:inscriber_presses plus the guide (not with silk touch). Loot changes apply to every cube mined from now on; container and shape changes only to meteorites generated after the change.

Loot

Method Description Default
.addItem(item[, count]) Add an entry ('3x item' works too) -
.removeItem(item) Remove an entry (removing one press splits the press tag into AE2's 4 presses) -
.replaceItem(from, to) Replace an entry, keeping its count / chance / weight -
.clear() Remove every entry (also AE2's presses and guide) -
.count(n) / .count(min, max) Count of the last added entry (random, inclusive) 1
.chance(f) Chance (0-1) of the last added entry 1
.weight(w) Move the last added entry into the weighted pool -
.expand() For a tag entry: one random item of the tag (without it: all of them) off
.rolls(n) / .rolls(min, max) Entries picked from the weighted pool 1
.silkTouch(bool) false: silk touch no longer gives the cube itself true

Container

Method Description Default
.useChest() A chest instead of the cube, filled with the loot above cube
.container(block) Any block with an inventory (barrels, shulker boxes, crates) -
.useCube() Back to the mysterious cube yes
.chestLootTable(id) Fill the container from another loot table kjsinfinityextras:chests/ae2_meteorite
.displayName(name) / .lang(key) Container name block name

Shape (new meteorites only)

Method Description Default
.meteor_crater(bool) false: no crater (and no crater lake) true
.meteor_mysterious(bool) false: no cube or container in the center true
.meteor_budding(bool) false: no budding certus quartz and no quartz buds true
.meteor_quartzblock(bool) false: no certus quartz blocks inside true
.meteor_dimension(values...) Extra dimensions: dimension id, '#biome_tag' or biome id overworld
// kubejs/server_scripts/ae2.js — loot in a chest
AE2Events.meteorite(event => {
  event
    .removeItem('ae2:calculation_processor_press')        // remove one entry
    .removeItem('ae2:guide')
    .addItem('minecraft:diamond', 2)                      // always 2 diamonds
    .addItem('3x minecraft:iron_ingot')                   // '<count>x <item>' works too
    .addItem('ae2:sky_dust').count(2, 6)                  // random count, inclusive
    .addItem('minecraft:ender_pearl').count(4)            // fixed count
    .addItem('minecraft:emerald').chance(0.5)             // 50 % chance
    .replaceItem('ae2:silicon_press', 'ae2:singularity')  // keeps count / chance / weight
    .addItem('minecraft:nether_star').weight(1)           // into the weighted pool
    .addItem('#c:gems').expand().weight(5)                // one random item of the tag
    .addItem('minecraft:golden_apple').count(1, 2).weight(10)
    .rolls(1, 2)                                          // 1-2 picks from the weighted pool
    .useChest()                                           // chest instead of the cube
    .displayName('Meteorite Cache')                       // container name
    .meteor_crater(true)                                  // false = no crater
    .meteor_mysterious(true)                              // false = nothing in the center
    .meteor_budding(true)                                 // false = no budding quartz
    .meteor_quartzblock(true)                             // false = no certus quartz blocks
    .meteor_dimension('minecraft:the_end')                // extra dimension (or '#biome_tag' / biome id)
})
// alternative: a barrel filled from another loot table, cube settings
AE2Events.meteorite(event => {
  event
    .clear()                                              // drop every entry, AE2's presses too
    .addItem('ae2:singularity')
    .rolls(2)                                             // fixed number of weighted picks
    .silkTouch(false)                                     // silk touch no longer gives the cube itself
    .container('minecraft:barrel')                        // any block with an inventory
    .chestLootTable('minecraft:chests/simple_dungeon')    // fill it from this loot table instead
    .lang('kubejs.ae2.meteorite_cache')                   // container name from a translation key
})

// or switch back to the mysterious cube (use only one of these meteorite scripts):
AE2Events.meteorite(event => {
  event.useCube()                                         // back to the mysterious cube
})


Botany Pots integration (plus Mystical and Tiers)

Adds schemas for every Botany Pots recipe type (crop, block-derived crop, soil, block-derived soil, fertilizer, pot interaction) with chained display and render options, registers custom pots, edits the Botany Pots: Mystical Agriculture config and adds mystical_crop recipes, and changes Botany Pots Tiers multipliers and tiered pots.

Required mods:

  • Botany Pots 21.1.x (+ Bookshelf, Prickle) — KubeJS Infinity Extras loads this only when Botany Pots is installed.
  • Optional: Botany Pots: Mystical Agriculture 21.1.x (+ Mystical Agriculture) for BotanyPotsMysticalEvents and botanypotsmystical.mystical_crop.
  • Optional: Botany Pots Tiers 7.0.x for BotanyPotsTiersEvents.

Works together with the "KubeJS Botany Pots" addon: its DisplayState, DropItem and GrowthAmount bindings can be passed to every recipe here. crop, soil and fertilizer accept everything that addon accepts, plus the options it is missing.

Part Script folder
BotanyPotsEvents.registry('pots'), block type botanypots:pot startup_scripts
BotanyPotsMysticalEvents.registry('config') startup_scripts
BotanyPotsTiersEvents.registry('tiers' / 'pots'), block type botanypotstiers:pot startup_scripts
event.recipes.botanypots.*, event.recipes.botanypotsmystical.* server_scripts

Registry: pots

BotanyPotsEvents.registry('pots', event => event.create(id)) — real Botany Pots (same menu, block entity, renderer and hopper behaviour as the built-in ones). Plain names get the kubejs namespace. Also available as block type botanypots:pot in StartupEvents.registry('block', ...).

Method Description Default
.potType(type) 'basic' (harvest by hand), 'hopper' (auto-harvest), 'waxed' (decorative) from the id (hopper / waxed in the id), else basic
.hopper() / .waxed() Same as .potType('hopper') / .potType('waxed') —
.material(texture) Side / bottom texture minecraft:block/terracotta
.materialTop(texture) Rim texture same as material
.growthModifier(f) Extra growth speed, added to the soil's modifier 0
.yieldModifier(f) Extra yield, added to the crop's base yield 0

Every normal KubeJS block option also works (.displayName(), .hardness()...).

// startup_scripts
BotanyPotsEvents.registry('pots', event => {
  event.create('kubejs:gold_botany_pot')
    .potType('basic')                                   // harvested by hand
    .material('minecraft:block/gold_block')             // side / bottom texture
    .materialTop('minecraft:block/gold_block')          // rim texture
    .growthModifier(0.5)                                // +0.5 growth speed
    .yieldModifier(0.25)                                // +0.25 yield
    .displayName('Golden Botany Pot')                   // normal KubeJS block option

  event.create('kubejs:gold_hopper_botany_pot')         // "hopper" in the id = hopper pot
    .material('minecraft:block/gold_block')
    .materialTop('botanypots:block/terracotta_pot_top')
    .growthModifier(0.5)

  event.create('kubejs:iron_auto_pot')
    .hopper()                                           // same as .potType('hopper')
    .material('minecraft:block/iron_block')

  event.create('kubejs:gold_waxed_botany_pot')
    .waxed()                                            // same as .potType('waxed'): decorative
    .material('minecraft:block/gold_block')
})

StartupEvents.registry('block', event => {
  event.create('kubejs:obsidian_botany_pot', 'botanypots:pot') // same builder as block type
    .material('minecraft:block/obsidian')
    .hardness(20)                                       // normal KubeJS block option
})

Craft the pots with normal recipes (hopper / waxed versions like Botany Pots' own: pot + hopper, pot + honeycomb).


Method names

The Java declares the recipe function names in snake_case (for example grow_time, growth_time, time). This page uses the camelCase forms that the Recipe Maker writes (.growTime()), but the snake_case names (.grow_time(), .light_level(), .pot_predicate(), .soil_item()...) also work.

Displays (crop, block_derived_crop, soil, block_derived_soil)

A display is built with chained methods:

Method Description Default
.type(id) Display type: botanypots:simple, botanypots:aging, botanypots:transitional, botanypots:textured_cube, botanypots:entity simple (aging on crops when the block has an age property)
.blockState(state) / .block_state(state) Block of simple / aging displays: 'minecraft:lava', 'minecraft:farmland[moisture=7]' —
.texture(id) Texture of a textured_cube display —
.entity(idOrNbt) Entity of an entity display —
.spinSpeed(n) Entity spin speed 0
.shouldTick(bool) Whether the entity ticks true
.phases(...values) Transitional display: one display per growth phase —
.display(value) Replaces every display (block id, 'block[state]', list or DisplayState) —
.addDisplay(value) Appends a display —

Render options (simple, aging, textured_cube; entity displays support only scale and offset):

Method Description Default
.renderFluid([bool]) Render the fluid of the block state (no argument = true) false
.scale(n) / .scale(x, y, z) Scale 0.625 (entity 0.5)
.offset(x, y, z) Offset 0, 0, 0
.rotation(...rots) / .rotations(...) 'x_90', 'y_180', 'z_270'..., applied in order none
.color(c) / .tint(c) Tint: '#RRGGBB', '#AARRGGBB', 0xRRGGBB or (r, g, b[, a]) none
.faces(...faces) Rendered faces: up, down, north, south, east, west all
.options(json) / .renderOptions(json) Several options at once using the JSON names (render_options) —

Rules:

  • Option methods edit the display being built, or the last display already set. On block-derived recipes without a display they set the options of the derived display.
  • Calling .type() or .blockState() again once the current display has one starts a new display: on crops it stacks on the previous ones, on soils it replaces it (soils have one display). A type without a block (entity, textured_cube, transitional) after .blockState() also starts a new display.

Crop

event.recipes.botanypots.crop(input[, display]) event.recipes.botanypots.crop(input, soil, display[, drops[, growTime[, yield]]])

drops: '2x item', a list of those, or a DropItem.

Method Description Default
.soil(ingredient) / .soils(...) Soils the crop grows on #botanypots:soil/dirt
.drop(item[, chance]) Appends an item drop (chance 0-1) chance 1
.entityLootDrop(entity) Appends a mob loot drop (botanypots:entity) —
.lootTableDrop(table) Appends a loot table drop (botanypots:loot_table) —
.addDrop(value) Appends any drop value —
.drops(list) Replaces every drop —
.growTime(ticks) / .growthTime() / .time() Growth time 1200
.baseYield(f) / .yield(f) Base yield 1
.yieldScale(f) Multiplies pot / soil / attribute yield bonuses 1
.lightLevel(n) / .light(n) Light emitted while growing, 0-15 0
.function(id) / .onHarvest(id) / .harvestFunction(id) mcfunction run on harvest —
.potPredicate(value) / .pot(value) Pots allowed: block id, #tag or vanilla block predicate any pot
.input(ingredient) / .seed(ingredient) Changes the seed item —

Plus every display and render method above.

// server_scripts
ServerEvents.recipes(event => {
  event.recipes.botanypots.crop('minecraft:diamond', 'minecraft:wheat')  // seed, display block
    .soil('#botanypots:soil/dirt')              // soils it grows on (alias: .soils())
    .drop('minecraft:diamond')                  // item drop, chance 1
    .drop('minecraft:emerald', 0.25)            // item drop, 25% chance
    .growTime(2400)                             // ticks to grow (aliases: .growthTime(), .time())
    .baseYield(1.5)                             // base yield (alias: .yield())
    .yieldScale(2)                              // multiplies pot / soil / attribute yield bonuses
    .lightLevel(7)                              // light while growing (alias: .light())
    .function('kubejs:on_diamond_harvest')      // mcfunction on harvest (aliases: .onHarvest(), .harvestFunction())
    .potPredicate('#botanypots:botany_pots')    // pots allowed (alias: .pot())

  event.recipes.botanypots.crop('minecraft:redstone', '#c:storage_blocks/redstone', 'minecraft:redstone_block', '4x minecraft:redstone', 1800, 2) // seed, soil, display, drops, time, yield
    .drop('minecraft:glowstone_dust', 0.5)

  event.recipes.botanypots.crop('minecraft:beetroot_seeds')
    .input('minecraft:beetroot')                // changes the seed item (alias: .seed())
    .drops(['2x minecraft:beetroot', 'minecraft:beetroot_seeds']) // replaces every drop
    .display('minecraft:beetroots')             // replaces every display
    .addDisplay('minecraft:dead_bush')          // appends a display on top

  event.recipes.botanypots.crop('minecraft:carrot')
    .type('botanypots:aging')                   // grows through the block's age states
    .blockState('minecraft:carrots')            // block of the display (alias: .block_state())
    .scale(0.5)                                 // uniform scale
    .drop('2x minecraft:carrot')

  event.recipes.botanypots.crop('minecraft:glow_berries')
    .blockState('minecraft:cave_vines[berries=true]') // simple display with a state
    .rotation('x_180')                          // hangs upside down (alias: .rotations())
    .offset(0, 0.5, 0)                          // moved up half a block
    .color('#FFD080')                           // tint (alias: .tint())
    .drop('minecraft:glow_berries')

  event.recipes.botanypots.crop('minecraft:cobweb')
    .blockState('minecraft:cobweb')             // first display
    .type('botanypots:entity')                  // .type() again: a second, stacked display
    .entity('minecraft:spider')                 // entity shown
    .spinSpeed(2)                               // spin speed
    .shouldTick(false)                          // the entity does not animate
    .scale(0.4)
    .entityLootDrop('minecraft:spider')         // mob loot drop
    .lootTableDrop('minecraft:blocks/cobweb')   // loot table drop
    .addDrop('minecraft:string')                // appends any drop value

  event.recipes.botanypots.crop('minecraft:oak_sapling')
    .type('botanypots:transitional')            // one display per growth phase
    .phases('minecraft:oak_sapling', 'minecraft:oak_leaves', 'minecraft:oak_log') // the phases
    .drop('minecraft:oak_log')

  event.recipes.botanypots.crop('minecraft:amethyst_shard')
    .type('botanypots:textured_cube')           // cube with a texture
    .texture('minecraft:block/amethyst_block')  // its texture
    .scale(0.4)
    .faces('up', 'north', 'south', 'east', 'west') // rendered faces
    .drop('minecraft:amethyst_shard')

  event.recipes.botanypots.crop('minecraft:pointed_dripstone')
    .blockState('minecraft:pointed_dripstone')
    .options({ scale: [0.5, 0.8, 0.5], faces: ['north', 'south'] }) // raw JSON render options: the only form this method accepts (alias: .renderOptions())
    .drop('minecraft:pointed_dripstone')
})

Block-derived crop

event.recipes.botanypots.block_derived_crop(block[, input[, soil]]) — display, drops and seed come from the block. Accepts the same methods as crop; .drop() overrides the derived drops and .blockState() overrides the derived display.

event.recipes.botanypots.block_derived_crop('minecraft:sweet_berry_bush')          // everything from the block
event.recipes.botanypots.block_derived_crop('minecraft:sugar_cane', 'minecraft:sugar_cane', '#botanypots:soil/sand') // block, seed, soil
  .growTime(1600)
  .scale(0.5)                                    // options of the derived display
  .drop('minecraft:sugar', 0.1)                  // overrides the derived drops
  .onHarvest('kubejs:cane_harvest')
  .potPredicate('kubejs:gold_botany_pot')
event.recipes.botanypots.block_derived_crop('minecraft:bamboo')
  .blockState('minecraft:bamboo[leaves=large]')  // overrides the derived display
  .scale(0.4)

Soil

event.recipes.botanypots.soil(input[, display[, growthModifier[, yieldModifier]]])

Method Description Default
.growthModifier(f) / .growth(f) Added growth speed (can be negative) 0
.yieldModifier(f) Added yield, 0 or more 0
.lightLevel(n) / .light(n) Light emitted by the pot 0

Plus every display and render method.

event.recipes.botanypots.soil('minecraft:diamond_block', 'minecraft:diamond_block', 0.5, 0.25) // input, display, growth, yield
event.recipes.botanypots.soil('minecraft:glowstone', 'minecraft:glowstone')
  .growthModifier(0.25)        // added growth speed (alias: .growth())
  .yieldModifier(0.5)          // added yield
  .lightLevel(15)              // light emitted by the pot
event.recipes.botanypots.soil('minecraft:lava_bucket')
  .type('botanypots:simple')
  .blockState('minecraft:lava')
  .renderFluid(true)           // render the lava fluid
  .growthModifier(0.1)
event.recipes.botanypots.soil('minecraft:water_bucket')
  .blockState('minecraft:water')
  .renderFluid()               // no argument = true
event.recipes.botanypots.soil('minecraft:moss_block')
  .blockState('minecraft:moss_block')
  .scale(0.625, 0.5, 0.625)    // per-axis scale
  .offset(0, -0.1, 0)
  .color(120, 200, 120)        // tint as r, g, b

Block-derived soil

event.recipes.botanypots.block_derived_soil(block[, input]) — display taken from the block. Same methods as soil.

event.recipes.botanypots.block_derived_soil('minecraft:mycelium')                    // display from the block
event.recipes.botanypots.block_derived_soil('minecraft:soul_soil', 'minecraft:soul_soil') // block, input item
  .growthModifier(0.1)
  .yieldModifier(0.1)
  .lightLevel(3)
  .renderFluid(false)          // option of the derived display
event.recipes.botanypots.block_derived_soil('minecraft:mud', 'minecraft:mud')
  .blockState('minecraft:mud') // overrides the derived display
  .offset(0, -0.05, 0)

Fertilizer

event.recipes.botanypots.fertilizer(heldItem, growth)

growth: integer = constant ticks, decimal = fraction of the total time (0-1), [min, max] = random ticks, or a GrowthAmount.

Method Description Default
.soilItem(ingredient) / .soil(...) Only on these soils any
.seedItem(ingredient) / .seed(...) / .crop(...) Only on these crops any
.cooldown(ticks) Ticks before the pot accepts fertilizer again 20
.spawnParticles(bool) / .particles(bool) Particles on use true
.notifySculk(bool) Sends a sculk vibration true
.sound(id[, category[, volume[, pitch]]]) Sound played (category defaults to blocks) —
event.recipes.botanypots.fertilizer('minecraft:glow_berries', 200)    // 200 ticks of growth
event.recipes.botanypots.fertilizer('minecraft:rotten_flesh', 0.1)    // 10% of the total time
event.recipes.botanypots.fertilizer('kubejs:super_fertilizer', [400, 800]) // random 400-800 ticks
  .soilItem('#botanypots:soil/dirt')      // only on these soils (alias: .soil())
  .seedItem('minecraft:wheat_seeds')      // only on these crops (aliases: .seed(), .crop())
  .cooldown(40)                           // ticks before more fertilizer is accepted
  .spawnParticles(false)                  // no particles (alias: .particles())
  .notifySculk(false)                     // no sculk vibration
  .sound('minecraft:item.bone_meal.use')  // sound id, category blocks
event.recipes.botanypots.fertilizer('minecraft:sugar', 50)
  .sound('minecraft:block.sand.place', 'blocks', 0.8, 1.2) // id, category, volume, pitch

Pot interaction

event.recipes.botanypots.pot_interaction(heldItem) — right-click a pot with the held item.

Method Description Default
.soilItem(ingredient) Soil required in the pot any
.seedItem(ingredient) Crop required in the pot any
.newSoil(item) Replaces the soil —
.newSeed(item) / .newCrop(item) Replaces the crop —
.damageHeld(bool) Damages the held tool true
.consumeHeld(bool) Uses up one held item false
.extraDrops(table) / .lootTable(table) Loot table dropped on use —
.sound(id[, category[, volume[, pitch]]]) Sound played —
.notifySculk(bool) Sends a sculk vibration true
event.recipes.botanypots.pot_interaction('#minecraft:hoes')   // right-click with any hoe
  .soilItem('minecraft:coarse_dirt')            // soil required in the pot
  .newSoil('minecraft:dirt')                    // replaces the soil
  .damageHeld(true)                             // damages the hoe
  .sound('minecraft:item.hoe.till', 'blocks', 1, 1) // id, category, volume, pitch
event.recipes.botanypots.pot_interaction('minecraft:bone_meal')
  .seedItem('minecraft:wheat_seeds')            // crop required in the pot
  .newSeed('minecraft:carrot')                  // replaces the crop (alias: .newCrop())
  .consumeHeld(true)                            // uses up one bone meal
  .extraDrops('minecraft:gameplay/fishing')     // loot table dropped on use (alias: .lootTable())
  .notifySculk(false)                           // no sculk vibration

event.remove({ type: 'botanypots:crop', input: 'minecraft:melon_seeds' }) // remove like any recipe

Botany Pots: Mystical Agriculture

Config

BotanyPotsMysticalEvents.registry('config', event => { ... }) — in-memory overrides of config/botanypots-mysticalagriculture, applied before every recipe reload.

Call Description Default
event.requireSoilTier(bool) Mystical crops need a soil of their tier (false = any dirt-like soil) true
event.allowSeedDrops(bool) Extra seed drops true
event.allowFertilizedEssenceDrops(bool) Fertilized essence drops true
event.tierGrowTime(tier, ticks) Growth ticks of every crop of a tier ('mysticalagriculture:1', plain '5', 'mysticalagriculture:elemental') mod config
// startup_scripts
BotanyPotsMysticalEvents.registry('config', event => {
  event.requireSoilTier(false)                              // mystical crops grow on any dirt-like soil
  event.allowSeedDrops(true)                                // extra seed drops
  event.allowFertilizedEssenceDrops(false)                  // no fertilized essence drops
  event.tierGrowTime('mysticalagriculture:1', 600)          // growth ticks of tier 1 crops
  event.tierGrowTime('5', 2400)                             // plain number = mysticalagriculture:5
  event.tierGrowTime('mysticalagriculture:elemental', 1200) // elemental tier
})

Mystical crop

event.recipes.botanypotsmystical.mystical_crop(crop) — seeds, soil tier, growth time, display and drops come from the Mystical Agriculture crop.

// server_scripts
event.recipes.botanypotsmystical.mystical_crop('mysticalagriculture:diamond')   // diamond crop in a pot
event.recipes.botanypotsmystical.mystical_crop('mysticalagriculture:inferium')  // inferium crop
event.remove('botanypots:mysticalagriculture/crop/dirt_seeds')                  // remove by id

Botany Pots Tiers

Tier settings

BotanyPotsTiersEvents.registry('tiers', event => event.modify(tier)) — existing tiers only: elite, ultra, mega (the mod cannot add tiers).

Method Description Default
.speedMultiplier(n) Growth speed multiplier elite 2, ultra 6
.outputMultiplier(n) Output multiplier elite 2, ultra 3
.craftBasic(bool) Built-in basic pots of this tier can be crafted mod config
.craftHopper(bool) Built-in hopper pots can be crafted mod config
.craftWaxed(bool) Built-in pots can be waxed mod config
// startup_scripts
BotanyPotsTiersEvents.registry('tiers', event => {
  event.modify('elite')
    .speedMultiplier(3)     // growth speed x3
    .outputMultiplier(2)    // output x2
  event.modify('ultra')
    .speedMultiplier(6)
    .outputMultiplier(4)
    .craftHopper(false)     // built-in ultra hopper pots can't be crafted
  event.modify('mega')
    .craftBasic(true)       // built-in mega pots can be crafted
    .craftHopper(true)      // built-in mega hopper pots can be crafted
    .craftWaxed(false)      // built-in mega pots can't be waxed
})

Tiered pots

BotanyPotsTiersEvents.registry('pots', event => event.create(id)) — plain names get the botanypotstiers namespace. Also available as block type botanypotstiers:pot. The upgrade items turn <ns>:<name> into botanypotstiers:elite_<name>, then ultra_<name> and mega_<name>, so matching ids make your scripted pots upgradable.

Same methods as the pots registry (.potType, .hopper, .waxed, .material, .materialTop, .growthModifier, .yieldModifier), plus:

Method Description Default
.tier(tier) elite, ultra or mega read from the id prefix

.growthModifier() / .yieldModifier() are added on top of the tier multipliers.

// startup_scripts
BotanyPotsTiersEvents.registry('pots', event => {
  event.create('elite_gold_botany_pot')              // tier elite from the prefix
    .material('minecraft:block/gold_block')
    .materialTop('minecraft:block/gold_block')
    .growthModifier(0.5)                             // added on top of the tier multipliers
  event.create('ultra_gold_botany_pot')
    .material('minecraft:block/gold_block')
  event.create('mega_gold_botany_pot')
    .material('minecraft:block/gold_block')
    .yieldModifier(1)                                // extra yield
  event.create('elite_gold_hopper_botany_pot')       // hopper from the id
    .material('minecraft:block/gold_block')
  event.create('elite_iron_auto_pot')
    .hopper()                                        // explicit hopper
    .material('minecraft:block/iron_block')
  event.create('botanypotstiers:special_pot')
    .tier('ultra')                                   // explicit tier
    .potType('waxed')                                // explicit type (alias form: .waxed())
    .material('minecraft:block/diamond_block')
})

StartupEvents.registry('block', event => {
  event.create('botanypotstiers:elite_obsidian_botany_pot', 'botanypotstiers:pot') // same builder as block type
    .material('minecraft:block/obsidian')
})

Upgrade recipes use Botany Pots Tiers' own pattern (' A ', ' P ', 'B B'):

// server_scripts
event.shaped('botanypotstiers:elite_gold_botany_pot', [' A ', ' P ', 'B B'], {
  A: 'minecraft:ender_pearl',   // elite upgrade item
  B: 'minecraft:iron_block',
  P: 'kubejs:gold_botany_pot'   // the pot being upgraded
})


Create Crafts & Additions integration

Recipes for the Rolling Mill, Tesla Coil charging and Liquid Blaze Burner fuels. All of them show in JEI through C&A's own categories.

Required mods: Create Crafts & Additions 1.7.x (Create 6). KubeJS Infinity Extras loads this only when Create Crafts & Additions is installed.

Part Script folder
event.recipes.createaddition.* server_scripts

C&A has no separate wire-cutting or spool machine recipe type: wires come from the Rolling Mill and spools are normal crafting recipes (event.shaped / event.shapeless). Create's own types (pressing, mixing, ...) are covered by KubeJS Create.


Rolling Mill

event.recipes.createaddition.rolling(result, ingredient) — ingot -> rod, plate -> wire. Arrays are accepted too. No options.

event.recipes.createaddition.rolling('2x createaddition:copper_wire', '#c:plates/copper')   // plate -> wire
event.recipes.createaddition.rolling('createaddition:iron_rod', 'minecraft:iron_ingot')      // ingot -> rod
event.recipes.createaddition.rolling(['3x minecraft:string'], ['minecraft:white_wool'])      // arrays are accepted too

Tesla Coil charging

event.recipes.createaddition.charging(result, ingredient[, energy[, maxChargeRate]])

Method Description Default
.energy(fe) Total FE needed 4000
.maxChargeRate(fe) (aliases .chargeRate, .max_charge_rate) FE/t accepted 200
event.recipes.createaddition.charging('minecraft:glowstone_dust', 'minecraft:redstone')        // 4000 FE, 200 FE/t
event.recipes.createaddition.charging('minecraft:amethyst_shard', 'minecraft:quartz', 20000)  // energy as 3rd argument
event.recipes.createaddition.charging('minecraft:nether_star', 'minecraft:wither_skeleton_skull')
  .energy(1000000)                       // total FE
  .maxChargeRate(5000)                   // FE/t accepted (alias: .chargeRate(), .max_charge_rate())

Liquid Blaze Burner fuel

event.recipes.createaddition.liquid_burning(fluid[, burnTime[, superheated]]) — fluid is Fluid.of(...) or '1000x #tag'.

Method Description Default
.burnTime(ticks) (aliases .time, .burn_time) Ticks the burner stays lit per fluid amount given 12000
.superheated(bool) Superheated instead of just heated false
ServerEvents.recipes(event => {
  event.recipes.createaddition.liquid_burning(Fluid.of('minecraft:lava', 1000), 6000)   // burn time as 2nd argument
  event.recipes.createaddition.liquid_burning('1000x #c:crude_oil')                     // fluid tag
    .burnTime(9600)                      // ticks lit per amount given
  event.recipes.createaddition.liquid_burning(Fluid.of('createaddition:bioethanol', 1000))
    .time(24000)                         // alias of .burnTime() (also .burn_time())
    .superheated(true)                   // superheated instead of heated

  event.remove({ type: 'createaddition:rolling', output: 'createaddition:straw' })   // remove a rolling recipe
})


Create integration (heat sources)

Heat sources for basins and steam engine boilers: static heat levels, passive heaters, heat by block state, and overriding or removing Create's own heaters.

Required mods: Create 6.0.x. KubeJS Infinity Extras loads this only when Create is installed.

Part Script folder
CreateHeatEvents.registry('basin' | 'boiler', ...) startup_scripts
#create:passive_boiler_heaters tag changes server_scripts

KubeJS Create (kubejs-create) already covers Create's recipe types (event.recipes.create.*) and its own events (CreateEvents.boilerHeatHandler, pipeFluidEffect, spoutHandler); they keep working.


Block selectors

Every method takes a block selector:

Selector Meaning
'minecraft:magma_block' A block
'#minecraft:campfires' A block tag (evaluated live, so server tag changes apply)
'minecraft:furnace[lit=true]' Only states with these properties (also '#tag[prop=value,...]')
['minecraft:a', 'minecraft:b'] Several at once

Later entries win over earlier ones, and script entries win over Create's defaults. Bad entries are logged to logs/kubejs/startup.log and skipped; nothing throws.

Methods (both systems)

Method Description
event.add(selector, heat) Static heat for these blocks (also overrides an existing source)
event.passive(selector) Passive heater while lit (no lit=false), like Create's passive heaters
event.byState(selector, state => heat) Heat from the block state; return nothing to fall back to the previous rule / Create's result
event.remove(selector) These blocks no longer heat

Basin heat — CreateHeatEvents.registry('basin', ...)

Heat level a block gives to a basin on top of it. Levels: 'none', 'smouldering' (passive), 'fading' / 'kindled' (heated), 'seething' (superheated). Create's defaults: the blaze burner (its own heat level) and lit blocks in #create:passive_boiler_heaters (smouldering).

// kubejs/startup_scripts/create_heat.js
CreateHeatEvents.registry('basin', event => {
  event.add('minecraft:magma_block', 'kindled')                      // magma now counts as heated
  event.add('#minecraft:campfires[lit=true]', 'smouldering')         // tag + state selector
  event.add('minecraft:respawn_anchor[charges=4]', 'seething')       // only a fully charged anchor superheats
  event.passive(['minecraft:soul_torch', 'minecraft:furnace'])       // smouldering while lit
  event.byState('minecraft:blast_furnace', s => s.lit ? 'kindled' : 'none')   // level from the block state
  event.add('create:blaze_burner[blaze=kindled]', 'seething')        // override Create's own heater
  event.remove('minecraft:lava')                                     // lava no longer heats basins
})

Boiler heat — CreateHeatEvents.registry('boiler', ...)

Heat for steam engine boilers: -1 none, 0 passive, 1, 2, ... active heat levels. Create's defaults: blaze burner (smouldering 0, fading/kindled 1, seething 2) and lit blocks in #create:passive_boiler_heaters (0).

CreateHeatEvents.registry('boiler', event => {
  event.add('minecraft:magma_block', 1)                              // active heater, heat 1
  event.add('minecraft:respawn_anchor[charges=4]', 3)                // heat 3 when fully charged
  event.passive('minecraft:soul_campfire')                           // heat 0 while lit
  event.byState('minecraft:furnace', s => s.lit ? 1 : 0)             // heat from the block state
  event.byState('minecraft:blast_furnace', s => s.lit ? 2 : -1)      // -1 = no heat
  event.add('create:blaze_burner[blaze=seething]', 4)                // seething blaze burner gives 4 instead of 2
  event.remove(['#minecraft:fire', 'minecraft:lava'])                // fire and lava no longer heat boilers
})

Data-driven alternative (server)

Create's tag #create:passive_boiler_heaters makes a lit block a passive heater for both systems (basin smouldering + boiler heat 0). It is reloadable with /reload.

// kubejs/server_scripts/create_heat.js
ServerEvents.tags('block', event => {
  event.add('create:passive_boiler_heaters', 'minecraft:soul_torch')       // passive heater for basins and boilers
  event.remove('create:passive_boiler_heaters', 'minecraft:magma_block')   // no longer a passive heater
})

JEI: Create's mixing and compacting categories show the heat a recipe needs, not the list of heat sources, so nothing changes there; the new sources simply satisfy those requirements in game.



Curios integration

Creates new slot types, changes existing slots, assigns slots to entities, turns any item into a curio (attributes, potion effects, extra slots, equip messages, healing, custom callbacks), edits slot tags and gives extra slots per player — all from scripts. Curio renderers are not covered.

Required mods: Curios 9.x for 1.21.1 (KubeJS Infinity Extras loads this only when Curios is installed)

Part Script folder
CuriosEvents.registry('slots' / 'entities' / 'items') startup_scripts (needs a game restart)
CuriosEvents.extras('add_slots' / 'remove_slots') server_scripts
CuriosEvents.tags('item' / 'block') server_scripts (reloads with /reload)

Startup registries become data pack json in the KubeJS virtual pack (data/kubejs/curios/slots, data/kubejs/curios/entities, data/curios/tags/item).


Registry: slots

CuriosEvents.registry('slots', event => { ... })

Call Description
event.create(id) New slot type. Curios identifies slots by path: kubejs:wings is the slot wings, its item tag is #curios:wings and its name key curios.identifier.wings. New slots are given to the player automatically
event.modify(id) Changes an existing slot (from Curios or any mod). Only what you set changes. The namespace is ignored
event.predicate(id, result => bool) Registers a reusable validator, used with .validator(id) on any slot. result is Curios' SlotResult (result.stack(), result.slotContext())

Slot builder methods:

Method Description Default
.size(n) Number of slots (exact) 1
.addSize(n) / .removeSize(n) Adds or removes slots relative to what the mod defined —
.size(n, operation) Size with an explicit operation: 'SET', 'ADD', 'REMOVE' 'SET'
.order(n) Position in the Curios screen; lower comes first (Curios' own slots use 10-160) 1000
.icon(texture) Empty slot texture, e.g. 'kubejs:slot/wings' for kubejs/assets/kubejs/textures/slot/wings.png (16x16). If the png is missing, Curios' generic icon is used <ns>:slot/<identifier>
.dropRule(rule) On death: DEFAULT, ALWAYS_DROP (DROP), ALWAYS_KEEP (KEEP), DESTROY DEFAULT
.addCosmetic([bool]) Cosmetic slot next to each slot false
.renderToggle(bool) Shows the "hide rendering" button Curios default
.useNativeGui(bool) Shown in Curios' own screen Curios default
.validator(...ids) Validators: 'curios:tag', 'curios:all', 'curios:none' or an id from event.predicate. Replaces the default, so list 'curios:tag' too to keep the item tag 'curios:tag'
.predicate(result => bool) Custom validator for this slot only, added to the item tag check —
.items(...items) Items or tags added to #curios:<slot> —
.entities(...types) Entity types that get the slot (replaces the player default) player
.player() Makes sure the player has the slot —
.replace() Removes what other data packs defined for this slot first —
.name(text) / .displayName(text) English name generated from the id
.lang(key) Own translation key (also <key>.modifiers for the tooltip header) —
// startup_scripts
CuriosEvents.registry('slots', event => {
  event.create('kubejs:wings')
    .size(1)                                   // number of slots
    .order(150)                                // position in the Curios screen
    .icon('kubejs:slot/wings')                 // empty slot texture
    .dropRule('KEEP')                          // items stay on death (ALWAYS_KEEP)
    .addCosmetic(true)                         // cosmetic slot next to it
    .renderToggle(true)                        // "hide rendering" button
    .useNativeGui(true)                        // shown in Curios' own screen
    .items('minecraft:elytra', '#c:wings')     // added to #curios:wings
    .name('Wings')                             // English name (alias: .displayName())

  event.create('kubejs:quiver')
    .order(155)
    .lang('slot.kubejs.quiver')                // own translation key
    .entities('minecraft:player', 'minecraft:skeleton') // entities that get the slot
    .validator('curios:tag', 'kubejs:only_arrows')      // keeps the tag check and adds a custom validator

  event.create('kubejs:talisman')
    .size(2)
    .addCosmetic()                             // same as .addCosmetic(true)
    .predicate(result => result.stack().enchanted) // tagged items, or any enchanted item

  event.predicate('kubejs:only_arrows', result => result.stack().hasTag('minecraft:arrows')) // reusable validator

  event.modify('ring')
    .size(4)                                   // exactly 4 ring slots
    .player()                                  // make sure the player has the slot
  event.modify('curios:necklace')
    .addSize(1)                                // one more than the mod defined
    .player()
  event.modify('charm')
    .removeSize(1)                             // one less than the mod defined
  event.modify('belt')
    .size(2, 'ADD')                            // explicit operation: SET, ADD or REMOVE
  event.modify('back')
    .replace()                                 // drop what other data packs defined first
    .dropRule('ALWAYS_KEEP')
})

Registry: entities

CuriosEvents.registry('entities', event => { ... }) — Curios only shows slots assigned to the entity.

Call Description
event.player(...slots) Gives slots to the player
event.add(entity, ...slots) Gives slots to an entity type
event.create(id) Named assignment, configured with the methods below
Method Description Default
.entities(...types) Entity types —
.player() Adds the player —
.slots(...slots) Slot types given —
.replace([bool]) Removes every slot the entities got from other data packs false
// startup_scripts
CuriosEvents.registry('entities', event => {
  event.player('head', 'charm', 'belt')               // slots for the player
  event.add('minecraft:zombie', 'ring', 'necklace')   // slots for zombies

  event.create('kubejs:armor_stands')
    .entities('minecraft:armor_stand')                // entity types
    .slots('head', 'necklace')                        // slots given

  event.create('kubejs:player_only_rings')
    .player()                                         // adds the player
    .slots('ring')
    .replace(true)                                    // removes slots other data packs gave (alias: .replace())
})

Registry: items

CuriosEvents.registry('items', event => event.create(itemId)) — turns any item (any mod, or one from StartupEvents.registry('item')) into a curio. .slots(...) adds it to #curios:<slot>; everything else is optional.

Method Description Default
.slots(...slots) Slots it can be worn in —
.attribute(attribute, amount[, operation]) Attribute bonus while worn. Operations: add_value, add_multiplied_base, add_multiplied_total add_value
.slotModifier(slot, amount) Extra slots of a type while worn —
.effect(effect[, amplifier]) Effect kept while worn, removed when taken off amplifier 0
.fortune(levels) / .looting(levels) Extra Fortune / Looting —
.piglinNeutral() Piglins stay neutral —
.powderSnowWalker() Walk on powder snow —
.enderMask() Endermen don't get angry when looked at —
.equipFromUse() Right-click to wear it —
.dropRule(rule) On death: DEFAULT, ALWAYS_DROP (DROP), ALWAYS_KEEP (KEEP), DESTROY DEFAULT
.equipSound(sound) Sound when equipped —
.equipMessage(text) / .unequipMessage(text) Action bar message to the player —
.heal(amount, everyTicks) Heals while worn —
.lockBelowHealth(health) Can't be taken off at that health or less —
.onTick(ctx => ...) / .onEquip(ctx => ...) / .onUnequip(ctx => ...) Custom code (server only) —
.canEquip(ctx => bool) / .canUnequip(ctx => bool) Custom equip rules —

Callback context ctx: entity, player, stack, otherStack, slot, index, cosmetic, visible, level, clientSide, server, slotContext.

// startup_scripts
CuriosEvents.registry('items', event => {
  event.create('minecraft:gold_nugget')
    .slots('ring')                                                      // wearable in ring slots
    .attribute('minecraft:generic.luck', 1)                             // +1 luck (add_value)
    .attribute('minecraft:generic.movement_speed', 0.1, 'add_multiplied_base') // +10% speed
    .piglinNeutral()                                                    // piglins stay neutral
    .equipSound('minecraft:item.armor.equip_gold')                      // sound when equipped

  event.create('minecraft:phantom_membrane')
    .slots('back', 'belt')
    .effect('minecraft:slow_falling')                                   // kept while worn
    .effect('minecraft:jump_boost', 1)                                  // amplifier 1 = Jump Boost II
    .equipFromUse()                                                     // right-click to wear it

  event.create('minecraft:rabbit_foot')
    .slots('charm')
    .fortune(1)                                                         // +1 Fortune
    .looting(1)                                                         // +1 Looting
    .slotModifier('ring', 2)                                            // two more ring slots while worn
    .dropRule('ALWAYS_KEEP')                                            // kept on death

  event.create('minecraft:carved_pumpkin')
    .slots('head')
    .enderMask()                                                        // endermen don't get angry
    .powderSnowWalker()                                                 // walk on powder snow
    .equipMessage('Spooky!')                                            // action bar message on equip
    .unequipMessage('Back to normal')                                   // action bar message on unequip
    .heal(1, 100)                                                       // 1 health every 100 ticks
    .lockBelowHealth(6)                                                 // can't be removed at 6 health or less

  event.create('minecraft:clock')
    .slots('charm')
    .onTick(ctx => {                                                    // every tick while worn (server)
      if (ctx.level.dayTime() % 24000 == 0) ctx.player.tell('A new day begins')
    })
    .onEquip(ctx => ctx.player.tell(`Clock worn in ${ctx.slot} #${ctx.index}`)) // when put on
    .onUnequip(ctx => ctx.player.tell('Clock removed'))                 // when taken off
    .canEquip(ctx => ctx.player != null)                                // only players can wear it
    .canUnequip(ctx => !ctx.player.crouching)                           // can't be removed while sneaking
})

Extra slots per player

CuriosEvents.extras('add_slots', event => event.add_slot(slot, amount)) CuriosEvents.extras('remove_slots', event => event.remove_slot(slot, amount))

Runs for every player on login and for online players after /reload. Amounts are fixed (logging in again does not add more), and removing a line removes that change on the next login or reload. The slot type must already be assigned to the player. event.entity is the player.

// server_scripts
CuriosEvents.extras('add_slots', event => {
  event.add_slot('belt', 2)        // 2 more belt slots
  event.add_slot('ring', 1)        // 1 more ring slot
  console.info(`Extra slots for ${event.entity.username}`) // the player being updated
})

CuriosEvents.extras('remove_slots', event => {
  event.remove_slot('necklace', 1) // one necklace slot less
})

Slot tags

CuriosEvents.tags('item', event => { ... }) / CuriosEvents.tags('block', event => { ... }) — what can be worn where (#curios:<slot>).

Call Description
event.add_item_tag(tag, ...items) / event.remove_item_tag(tag, ...items) Item tags
event.add_block_tag(tag, ...blocks) / event.remove_block_tag(tag, ...blocks) Block tags
// server_scripts
CuriosEvents.tags('item', event => {
  event.add_item_tag('curios:wings', 'minecraft:phantom_membrane')   // wearable in the wings slot
  event.add_item_tag('curios:ring', 'minecraft:gold_nugget', 'minecraft:iron_nugget') // several items
  event.remove_item_tag('curios:ring', 'minecraft:iron_nugget')      // no longer a ring
})

CuriosEvents.tags('block', event => {
  event.add_block_tag('kubejs:curio_blocks', 'minecraft:stone')      // adds a block to a block tag
  event.remove_block_tag('kubejs:curio_blocks', 'minecraft:dirt')    // removes a block from a block tag
})


Enchanted: Witchcraft integration

Registers new chalks, poppets, brews and rites from startup scripts, and adds recipe schemas for every Enchanted machine: witch oven by-products, distillery, kettle / witch cauldron and spinning wheel.

Required mods: Enchanted: Witchcraft 4.2.x (KubeJS Infinity Extras loads this only when Enchanted is installed)

Part Script folder
EnchantedEvents.registry(...) (chalks, poppets, brews, rites) startup_scripts
StartupEvents.registry('block' / 'item') with the Enchanted builder types startup_scripts
event.recipes.enchanted.* server_scripts

Every registry builder supports .lang(key) for its own translation key. Without it, an English name is generated from the id.


Registry: chalks

EnchantedEvents.registry('chalks', event => event.create(id)) registers a chalk item and its glyph block. Glyphs reuse Enchanted's glyph textures, tinted. Use the chalk id in a rite's circle methods to require circles drawn with it.

The same builder is available as block type enchanted:chalk in StartupEvents.registry('block', ...).

Method Description Default
.lang(key) Translation key of the name (or .displayName('...')) name generated from the id
.chalkColor(color) Glyph colour, number (0x7FD4FF) or hex string ('AA0000') —
.particle(particleId) Particle emitted by the glyphs none
.itemTexture(texture) Chalk item texture enchanted:item/ritual_chalk
.uses(n) Chalk durability 40

Enchanted's own colours: ritual F0F0F0, nether 801818, otherwhere 4F2F78.

// startup_scripts
EnchantedEvents.registry('chalks', event => {
  event.create('kubejs:frost_chalk')               // chalk item + glyph block id
    .lang('chalk.kubejs.frost')                    // own translation key
    .chalkColor(0x7FD4FF)                          // glyph colour as a number
    .particle('minecraft:snowflake')               // particle emitted by the glyphs
    .itemTexture('kubejs:item/frost_chalk')        // chalk item texture
    .uses(40)                                      // chalk durability

  event.create('kubejs:ash_chalk')
    .displayName('Ash Chalk')                      // fixed English name instead of a lang key
    .chalkColor('5A5A5A')                          // glyph colour as a hex string
})

StartupEvents.registry('block', event => {
  event.create('kubejs:blood_chalk', 'enchanted:chalk')  // same builder as block type enchanted:chalk
    .chalkColor('AA0000')                                // glyph colour
    .particle('minecraft:crimson_spore')                 // glyph particle
})

Registry: poppets

EnchantedEvents.registry('poppets', event => event.create(id)) registers a poppet ("voodoo doll"). Bind it with a taglock and keep it in the inventory or on a poppet shelf. Also available as item type enchanted:poppet.

Method Description Default
.lang(key) Translation key of the name name generated from the id
.protects(damage) Damage the poppet absorbs instead of the player dying. A preset (earth, fire, hunger, magic, void, water), a damage type id ('minecraft:lightning_bolt') or a damage type tag ('#minecraft:is_explosion'). Call several times —
.protectsAll() Protects against any lethal damage —
.effect(effect, ticks[, amplifier]) Extra effect given when it triggers (on top of Enchanted's default) amplifier 0
.protectsItems(kind, restore) Makes it an item poppet: repairs a 'tool', 'armour' ('armor') or 'any' item about to break, restoring restore (0-1) of its durability —
.uses(n) Uses before the poppet breaks 1
.colours(primary, secondary) / .colors(...) Poppet shelf colours (0xRRGGBB) —
.texture(texture) Item texture enchanted:item/poppet
// startup_scripts
EnchantedEvents.registry('poppets', event => {
  event.create('kubejs:lightning_poppet')
    .lang('poppet.kubejs.lightning')               // own translation key
    .protects('minecraft:lightning_bolt')          // damage type id
    .protects('#minecraft:is_explosion')           // damage type tag
    .effect('minecraft:fire_resistance', 600)      // extra effect when it triggers (amplifier 0)
    .effect('minecraft:absorption', 600, 1)        // effect with an amplifier
    .uses(2)                                       // uses before it breaks
    .colours(0xFFFF55, 0x5555FF)                   // poppet shelf colours (alias: .colors())
    .texture('kubejs:item/lightning_poppet')       // item texture

  event.create('kubejs:elemental_poppet')
    .protects('fire')                              // preset: fire
    .protects('water')                             // preset: water (drowning)
    .protects('earth')                             // preset: earth (fall damage)

  event.create('kubejs:guardian_poppet')
    .protectsAll()                                 // any lethal damage
    .colors(0xFFD700, 0xFFFFFF)                    // same as .colours()

  event.create('kubejs:mending_poppet')
    .protectsItems('any', 0.5)                     // item poppet: repairs tools or armour, restores 50%
    .uses(3)                                       // three repairs
})

Registry: brews

EnchantedEvents.registry('brews', event => event.create(id)) registers a drinkable brew that applies its effects. Also available as item type enchanted:brew.

Method Description Default
.lang(key) Translation key of the name (or .displayName('...')) name generated from the id
.effect(effect, ticks[, amplifier]) Effect applied when drunk. Call several times amplifier 0
.texture(texture) Item texture enchanted:item/brew_of_love
// startup_scripts
EnchantedEvents.registry('brews', event => {
  event.create('kubejs:brew_of_haste')
    .lang('brew.kubejs.haste')                     // own translation key
    .effect('minecraft:haste', 2400, 1)            // effect, ticks, amplifier
    .effect('minecraft:speed', 2400)               // effect, ticks (amplifier 0)
    .texture('kubejs:item/brew_of_haste')          // item texture

  event.create('kubejs:brew_of_sight')
    .displayName('Brew of Sight')                  // fixed English name
    .effect('minecraft:night_vision', 6000)        // 5 minutes of night vision
})

Registry: rites

EnchantedEvents.registry('rites', event => event.create(id)) adds a circle magic rite. Rites are written into the KubeJS data pack (registry enchanted:circle_magic/rite).

Method Description Default
.name(text) English name (lang key rite.<namespace>.<path>) id in title case
.lang(key) Own translation key, copied to rite.<namespace>.<path> for every locale —
.items(list) Items thrown into the circle ('2x minecraft:redstone') —
.smallCircle(chalk) / .mediumCircle(chalk) / .largeCircle(chalk) Required chalk circle drawn with that chalk block —
.shape(shape, chalk) Same, with a shape id (enchanted:small_circle, medium_circle, large_circle) —
.entities(...types) Entities that must be in the circle (consumed like items) —
.power(n) Altar power needed to start —
.tickPower(n) Altar power drained per tick while running —
.weather(w) none, clear, raining or thundering —
.time(from, to) Day-time window (0-24000) any time
.dimensions(...ids) Dimensions the rite works in any
.createItem(list) Shortcut for the enchanted:create_item factory: the rite creates these items —
.factory(type) What the rite does: any factory type (namespace defaults to enchanted) —
.factoryOption(key, value) One option of the current factory (needs .factory() first) —
.commandStep(...commands) Adds one step of commands (enchanted:command factory). @caster / @target are replaced —
.command(text) Single command run in one step —
.commandDelay(ticks) Ticks between command steps —

Factory types: apply_curse, bind_familiar, bind_talisman, blight, broiling, command, create_item, duplicate_item, entity_bound_create_item, fertility, forest, imprisonment, location_bound_create_item, protection, remove_curse, sanctity, sky_wrath, summon_entity, summon_familiar, total_eclipse, transpose_blocks, transpose_caster.

// startup_scripts
EnchantedEvents.registry('rites', event => {
  event.create('kubejs:rite_of_diamonds')
    .name('Rite of Diamonds')                                  // English name
    .items(['minecraft:coal_block', '2x minecraft:redstone', 'enchanted:attuned_stone_charged']) // items thrown in
    .smallCircle('enchanted:ritual_chalk')                     // small circle of ritual chalk
    .mediumCircle('kubejs:frost_chalk')                        // medium circle of a scripted chalk
    .power(3000)                                               // altar power to start
    .createItem(['minecraft:diamond', '2x minecraft:emerald']) // the rite creates these items

  event.create('kubejs:rite_of_the_grove')
    .lang('rite.kubejs.grove')                                 // own translation key
    .items(['enchanted:rowan_sapling', 'minecraft:bone_meal'])
    .largeCircle('enchanted:ritual_chalk')                     // large circle
    .entities('minecraft:sheep')                               // a sheep must be in the circle
    .weather('raining')                                        // only while raining
    .time(0, 12000)                                            // only during the day
    .dimensions('minecraft:overworld')                         // only in the overworld
    .tickPower(10)                                             // power drained per tick
    .factory('enchanted:forest')                               // what the rite does
    .factoryOption('radius', 25)                               // option of that factory
    .factoryOption('spacing', 7)                               // another option

  event.create('kubejs:rite_of_command')
    .items(['minecraft:command_block'])
    .shape('enchanted:small_circle', 'enchanted:otherwhere_chalk') // circle by shape id
    .commandStep('say The rite is complete', 'xp add @caster 10')  // one step, two commands
    .commandStep('say Second step')                                // next step
    .commandDelay(20)                                              // ticks between steps

  event.create('kubejs:rite_of_thunder')
    .items(['minecraft:lightning_rod'])
    .smallCircle('enchanted:ritual_chalk')
    .command('weather thunder')                                // single command, run in one step

  event.create('kubejs:rite_of_raw_forest')
    .items(['enchanted:hawthorn_sapling'])
    .smallCircle('enchanted:ritual_chalk')
    .factory('enchanted:forest', { radius: 10, spacing: 5 })   // raw JSON options: the only form this overload accepts

  event.create('kubejs:rite_of_raw_command')
    .items(['minecraft:paper'])
    .smallCircle('enchanted:ritual_chalk')
    .command({ commands: [['say Done']], delay: 0 })           // raw JSON of the enchanted:command factory: only form for an object argument
})

Recipes

Enchanted machine inputs are item stacks with counts ('3x item'), not tags. Colours are plain numbers (0xB046A5).

Witch oven by-product

event.recipes.enchanted.byproduct(result, ingredient) — the by-product given when ingredient is smelted in the witch oven.

event.recipes.enchanted.byproduct('enchanted:breath_of_the_goddess', 'minecraft:cherry_sapling') // by-product, smelted item

Distillery

event.recipes.enchanted.distilling(results, ingredients) — up to 4 results, up to 3 ingredients.

Method Description Default
.duration(ticks) / .time(ticks) Processing time 300
.power(n) Altar power used 750
event.recipes.enchanted.distilling(['enchanted:tear_of_the_goddess', 'minecraft:slime_ball'], ['3x enchanted:clay_jar', 'minecraft:lapis_lazuli'])
  .duration(400)   // processing ticks (alias: .time())
  .power(1000)     // altar power used

Kettle and witch cauldron

event.recipes.enchanted.kettle(result, ingredients[, power]) event.recipes.enchanted.witch_cauldron(result, ingredients[, power]) — same recipe type (enchanted:kettle); the witch cauldron crafts kettle recipes too.

Method Description Default
.power(n) Altar power used 0
.requiresBottle(bool) / .bottle(bool) Glass bottles are needed to take the result out false
.cookColour(color) / .cookColor(...) Liquid colour while cooking 0x2D155E
.finalColour(color) / .finalColor(...) Liquid colour when done 0x4A1AAD
event.recipes.enchanted.kettle('3x kubejs:brew_of_haste', ['minecraft:sugar', 'minecraft:redstone', 'enchanted:whiff_of_magic'], 1000)
  .requiresBottle(true)    // glass bottles needed to take it out (alias: .bottle())
  .cookColour(0xB046A5)    // colour while cooking (alias: .cookColor())
  .finalColour(0xF78FEB)   // colour when done (alias: .finalColor())

event.recipes.enchanted.witch_cauldron('kubejs:frost_chalk', ['enchanted:ritual_chalk', 'minecraft:snowball', 'minecraft:ice'])
  .power(2000)             // altar power, chained instead of the third argument

Spinning wheel

event.recipes.enchanted.spinning(result, ingredients[, power]) event.recipes.enchanted.wheel(result, ingredients[, power]) — same type (serializer enchanted:wheel). Exactly 3 ingredients.

Method Description Default
.power(n) Altar power used 0
.duration(ticks) / .time(ticks) Spinning time 300
event.recipes.enchanted.spinning('kubejs:lightning_poppet', ['enchanted:poppet', 'minecraft:lightning_rod', 'enchanted:hint_of_rebirth'], 500)
  .duration(400)           // spinning ticks (alias: .time())
event.recipes.enchanted.wheel('kubejs:mending_poppet', ['enchanted:sturdy_poppet', 'minecraft:experience_bottle', 'minecraft:anvil'])
  .power(750)              // altar power, chained


Excessive Utilities integration

Recipes for every Excessive Utilities machine, generator fuels with chained energy and burn time, the mod's special shaped recipes (QED, unstable ingot, division sigil, paintbrush, glass cutter, snow globe), and script edits to its data maps (Reversing Hoe, Nether lava dunking, inversion ritual mobs).

Required mods: Excessive Utilities (KubeJS Infinity Extras loads this only when Excessive Utilities is installed)

Part Script folder
ExcessiveUtilitiesEvents.registry(...) (data maps) startup_scripts
event.recipes.excessive_utilities.* server_scripts

Value formats

Value Format
Item input 'minecraft:cobblestone', '#c:gems/lapis'
Sized item input '9x #c:gems/lapis' (enchanter left / right)
Item output 'minecraft:gravel', '2x minecraft:sand', Item.of('minecraft:sand', 2)
Fluid input '250x #c:lava', '100x minecraft:water', Fluid.of('minecraft:lava', 250) (mB)
Fluid output '1000x minecraft:water', Fluid.of('minecraft:lava', 100) (mB)
Block 'minecraft:water', '#minecraft:logs' (world interaction conditions)

Data maps (startup)

ExcessiveUtilitiesEvents.registry('<data map>', event => { ... })

Entries are merged into the mod's defaults. event.add(target, value) adds or overrides an entry, event.remove(target) deletes one (defaults included). The target can be an id or a tag ('#...').

Data map add(target, value)
reversing_hoe_conversion block or block tag → block state it turns into ('minecraft:oak_sapling[stage=0]')
nether_lava_dunk_conversion item or item tag thrown into Nether lava → item it turns into ('2x minecraft:blaze_rod')
inversion_ritual_enemy_weight entity type → spawn weight (number) for the inversion ritual
ExcessiveUtilitiesEvents.registry('reversing_hoe_conversion', event => {
    event.add('minecraft:mossy_cobblestone', 'minecraft:cobblestone')   // add or override: block -> block state
    event.add('#minecraft:leaves', 'minecraft:oak_sapling[stage=0]')    // a block tag as target
    event.remove('minecraft:farmland')                                  // delete an entry (defaults too)
})

ExcessiveUtilitiesEvents.registry('nether_lava_dunk_conversion', event => {
    event.add('minecraft:blaze_powder', '2x minecraft:blaze_rod')
    event.add('#c:ingots/copper', 'minecraft:netherite_scrap')
    event.remove('#c:nuggets/gold')
})

ExcessiveUtilitiesEvents.registry('inversion_ritual_enemy_weight', event => {
    event.add('minecraft:creeper', 8)
    event.add('minecraft:witch', 2.5)
    event.remove('minecraft:phantom')
})

Crusher

event.recipes.excessive_utilities.crusher(primaryOutput, ingredient[, secondaryOutput, secondaryChance])

Method Description Default
.secondaryOutput(item) Second output item none
.secondaryChance(0..1) (alias .chance) Chance of the secondary output 0
.ticks(n) (alias .time) Processing time in ticks 200
.fePerTick(n) (alias .energy) FE used per tick 20
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.crusher('minecraft:gravel', 'minecraft:cobblestone')
    event.recipes.excessive_utilities.crusher('2x minecraft:sand', '#c:gravels', 'minecraft:flint', 0.25) // secondary output and chance as arguments
    event.recipes.excessive_utilities.crusher('4x minecraft:bone_meal', '#c:bones')
        .secondaryOutput('minecraft:bone_meal')  // second output item
        .secondaryChance(0.5)                    // chance of the secondary output (alias: .chance())
        .ticks(100)                              // processing time (alias: .time())
        .fePerTick(40)                           // FE per tick (alias: .energy())
})

Enchanter

event.recipes.excessive_utilities.enchanter(output, left, right[, fePerTick, ticks]) — left and right are sized inputs.

Method Description Default
.fePerTick(n) (alias .energy) FE used per tick 40
.ticks(n) (alias .time) Processing time in ticks 600
.enchantingPower(n) Bookshelf enchanting power needed 15
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.enchanter('excessive_utilities:block_of_enchanted_metal', '#c:storage_blocks/gold', '9x #c:gems/lapis')
    event.recipes.excessive_utilities.enchanter('2x minecraft:experience_bottle', '2x minecraft:glass_bottle', 'minecraft:emerald', 20, 200)
    event.recipes.excessive_utilities.enchanter('minecraft:enchanted_golden_apple', '8x minecraft:gold_block', 'minecraft:apple')
        .fePerTick(160)       // FE per tick (alias: .energy())
        .ticks(1600)          // processing time (alias: .time())
        .enchantingPower(30)  // bookshelf power needed
})

Resonator

event.recipes.excessive_utilities.resonator(output, ingredient[, gpCost])

Method Description Default
.gpCost(n) (alias .gp) Grid power used 1
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.resonator('excessive_utilities:heating_coil', 'minecraft:copper_block', 16)
    event.recipes.excessive_utilities.resonator('minecraft:amethyst_shard', 'minecraft:quartz').gpCost(8) // grid power used (alias: .gp())
})

World Interaction Upgrade

event.recipes.excessive_utilities.world_interaction_item(output[, on, adjacent]) event.recipes.excessive_utilities.world_interaction_fluid(fluidOutput[, on, adjacent])

All block conditions are optional and accept ids or block tags.

Method Description Default
.on(block) Block the machine sits on none
.adjacent([blocks]) Blocks around the machine; repeat an id to require it several times []
.behind(block) Block behind the machine none
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.world_interaction_item('minecraft:cobblestone', 'minecraft:stone', ['minecraft:water', 'minecraft:lava'])
    event.recipes.excessive_utilities.world_interaction_item('minecraft:obsidian')
        .on('minecraft:crying_obsidian')                 // block the machine sits on
        .adjacent(['minecraft:lava', 'minecraft:lava'])  // blocks around it (lava twice)
        .behind('#minecraft:logs')                       // block behind it (tag)
    event.recipes.excessive_utilities.world_interaction_fluid('100x minecraft:lava', 'minecraft:magma_block', ['minecraft:lava'])
    event.recipes.excessive_utilities.world_interaction_fluid(Fluid.of('minecraft:water', 250)).behind('minecraft:ice') // fluid output, only a block behind
})

Generator fuels

All three fuel types share these chained methods:

Method Description Default
.fePerTick(n) (alias .energy) FE generated per tick 40
.duration(ticks) (aliases .ticks, .time) Burn time in ticks 400
Type Signature Generator types
single_item_fuel single_item_fuel(generatorType, ingredient) ender, explosive, pink, nether_star, frosty, halitosis, death
item_and_fluid_fuel item_and_fluid_fuel(generatorType, itemIngredient, fluidIngredient) slimy, heated_redstone
magmatic_fuel magmatic_fuel(fluidIngredient) Lava Generator
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.single_item_fuel('death', 'minecraft:rotten_flesh')
        .fePerTick(40)     // FE generated per tick (alias: .energy())
        .duration(200)     // burn time in ticks (aliases: .ticks(), .time())
    event.recipes.excessive_utilities.single_item_fuel('pink', '#c:dyes/pink')
        .fePerTick(60)
        .duration(150)

    event.recipes.excessive_utilities.item_and_fluid_fuel('heated_redstone', '#c:storage_blocks/redstone', '1000x #c:lava')
        .fePerTick(3200)
        .duration(1125)

    event.recipes.excessive_utilities.magmatic_fuel('10x minecraft:water')  // Lava Generator fuel
        .fePerTick(20)
        .duration(5)
})

Special shaped recipes

All take (result, pattern, key) like a vanilla shaped recipe.

Type What it needs Extra method Default
qed Ender Flux Crystals around the QED; optional 4th argument crystalTicks .crystalTicks(n) (aliases .ticks, .time) 300
shaped_unstable Unstable ingots in the grid .stability('either' | 'stable' | 'unstable'): which unstable ingots are accepted 'either'
shaped_division Division sigil in the grid .inversion('either' | 'inverted' | 'uninverted'): required sigil state 'either'
keep_paintbrush Paintbrush stays in the grid none
damage_glass_cutter Glass cutter takes damage none
snow_globe Magical snow globe none
ServerEvents.recipes(event => {
    event.recipes.excessive_utilities.qed('excessive_utilities:ender_flux_crystal', [
        ' E ',
        'EDE',
        ' E '
    ], {
        E: '#c:ender_pearls',
        D: '#c:gems/diamond'
    }).crystalTicks(600) // crafting time with crystals (aliases: .ticks(), .time())

    event.recipes.excessive_utilities.shaped_unstable('minecraft:beacon', ['UUU', 'UNU', 'OOO'], {
        U: 'excessive_utilities:unstable_ingot',
        N: 'minecraft:nether_star',
        O: 'minecraft:obsidian'
    }).stability('unstable') // which unstable ingots are accepted

    event.recipes.excessive_utilities.shaped_division('excessive_utilities:unstable_ingot', ['I', 'S', 'D'], {
        I: '#c:ingots/iron',
        S: 'excessive_utilities:division_sigil',
        D: '#c:gems/diamond'
    }).inversion('uninverted') // required state of the division sigil

    event.recipes.excessive_utilities.keep_paintbrush('8x minecraft:white_wool', ['WWW', 'WPW', 'WWW'], {
        W: '#minecraft:wool',
        P: 'excessive_utilities:paintbrush'
    })
    event.recipes.excessive_utilities.damage_glass_cutter('4x minecraft:glass_pane', ['G', 'C'], {
        G: '#c:glass_blocks',
        C: 'excessive_utilities:glass_cutter'
    })
    event.recipes.excessive_utilities.snow_globe('minecraft:snow_block', ['SSS', 'SGS', 'SSS'], {
        S: 'minecraft:snowball',
        G: 'excessive_utilities:magical_snow_globe'
    })
})


Extended Crafting integration

Recipes for every table tier, the ender and flux crafters, the combination crafting core and the compressor, plus new singularities, compressor catalysts and crafting components. It also adds the in-game KubeJS Recipe Maker.

Required mods: Extended Crafting 7.0.x (+ Cucumber). KubeJS Infinity Extras loads this only when Extended Crafting is installed.

Part Script folder
ExtendedCraftingEvents.registry(...) startup_scripts
event.recipes.extendedcrafting.* recipes server_scripts

Registries (startup)

Singularities — ExtendedCraftingEvents.registry('singularities', ...)

Extended Crafting has no singularity registry (it reads config/extendedcrafting/singularities/*.json), so these are added to its list on every recipe reload, synced to clients, given a compressor recipe and shown in JEI. Plain ids get the kubejs namespace.

Method Description Default
.name(text) en_us name (lang key singularity.<ns>.<id>) title-cased id
.lang(key) Own translation key -
.colors(overlay, underlay) Two colors (numbers or 'RRGGBB' strings) -
.color(c) One color; the underlay is a darker shade -
.ingredient(idOrTag) Item or tag that is compressed -
.items(ids...) Several items that are compressed -
.materialCount(n) / .count(n) Items needed config singularity_materials_required
.inUltimateSingularity(bool) Part of the Ultimate Singularity recipe true
.catalyst(item) Compressor catalyst config value
.powerCost(fe) / .energy(fe) Total FE config value
.powerRate(fe) FE/t config value
.noRecipe() No automatic compressor recipe recipe on

Catalysts and components — 'catalysts', 'components'

Regular KubeJS item builders (.displayName(), .lang(), .texture(), .rarity(), ...). Catalysts are the "cores" that go in the compressor's catalyst slot; default texture extendedcrafting:item/basic_catalyst. Components default to extendedcrafting:item/basic_component. Also available as item types extendedcrafting:catalyst and extendedcrafting:component in StartupEvents.registry('item', ...).

// kubejs/startup_scripts/extendedcrafting.js
ExtendedCraftingEvents.registry('singularities', event => {
  event.create('uranium')                              // id kubejs:uranium
    .name('Uranium')                                   // en_us name
    .colors(0x4AA43A, 0x2B6122)                        // overlay, underlay
    .ingredient('#c:ingots/uranium')                   // tag or item that is compressed
    .materialCount(2000)                               // items needed
    .inUltimateSingularity(true)                       // part of the Ultimate Singularity
    .catalyst('extendedcrafting:ultimate_catalyst')    // compressor catalyst
    .powerCost(5000000)                                // total FE
    .powerRate(5000)                                   // FE/t

  event.create('kubejs:cobblestone')
    .lang('singularity.kubejs.cobble')                 // own translation key
    .color('808080')                                   // one color, darker underlay
    .items('minecraft:cobblestone', 'minecraft:cobbled_deepslate')   // several items
    .count(10000)                                      // alias of .materialCount()

  event.create('kubejs:special')
    .colors('FF00FF', '7F007F')                        // 'RRGGBB' strings
    .ingredient('minecraft:nether_star')               // no name: "Special" is generated
    .inUltimateSingularity(false)                      // not in the Ultimate Singularity
    .energy(8000000)                                   // alias of .powerCost()
    .noRecipe()                                        // no automatic compressor recipe
})

ExtendedCraftingEvents.registry('catalysts', event => {
  event.create('kubejs:uranium_catalyst')              // compressor catalyst item
    .lang('item.kubejs.uranium_core')                  // own translation key
    .texture('kubejs:item/uranium_catalyst')           // own texture
    .rarity('rare')                                    // KubeJS item option
})

ExtendedCraftingEvents.registry('components', event => {
  event.create('kubejs:uranium_component')             // crafting component item
    .displayName('Uranium Component')                  // en_us name
})

StartupEvents.registry('item', event => {
  event.create('kubejs:void_catalyst', 'extendedcrafting:catalyst')      // catalyst type
  event.create('kubejs:void_component', 'extendedcrafting:component')    // component type
})

Recipes (server)

Tables

event.recipes.extendedcrafting.shaped_table(result, [pattern], { A: 'item' }) event.recipes.extendedcrafting.shapeless_table(result, [ingredients])

Method Description Default
.tier(n) 0 = any table big enough, 1 basic 3x3, 2 advanced 5x5, 3 elite 7x7, 4 ultimate 9x9 0
// kubejs/server_scripts/extendedcrafting.js
ServerEvents.recipes(event => {
  // tier 0: any table that fits (no .tier())
  event.recipes.extendedcrafting.shaped_table('minecraft:golden_apple', [
    'GGG',
    'GAG',
    'GGG'
  ], {
    G: '#c:ingots/gold',
    A: 'minecraft:apple'
  })

  event.recipes.extendedcrafting.shapeless_table('minecraft:cake', [
    'minecraft:milk_bucket', 'minecraft:sugar', 'minecraft:egg', 'minecraft:wheat'
  ])                                                   // shapeless, any table

  // tier 1: basic 3x3
  event.recipes.extendedcrafting.shapeless_table('2x minecraft:netherite_ingot', [
    'minecraft:netherite_scrap', 'minecraft:netherite_scrap', 'minecraft:netherite_scrap',
    'minecraft:netherite_scrap', '#c:ingots/gold', '#c:ingots/gold'
  ]).tier(1)                                           // basic table only

  // tier 2: advanced 5x5
  event.recipes.extendedcrafting.shaped_table('minecraft:diamond_block', [
    'DDDDD',
    'D   D',
    'D N D',
    'D   D',
    'DDDDD'
  ], {
    D: 'minecraft:diamond',
    N: 'minecraft:nether_star'
  }).tier(2)                                           // advanced table only

  // tier 3: elite 7x7
  event.recipes.extendedcrafting.shaped_table('minecraft:beacon', [
    'OOOOOOO',
    'OGGGGGO',
    'OG   GO',
    'OG N GO',
    'OG   GO',
    'OGGGGGO',
    'OOOOOOO'
  ], {
    O: 'minecraft:obsidian',
    G: 'minecraft:glass',
    N: 'minecraft:nether_star'
  }).tier(3)                                           // elite table only

  // tier 4: ultimate 9x9
  event.recipes.extendedcrafting.shaped_table('minecraft:dragon_egg', [
    'NNNNNNNNN',
    'NEEEEEEEN',
    'NE     EN',
    'NE  H  EN',
    'NE HSH EN',
    'NE  H  EN',
    'NE     EN',
    'NEEEEEEEN',
    'NNNNNNNNN'
  ], {
    N: 'minecraft:netherite_block',
    E: 'minecraft:end_stone_bricks',
    H: 'minecraft:dragon_head',
    S: 'minecraft:nether_star'
  }).tier(4)                                           // ultimate table only
})

Combination crafting (crafting core + pedestals)

event.recipes.extendedcrafting.combination(result, coreInput, [pedestalInputs])

Method Description Default
.powerCost(fe) / .energy(fe) Total FE 100000
.powerRate(fe) FE/t 500
event.recipes.extendedcrafting.combination('minecraft:elytra', 'minecraft:phantom_membrane', [
  'minecraft:feather', 'minecraft:feather', 'minecraft:feather', 'minecraft:feather'
])                                                     // result, core item, pedestal items
  .powerCost(500000)                                   // total FE
  .powerRate(1000)                                     // FE/t

event.recipes.extendedcrafting.combination('kubejs:void_catalyst', 'extendedcrafting:advanced_catalyst', [
  'kubejs:void_component', 'kubejs:void_component', 'kubejs:void_component', 'kubejs:void_component'
])
  .energy(1000000)                                     // alias of .powerCost()

Compressor

event.recipes.extendedcrafting.compressor(result, 'Nx input'[, catalyst]) — the count is the amount the compressor needs.

Method Description Default
.catalyst(item) Catalyst slot item extendedcrafting:ultimate_catalyst
.powerCost(fe) / .energy(fe) Total FE 5000000
.powerRate(fe) FE/t 5000
event.recipes.extendedcrafting.compressor('minecraft:nether_star', '64x minecraft:wither_skeleton_skull', 'extendedcrafting:ultimate_catalyst')   // catalyst as 3rd argument
  .powerCost(10000000)                                 // total FE
  .powerRate(10000)                                    // FE/t

event.recipes.extendedcrafting.compressor('kubejs:uranium_catalyst', '1000x #c:ingots/uranium')
  .catalyst('extendedcrafting:basic_catalyst')         // catalyst slot item
  .energy(2000000)                                     // alias of .powerCost()

// custom recipe for a singularity registered with .noRecipe()
event.recipes.extendedcrafting.compressor(Item.of('extendedcrafting:singularity', '[extendedcrafting:singularity_id="kubejs:special"]'), '16x minecraft:nether_star', 'kubejs:uranium_catalyst')
  .powerCost(20000000)

Ender crafter

event.recipes.extendedcrafting.shaped_ender_crafter(result, [pattern], { A: 'item' }) event.recipes.extendedcrafting.shapeless_ender_crafter(result, [ingredients])

Method Description Default
.craftingTime(s) / .time(s) Crafting time Extended Crafting config value
event.recipes.extendedcrafting.shaped_ender_crafter('minecraft:ender_eye', [' P ', 'PBP', ' P '], {
  P: 'minecraft:ender_pearl',
  B: 'minecraft:blaze_powder'
}).craftingTime(40)                                    // crafting time

event.recipes.extendedcrafting.shapeless_ender_crafter('4x minecraft:end_stone', ['minecraft:stone', 'minecraft:ender_pearl'])
  .time(20)                                            // alias of .craftingTime()

Flux crafter

event.recipes.extendedcrafting.shaped_flux_crafter(result, [pattern], { A: 'item' }) event.recipes.extendedcrafting.shapeless_flux_crafter(result, [ingredients])

Method Description Default
.powerRequired(fe) (aliases .power, .energy) Total FE 100000
.powerRate(fe) FE/t 1000
event.recipes.extendedcrafting.shaped_flux_crafter('minecraft:beacon', ['GGG', 'GNG', 'OOO'], {
  G: 'minecraft:glass',
  N: 'minecraft:nether_star',
  O: 'minecraft:obsidian'
})
  .powerRequired(1000000)                              // total FE
  .powerRate(5000)                                     // FE/t

event.recipes.extendedcrafting.shapeless_flux_crafter('minecraft:redstone_block', ['minecraft:redstone', 'minecraft:redstone', 'minecraft:redstone', 'minecraft:glowstone_dust'])
  .power(200000)                                       // alias of .powerRequired() (also .energy())


Farming for Blockheads integration

Registers Market categories (the filter buttons) and Market presets (shared price and on/off switch) from startup scripts, and adds a schema for Market entries (farmingforblockheads:market recipes, shown in JEI).

Required mods: Farming for Blockheads 21.1.9+ (sortIndex on entries needs 21.1.14+) (KubeJS Infinity Extras loads this only when Farming for Blockheads is installed)

Part Script folder
FarmingForBlockheadsEvents.registry('market_categories' / 'market_presets') startup_scripts (needs a game restart)
event.recipes.farmingforblockheads.market server_scripts

Categories and presets are the mod's data pack files (data/<ns>/market_categories, data/<ns>/market_presets), generated into the KubeJS data pack on every reload.


Registry: market_categories

FarmingForBlockheadsEvents.registry('market_categories', event => event.create(id)) — plain names get the kubejs namespace. Built-in ids: farmingforblockheads:seeds (10), :saplings (20), :flowers (30), :other (40). Reusing an existing id overrides it.

Method Description Default
.icon(item) Item shown on the button —
.tooltip(text) / .name(text) / .displayName(text) Hover text (becomes the en_us name); Text.translate('key') works like .lang() name generated from the id
.lang(key) Own translation key —
.sortIndex(n) Button order —
// startup_scripts
FarmingForBlockheadsEvents.registry('market_categories', event => {
  event.create('kubejs:gems')
    .icon('minecraft:diamond')             // item on the button
    .tooltip('Gems & Minerals')            // hover text / English name
    .sortIndex(50)                         // button order

  event.create('kubejs:mob_drops')
    .icon('minecraft:bone')
    .lang('category.kubejs.mob_drops')     // own translation key
    .sortIndex(60)

  event.create('kubejs:dyes')
    .icon('minecraft:red_dye')
    .name('Dyes')                          // alias of .tooltip()
    .sortIndex(70)

  event.create('kubejs:ores')
    .icon('minecraft:raw_iron')
    .displayName(Text.translate('category.kubejs.ores')) // alias of .tooltip(); a translatable text works like .lang()

  event.create('farmingforblockheads:other') // existing id: overrides the built-in tab
    .icon('minecraft:composter')
    .sortIndex(40)
})

Registry: market_presets

FarmingForBlockheadsEvents.registry('market_presets', event => event.create(id)) — shared default price and on/off switch for a group of entries. The addon always provides kjsinfinityextras:default (enabled, 1 emerald), used by entries without a preset.

Method Description Default
.enabled(bool) Sold by default (the mod config can still disable it) true
.payment(ingredient[, count]) Price: item or #tag and count count 1
.paymentTooltip(text) Text on the price slot —
// startup_scripts
FarmingForBlockheadsEvents.registry('market_presets', event => {
  event.create('kubejs:gems')
    .enabled(true)                      // sold by default
    .payment('minecraft:emerald', 8)    // price: 8 emeralds

  event.create('kubejs:cheap')
    .payment('#c:nuggets/gold')         // count defaults to 1
    .paymentTooltip('Any gold nugget')  // text on the price slot

  event.create('kubejs:disabled_group')
    .enabled(false)                     // listed only when enabled in the mod config
})

Market entry

event.recipes.farmingforblockheads.market(result[, category[, preset[, payment]]])

  • category defaults to farmingforblockheads:other.
  • preset defaults to kjsinfinityextras:default.
  • payment ('3x minecraft:gold_ingot', '4x #c:crops/wheat') defaults to the preset's price.
Method Description Default
.payment(value) / .price(value) / .cost(value) Own price preset price
.paymentTooltip(text) Tooltip on the price (needs a payment set first) —
.icon(item) Icon override result
.sortIndex(n) / .sort_index(n) Order inside the tab (21.1.14+) —
.category(id) / .preset(id) Category and preset see above
// server_scripts
ServerEvents.recipes(event => {
  event.recipes.farmingforblockheads.market('minecraft:diamond', 'kubejs:gems', 'kubejs:gems')  // result, category, preset (preset price)
  event.recipes.farmingforblockheads.market('2x minecraft:emerald', 'kubejs:gems', 'kubejs:gems', '3x minecraft:gold_ingot') // own price as 4th argument

  event.recipes.farmingforblockheads.market('minecraft:bone', 'kubejs:mob_drops')
    .payment('2x minecraft:rotten_flesh')     // own price (aliases: .price(), .cost())

  event.recipes.farmingforblockheads.market('minecraft:sugar_cane', 'farmingforblockheads:seeds', 'minecraft:seeds')
    .payment('4x #c:crops/wheat')
    .paymentTooltip('Any wheat')              // tooltip on the price (needs a payment first)
    .icon('minecraft:paper')                  // icon override
    .sortIndex(5)                             // order inside the tab, 21.1.14+ (alias: .sort_index())

  event.recipes.farmingforblockheads.market('minecraft:cactus')  // category "other", default preset
    .category('farmingforblockheads:saplings') // changes the category
    .preset('kubejs:cheap')                    // changes the preset

  event.remove({ type: 'farmingforblockheads:market', output: 'minecraft:melon_seeds' }) // remove like any recipe
})


FTB Chunks integration

Adds the FTBChunksExtrasEvents group (entering and leaving claimed land) and the FTBChunksExtras binding (claim queries, claiming as a player, admin unclaim, extra claim / force-load limits, protection checks) on top of FTB's official KubeJS support.

Required mods: FTB Chunks 2101.1.x and FTB XMod Compat 21.1.x (KubeJS Infinity Extras loads this only when FTB Chunks is installed)

Part Script folder
FTBChunksExtrasEvents.* server_scripts
FTBChunksExtras binding server_scripts

Already provided by FTB XMod Compat (not duplicated here): FTBChunksEvents.before('claim' | 'unclaim' | 'load' | 'unload', ...) (cancel or setCustomResult(key)) and FTBChunksEvents.after(...).

Positions are block positions ([x, y, z] or a BlockPos); the chunk containing them is used.


Events: enteredClaim / leftClaim

FTBChunksExtrasEvents.enteredClaim(event => { ... }) — a player walked into land claimed by another team than the chunk they came from (also from the wilderness). FTBChunksExtrasEvents.leftClaim(event => { ... }) — a player walked out of a team's land.

Moving between chunks of the same team fires nothing; moving straight from team A to team B fires leftClaim (A) then enteredClaim (B).

Property Description
event.player The player
event.team The owning team
event.teamName / event.teamId Display name (plain text) and id of the team
event.chunk The claimed chunk
event.memberOrAlly Whether the player is a member or ally of the owner
FTBChunksExtrasEvents.enteredClaim(event => {
  if (!event.memberOrAlly) {                       // not their own or an allied team
    event.player.setStatusMessage(Text.yellow(`Entering ${event.teamName}'s land`)) // team display name
  }
  console.info(`${event.teamId} ${event.team} ${event.chunk}`) // team id, team object, claimed chunk
})

FTBChunksExtrasEvents.leftClaim(event => {
  event.player.setStatusMessage(Text.gray(`Leaving ${event.teamName}'s land`))
})

Binding: FTBChunksExtras

Claim queries

Call Description
isClaimed(level, pos) Whether the chunk is claimed
getClaim(level, pos) The ClaimedChunk, or null
getOwnerName(level, pos) / getOwnerId(level, pos) Owning team name / id, or null
isForceLoaded(level, pos) Whether the chunk is force loaded
isMemberOrAlly(level, pos, player) Player belongs to (or is allied with) the owner
allowsPvp(level, pos) / allowsExplosions(level, pos) / allowsMobGriefing(level, pos) Team settings of the claim (true when unclaimed)

Actions as a player

Limits and rules apply, and FTBChunksEvents.before(...) fires. They return 'success' or a problem id such as 'ftbchunks.claim_result.not_enough_power' (usable with Text.translate).

Call Description
claim(player, pos) / unclaim(player, pos) Claim / unclaim
forceLoad(player, pos) / unforceLoad(player, pos) Force load / stop
adminUnclaim(level, pos) Removes any team's claim. Returns false when it was not claimed

Limits

Personal bonus, like /ftbchunks admin extra_claim_chunks.

Call Description
getExtraClaimChunks(player) / setExtraClaimChunks(player, n) / addExtraClaimChunks(player, n) Extra claim chunks
getExtraForceLoadChunks(player) / setExtraForceLoadChunks(player, n) / addExtraForceLoadChunks(player, n) Extra force-load chunks
getMaxClaimChunks(player) / getMaxForceLoadChunks(player) Limit of the player's team (config base + bonuses)
getClaimedCount(player) / getForceLoadedCount(player) Chunks used by the player's team

Protection

Call Description
isProtected(player, pos, type) Whether FTB Chunks would stop the player. Types: edit_block, interact_block, right_click_item, edit_fluid, interact_entity, attack_nonliving_entity
getBypassProtection(player) / setBypassProtection(player, bool) Admin bypass (same flag as /ftbchunks admin bypass_protection)
// claim queries and actions
BlockEvents.rightClicked('minecraft:lodestone', event => {
  let player = event.player
  let level = event.level
  let pos = event.block.pos
  if (FTBChunksExtras.isClaimed(level, pos)) {                               // claimed?
    player.tell(`Owned by ${FTBChunksExtras.getOwnerName(level, pos)} (${FTBChunksExtras.getOwnerId(level, pos)})`) // owner name and id
    player.tell(`Force loaded: ${FTBChunksExtras.isForceLoaded(level, pos)}`)  // force-load state
    player.tell(`Claim: ${FTBChunksExtras.getClaim(level, pos)}`)              // the ClaimedChunk object
    player.tell(`Yours or allied: ${FTBChunksExtras.isMemberOrAlly(level, pos, player)}`)
    player.tell(`PvP ${FTBChunksExtras.allowsPvp(level, pos)}, explosions ${FTBChunksExtras.allowsExplosions(level, pos)}, mob griefing ${FTBChunksExtras.allowsMobGriefing(level, pos)}`) // team settings
  } else {
    let result = FTBChunksExtras.claim(player, pos)                           // claim as the player
    player.tell(result == 'success' ? 'Chunk claimed!' : Text.translate(result))
  }
})

BlockEvents.rightClicked('minecraft:respawn_anchor', event => {
  let player = event.player
  let pos = event.block.pos
  if (player.crouching) {
    FTBChunksExtras.unclaim(player, pos)                                      // unclaim as the player
    FTBChunksExtras.unforceLoad(player, pos)                                  // stop force loading
  } else {
    FTBChunksExtras.forceLoad(player, pos)                                    // force load as the player
  }
})

ServerEvents.commandRegistry(event => {
  const Commands = event.commands
  event.register(Commands.literal('wipe_claim')
    .requires(source => source.hasPermission(2))
    .executes(ctx => {
      let player = ctx.source.player
      FTBChunksExtras.adminUnclaim(player.level, player.blockPosition())      // removes any team's claim
      FTBChunksExtras.setBypassProtection(player, !FTBChunksExtras.getBypassProtection(player)) // toggles admin bypass
      return 1
    }))
})

// limits
FTBQuestsEvents.completed('#land_expansion', event => {
  event.onlineMembers.forEach(player => {
    FTBChunksExtras.addExtraClaimChunks(player, 10)                           // +10 claim chunks
    FTBChunksExtras.addExtraForceLoadChunks(player, 2)                        // +2 force-load chunks
    player.tell(`You can now claim ${FTBChunksExtras.getMaxClaimChunks(player)} chunks (${FTBChunksExtras.getClaimedCount(player)} used)`)
    player.tell(`Force load: ${FTBChunksExtras.getMaxForceLoadChunks(player)} (${FTBChunksExtras.getForceLoadedCount(player)} used)`)
  })
})

PlayerEvents.loggedIn(event => {
  let player = event.player
  if (FTBChunksExtras.getExtraClaimChunks(player) > 100) FTBChunksExtras.setExtraClaimChunks(player, 100)           // caps the claim bonus
  if (FTBChunksExtras.getExtraForceLoadChunks(player) > 10) FTBChunksExtras.setExtraForceLoadChunks(player, 10)     // caps the force-load bonus
})

// protection
ItemEvents.rightClicked('minecraft:blaze_rod', event => {
  let player = event.player
  if (FTBChunksExtras.isProtected(player, player.blockPosition(), 'edit_block')) { // would FTB Chunks block it?
    player.tell(Text.red('You can not use this here'))
    event.cancel()
  }
})


FTB Echoes integration

FTB Echoes has no KubeJS support of its own and no recipe types. KubeJS Infinity Extras adds the FTBEchoesExtrasEvents.echoes event to write echo definitions from scripts (/reload works) and the FTBEchoesExtras binding for progress, rewards, shop stock, the echo screen, currency and game stages.

Required mods: FTB Echoes 21.1.x (+ FTB Library, FTB Teams) (KubeJS Infinity Extras loads this only when FTB Echoes is installed)

Part Script folder
FTBEchoesExtrasEvents.echoes server_scripts
FTBEchoesExtras binding server_scripts

Stage indexes start at 0. Text arguments accept plain strings or Text components.


Event: echoes

FTBEchoesExtrasEvents.echoes(event => { ... }) — echo definitions (data/<ns>/echo_definitions).

Call Description
event.create(id) New echo; the id is also the data file id, so it replaces an echo with the same id
event.remove(id) Removes an echo

Echo builder

Method Description Default
.title(text) Echo title —
.stage(stage => ...) Adds the next stage —
.allComplete(text) Message once every stage is complete —
.villager(type, profession, level[, showHat]) Villager model shown by the Echo Projector —
.noModel() Hides the projected villager —

Stage builder

Method Description Default
.title(text) Stage title —
.hideTitleInLore() Hides the title in the lore page shown
.requiredStage(gameStage) Game stage needed to complete it (KubeJS stages work) —
.text(text) Lore text (\n for new lines) —
.image(texture[, width, height[, align]]) Lore image; align left, center, right align left
.audio(sound[, text]) Play button for a sound event ('music_disc.mellohi') —
.notReady(text) / .ready(text) / .completed(text) Messages for each state —
.shop(name, shop => ...) Shop entry unlocked by this stage; name must be unique within the echo —
.reward(reward => ...) Completion reward —

Shop entry builder

Method Description Default
.item(item) Item sold ('3x minecraft:map') —
.command(command[, permission[, silent]]) Command run instead of an item (needs .icon()) permission 0, silent true
.icon(icon) FTB Library icon: a texture ('ftblibrary:icons/settings') or 'item:minecraft:diamond' —
.cost(n) Price in echo currency (min 1) —
.description(text) Tooltip line (repeatable) —
.maxClaims(n) Stock limit unlimited
.perPlayerMaxClaims() Stock limit per player instead of per team per team
.maxStage(n) Last stage the entry stays available —

Reward builder

Method Description Default
.item(item) Item reward —
.experience(n) XP reward —
.currency(n) Echo currency reward —
.command(command[, permission[, silent]]) Command reward permission 0, silent true
.commandDescription(text) Tooltip line describing the command —
.description(text) Tooltip line (repeatable) —
.manualClaim() Claimed from the echo screen instead of automatically automatic
// server_scripts
FTBEchoesExtrasEvents.echoes(event => {
  event.create('kubejs:the_wanderer')                           // echo id (replaces an echo with the same id)
    .title(Text.gold('The Wanderer'))                           // echo title
    .villager('minecraft:savanna', 'minecraft:cartographer', 3) // projected villager: type, profession, level
    .allComplete(Text.lightPurple('The Wanderer has nothing more to teach you.')) // after the last stage
    .stage(stage => stage                                       // stage 0
      .title('First Steps')                                     // stage title
      .requiredStage('wanderer_1')                              // game stage needed to complete it
      .text('Every journey begins with a single step.\nFind some iron.') // lore text
      .image('ftblibrary:icons/player', 32, 32, 'center')       // image with size and alignment
      .audio('music_disc.mellohi', 'Listen')                    // play button with a label
      .notReady('Come back once you have found iron.')          // before the game stage is reached
      .ready('Well done, traveller!')                           // ready to complete
      .completed('You found the iron.')                         // once completed
      .shop('maps', shop => shop                                // shop entry unlocked by this stage
        .item('3x minecraft:map')                               // item sold
        .cost(2)                                                // price in echo currency
        .description('Blank maps for your travels')             // tooltip line
        .maxClaims(5)                                           // stock limit
        .perPlayerMaxClaims()                                   // limit per player instead of per team
        .maxStage(1))                                           // available up to stage 1
      .shop('bonus_xp', shop => shop
        .command('/xp add @s 100', 2)                           // command entry, permission level 2
        .icon('ftblibrary:icons/settings')                      // command entries need an icon
        .description('100 XP')
        .cost(4))
      .shop('quiet_heal', shop => shop
        .command('/effect give @s minecraft:regeneration 10')   // permission 0, silent
        .icon('item:minecraft:golden_apple')                    // item icon
        .cost(1))
      .shop('loud_time', shop => shop
        .command('/time set day', 2, false)                     // permission 2, output not silent
        .icon('item:minecraft:clock')
        .cost(3))
      .reward(reward => reward                                  // completion reward
        .item('minecraft:compass')                              // item
        .experience(10)                                         // XP
        .currency(2)                                            // echo currency
        .description('A compass to guide you')))                // tooltip line
    .stage(stage => stage                                       // stage 1
      .title('Into the Unknown')
      .hideTitleInLore()                                        // title hidden on the lore page
      .requiredStage('wanderer_2')
      .text('Now cross the Nether.')
      .image('ftblibrary:icons/fire')                           // image with default size, left
      .image('ftblibrary:icons/fire', 24, 24)                   // image with size, left
      .audio('music_disc.pigstep')                              // play button without a label
      .notReady('The Nether awaits.')
      .ready('You survived!')
      .reward(reward => reward
        .command('/give @s minecraft:ender_pearl 4', 2)         // command reward, permission 2
        .commandDescription('4 Ender Pearls')                   // tooltip line for the command
        .manualClaim()))                                        // claimed from the screen
    .stage(stage => stage                                       // stage 2
      .title('Home Again')
      .reward(reward => reward
        .command('/say Welcome home')                           // permission 0, silent
        .command('/say Welcome home', 0, false)))               // explicit permission and not silent (replaces the previous command)

  event.create('kubejs:the_hermit')
    .title('The Hermit')
    .villager('minecraft:taiga', 'minecraft:librarian', 5, false) // fourth argument: show the hat
    .noModel()                                                    // hides the projected villager
    .stage(stage => stage.title('Silence').text('...'))

  event.remove('ftbechoes:test_echo1')                          // removes an echo
})

PlayerEvents.inventoryChanged('minecraft:iron_ingot', event => event.player.stages.add('wanderer_1'))

Binding: FTBEchoesExtras

Progress belongs to the player's team.

Call Description
getEchoIds() / exists(id) Echo ids / whether one exists
getStageCount(id) Number of stages
getRequiredGameStage(id, stage) Game stage a stage requires (empty when unknown)
getCurrentStage(player, id) Number of completed stages
isStageCompleted(player, id, stage) / isCompleted(player, id) Progress checks
setStage(player, id, completedStages) Sets progress (0 = nothing, stage count = all). No rewards given
reset(player, id) Resets progress to the first stage. No rewards given
tryCompleteStage(player, id) Completes the current stage like the screen button (needs the game stage, gives auto rewards)
isRewardClaimed(player, id, stage) Whether a stage reward is claimed
claimReward(player, id, stage) Gives and marks the reward of a completed stage
resetReward(player, id, stage) / resetAllRewards(player, id) Marks rewards unclaimed
resetShopStock(player, id) Restocks the limited shop entries
open(player, id[, page]) Opens the echo screen; page 'lore' or 'shop'
getCurrency(player) / giveCurrency(player, n) / takeCurrency(player, n) Echo currency (takeCurrency returns false and takes nothing if not enough)
getCurrencyProvider() Active currency provider
hasGameStage(player, s) / addGameStage(player, s) / removeGameStage(player, s) Game stages
getStageProvider() Active game stage provider
// server_scripts
ItemEvents.rightClicked('minecraft:spyglass', event => {
  let player = event.player
  if (player.crouching) {
    FTBEchoesExtras.open(player, 'kubejs:the_wanderer', 'shop')  // opens the shop page
    return
  }
  let done = FTBEchoesExtras.getCurrentStage(player, 'kubejs:the_wanderer')  // completed stages
  player.tell(`${done}/${FTBEchoesExtras.getStageCount('kubejs:the_wanderer')} stages done, currency: ${FTBEchoesExtras.getCurrency(player)}`) // stage count, currency
  if (FTBEchoesExtras.tryCompleteStage(player, 'kubejs:the_wanderer')) player.tell('Stage completed!') // like the screen button
})

ItemEvents.rightClicked('minecraft:map', event => {
  FTBEchoesExtras.open(event.player, 'kubejs:the_wanderer')      // opens the echo screen
})

PlayerEvents.loggedIn(event => {
  let player = event.player
  let echo = 'kubejs:the_wanderer'

  // definitions
  console.info(FTBEchoesExtras.getEchoIds())                     // every echo id
  console.info(FTBEchoesExtras.exists(echo))                     // does it exist
  console.info(FTBEchoesExtras.getRequiredGameStage(echo, 0))    // 'wanderer_1'

  // progress (team), no rewards given
  console.info(FTBEchoesExtras.isStageCompleted(player, echo, 0)) // stage 0 done?
  console.info(FTBEchoesExtras.isCompleted(player, echo))         // every stage done?
  FTBEchoesExtras.setStage(player, echo, 1)                       // stage 0 completed, stage 1 current
  FTBEchoesExtras.reset(player, echo)                             // back to the first stage

  // rewards and shop
  if (!FTBEchoesExtras.isRewardClaimed(player, echo, 0)) {         // reward of stage 0 claimed?
    FTBEchoesExtras.claimReward(player, echo, 0)                  // gives and marks it
  }
  FTBEchoesExtras.resetReward(player, echo, 0)                    // reward of stage 0 unclaimed again
  FTBEchoesExtras.resetAllRewards(player, echo)                   // every reward unclaimed again
  FTBEchoesExtras.resetShopStock(player, echo)                    // restocks limited shop entries

  // currency
  FTBEchoesExtras.giveCurrency(player, 5)                         // +5 currency
  if (!FTBEchoesExtras.takeCurrency(player, 3)) player.tell('Not enough currency') // takes 3 if possible
  console.info(FTBEchoesExtras.getCurrencyProvider())             // active currency provider

  // game stages
  if (!FTBEchoesExtras.hasGameStage(player, 'wanderer_2')) {      // has the stage?
    FTBEchoesExtras.addGameStage(player, 'wanderer_2')            // grants it
  }
  FTBEchoesExtras.removeGameStage(player, 'old_stage')            // removes one
  console.info(FTBEchoesExtras.getStageProvider())                // active game stage provider
})


FTB Quests integration

Adds the FTBQuestsExtrasEvents group (reward claims, item grants, loot crate opening) and the FTBQuestsExtras binding (rewards, team-wide progress without an online player, the quest book, loot crates and quest file lookups) on top of FTB's official KubeJS support.

Required mods: FTB Quests 2101.1.x and FTB XMod Compat 21.1.x (KubeJS Infinity Extras loads this only when FTB Quests is installed)

Part Script folder
FTBQuestsExtrasEvents.* server_scripts
FTBQuestsExtras binding server_scripts

Already provided by FTB XMod Compat (not duplicated here): the FTBQuests binding (getObject, getData, getFile...), player.data.ftbquests.complete(id) / reset(id) / addProgress(id, n) / isCompleted(id) / isStarted(id) / getRelativeProgress(id) / locked, and FTBQuestsEvents.customTask / customReward / completed / started / customFilterItem.

Ids: quest object ids are the hex ids of the quest editor (right click > Copy ID) as strings ('1A2B3C4D5E6F7A8B'), or '#tag' (first object with that tag). Prefer strings: JS numbers cannot hold every 64-bit id.


Event: rewardClaim

FTBQuestsExtrasEvents.rewardClaim([rewardIdOrTag,] event => { ... }) — a reward is about to be claimed (button, claim all, auto-claim). event.cancel() keeps it unclaimed.

Property Description
event.player The player claiming
event.reward The FTB Quests reward
event.rewardId Hex id of the reward
event.rewardType Reward type id (ftbquests:item, ftbquests:xp, ...)
event.quest / event.chapter Quest and chapter of the reward
event.teamReward Whether it is a team reward
FTBQuestsExtrasEvents.rewardClaim('#nether_reward', event => {   // only rewards tagged nether_reward
  if (!event.player.stages.has('nether_unlocked')) {
    event.player.tell(Text.red('Enter the Nether before claiming this reward!'))
    event.cancel()                                                // stays unclaimed
  }
})

FTBQuestsExtrasEvents.rewardClaim(event => {                      // every reward
  console.info(`${event.player.username} claims ${event.rewardType} reward ${event.rewardId}`) // type id and hex id
  console.info(`Quest ${event.quest.title.string} in chapter ${event.chapter.title.string}`)   // quest and chapter
  console.info(`Team reward: ${event.teamReward}, object: ${event.reward}`)                     // team flag and the reward object
})

Event: grantItem

FTBQuestsExtrasEvents.grantItem(event => { ... }) — an item reward (from the quest book or a Loot Crate Opener) is about to give an item. event.cancel() blocks it. Do not modify the stack.

Property Description
event.item Copy of the stack about to be given (its count may exceed the max stack size)
event.player Receiving player; null when a Loot Crate Opener works for an offline owner
event.playerId UUID of the receiver
event.level Level
event.opener The Loot Crate Opener block entity; null for a manual claim
event.automated True when an opener gives it
FTBQuestsExtrasEvents.grantItem(event => {
  if (event.automated && event.item.id == 'minecraft:nether_star') { // given by a Loot Crate Opener
    event.cancel()                                                  // blocks the item
  }
  console.info(`${event.item} to ${event.playerId} in ${event.level.dimension} (player online: ${event.player != null}, opener: ${event.opener})`)
})

Event: openLootCrate

FTBQuestsExtrasEvents.openLootCrate([crateId,] event => { ... }) — a loot crate is about to be opened. event.cancel() stops it.

Property / method Description
event.player Player opening it; null for an opener working for an offline owner
event.playerId, event.level UUID and level
event.crate / event.crateId The loot crate and its id
event.opener / event.automated Opener block entity and whether it is automated
event.simulated True when an opener only checks whether it could accept the crate
event.setFailureMessage(text) Message shown when cancelled
FTBQuestsExtrasEvents.openLootCrate('boss_crate', event => {     // only the crate with id boss_crate
  if (event.player && !event.player.stages.has('boss_killed')) {
    event.setFailureMessage(Text.red('This crate is sealed until you defeat the boss')) // shown when cancelled
    event.cancel()
  }
})

FTBQuestsExtrasEvents.openLootCrate(event => {                    // every crate
  if (event.simulated) return                                     // an opener only checking
  console.info(`${event.crateId} (${event.crate}) opened by ${event.playerId} in ${event.level.dimension}, automated: ${event.automated}, opener: ${event.opener}`)
})

Binding: FTBQuestsExtras

Rewards

Call Description
claimReward(player, rewardId[, notify]) Claims the reward if its quest is done and it is not claimed. notify = false hides the toast. Returns true when claimed
claimAllRewards(player[, id]) Claims every ready reward of a quest, chapter or (no id) the whole file, like "claim all". Returns the number claimed
giveReward(player, rewardId) Gives the reward now, ignoring quest state (not marked as claimed)
isRewardClaimed(player, rewardId) Whether it is claimed
isRewardReadyToClaim(player, rewardId) Whether it can be claimed
resetReward(player, rewardId) Marks a claimed reward as unclaimed
hasUnclaimedRewards(player, id) Unclaimed rewards in a quest, chapter or the file
areDependenciesComplete(player, questId) Every dependency of the quest is complete for the player's team

Team-wide progress

team is a team short name, team UUID or a member's UUID — no online player needed.

Call Description
completeForTeam(team, id) Completes a quest object
resetForTeam(team, id) Resets a quest object
isCompletedForTeam(team, id) Whether it is complete
getRelativeProgressForTeam(team, id) Progress 0-100

Quest book and loot crates

Call Description
openBook(player[, id]) Opens the quest book on a chapter / quest / task / reward, or on the last page
lootCrate(crateId) Loot crate item (empty stack for an unknown id)
getLootCrateIds() Every loot crate id

Lookups

Call Description
getChapterIds() Every chapter id
getQuestIds(chapterId) Quest ids of a chapter
getTaskIds(questId) / getRewardIds(questId) Task / reward ids of a quest
findByTag(tag) Ids of every chapter, quest, task and reward with that tag
getTitle(id) Plain title (empty when unknown)
getObjectType(id) file, chapter, quest, task, reward... or empty
exists(id) Whether the object exists
// server_scripts
ItemEvents.rightClicked('minecraft:book', event => {
  if (event.player.crouching) FTBQuestsExtras.openBook(event.player)  // last opened page
  else FTBQuestsExtras.openBook(event.player, '1A2B3C4D5E6F7A8B')     // a chapter / quest / task / reward
})

PlayerEvents.chat(event => {
  let player = event.player
  if (event.message == '!claimall') {
    let n = FTBQuestsExtras.claimAllRewards(player)                    // whole quest file
    n += FTBQuestsExtras.claimAllRewards(player, '0A1B2C3D4E5F6A7B')   // one quest or chapter
    player.tell(`Claimed ${n} rewards`)
    event.cancel()
  }
  if (event.message == '!quests') {
    FTBQuestsExtras.getChapterIds().forEach(chapter => {               // every chapter id
      player.tell(`${FTBQuestsExtras.getTitle(chapter)}: ${FTBQuestsExtras.getQuestIds(chapter).length} quests`) // title, quests of the chapter
    })
    event.cancel()
  }
})

PlayerEvents.loggedIn(event => {
  let player = event.player
  let quest = '1A2B3C4D5E6F7A8B'
  let reward = '0F1E2D3C4B5A6978'

  // rewards
  FTBQuestsExtras.claimReward(player, reward)                          // claims it if ready
  FTBQuestsExtras.claimReward(player, reward, false)                   // same, without the toast
  if (!FTBQuestsExtras.isRewardClaimed(player, reward)) {               // claimed yet?
    FTBQuestsExtras.giveReward(player, reward)                         // gives it now, ignoring quest state
  }
  console.info(FTBQuestsExtras.isRewardReadyToClaim(player, reward))   // quest done and not claimed
  FTBQuestsExtras.resetReward(player, reward)                          // back to unclaimed
  console.info(FTBQuestsExtras.hasUnclaimedRewards(player, quest))     // unclaimed rewards in a quest / chapter / file
  console.info(FTBQuestsExtras.areDependenciesComplete(player, quest)) // every dependency done for the team

  // loot crates
  if (!player.stages.has('starter_crate')) {
    player.stages.add('starter_crate')
    let crate = FTBQuestsExtras.lootCrate('starter')                   // empty stack if the id does not exist
    if (!crate.empty) player.give(crate)
  }
  console.info(FTBQuestsExtras.getLootCrateIds())                      // every crate id

  // lookups
  console.info(FTBQuestsExtras.findByTag('main_story'))                // ids with that tag
  console.info(FTBQuestsExtras.getTaskIds(quest))                      // task ids of the quest
  console.info(FTBQuestsExtras.getRewardIds(quest))                    // reward ids of the quest
  console.info(FTBQuestsExtras.getObjectType(quest))                   // 'quest'
  console.info(FTBQuestsExtras.exists(quest))                          // true if it exists
})

ServerEvents.commandRegistry(event => {
  const Commands = event.commands
  event.register(Commands.literal('reset_red_team')
    .requires(source => source.hasPermission(2))
    .executes(ctx => {
      FTBQuestsExtras.resetForTeam('RedTeam', '1A2B3C4D5E6F7A8B')                     // resets for the whole team
      FTBQuestsExtras.completeForTeam('RedTeam', '#tutorial')                         // completes for the whole team
      console.info(FTBQuestsExtras.isCompletedForTeam('RedTeam', '#tutorial'))        // team completion check
      console.info(FTBQuestsExtras.getRelativeProgressForTeam('RedTeam', '1A2B3C4D5E6F7A8B') + '%') // team progress 0-100
      return 1
    }))
})


FTB Stuff & Things integration

FTB Stuff & Things already ships KubeJS schemas for jar, temperature_source, hammer, crook, fusing_machine, supercooler, sluice and wooden_basin (event.recipes.ftbstuff.<type>(...)). KubeJS Infinity Extras adds the one it leaves out: the Dripper.

Required mods: FTB Stuff & Things 21.1.x (KubeJS Infinity Extras loads this only when FTB Stuff & Things is installed)

Part Script folder
event.recipes.ftbstuff.dripper server_scripts

Dripper

event.recipes.ftbstuff.dripper(output, input, fluid[, chance])

Argument Description
output Block state placed when it works: 'minecraft:mud', 'minecraft:campfire[lit=true]'
input Block below the Dripper: block id, block state or '#tag'
fluid Fluid inside the Dripper, consumed per attempt: Fluid.of('minecraft:water', 50)
Method Description Default
.chance(0..1) Chance that an attempt succeeds 1
.consumeFluidOnFail(bool) (alias .consume_fluid_on_fail) Also use up the fluid when the chance roll fails false
ServerEvents.recipes(event => {
  event.recipes.ftbstuff.dripper('minecraft:mud', 'minecraft:dirt', Fluid.of('minecraft:water', 50))
    .chance(0.25)               // chance that an attempt succeeds (0..1)
    .consumeFluidOnFail(true)   // also use up the fluid when the roll fails (alias: .consume_fluid_on_fail())
    .id('kubejs:dripper/dirt_to_mud')

  event.recipes.ftbstuff.dripper('minecraft:clay', '#minecraft:sand', Fluid.of('minecraft:water', 100), 0.1)
    .id('kubejs:dripper/sand_to_clay')

  event.recipes.ftbstuff.dripper('minecraft:crying_obsidian', 'minecraft:obsidian', Fluid.of('minecraft:lava', 250))
    .chance(0.05)
    .id('kubejs:dripper/crying_obsidian')

  // remove the mod's own dripper recipes
  event.remove({ type: 'ftbstuff:dripper' })
})


FTB Unearthed integration

Adds the FTBUnearthedExtras binding: player unearther (manual brushing) levels and Worker Tokens for the Unearther.

Required mods: FTB Unearthed 21.1.x (KubeJS Infinity Extras loads this only when FTB Unearthed is installed)

Part Script folder
FTBUnearthedExtras binding server_scripts

FTB Unearthed already ships the KubeJS schema for its recipes (event.recipes.ftbunearthed.unearther(...)), so KubeJS Infinity Extras adds no recipe schema.


Player unearther level

The value of /ftbunearthed setlevel / getlevel (1-5).

Call Description
FTBUnearthedExtras.getLevel(player) Current level
FTBUnearthedExtras.setLevel(player, level) Sets the level
FTBUnearthedExtras.addLevel(player, amount) Adds levels (clamped to 1-5)

Worker Tokens

Call Description
FTBUnearthedExtras.workerToken(profession[, type[, level]]) New Worker Token: villager profession, optional villager type (null to skip), optional level 1-5 (0 or less = no fixed level)
FTBUnearthedExtras.getWorkerProfession(token) Profession id
FTBUnearthedExtras.getWorkerType(token) Villager type id
FTBUnearthedExtras.getWorkerLevel(token) Worker level
FTBUnearthedExtras.getWorkerXpProgress(token) Percentage (0-100) towards the next level
FTBUnearthedExtras.addWorkerXp(token, amount) Adds worker XP; returns true when the worker levelled up
// server_scripts
PlayerEvents.advancement('minecraft:story/mine_diamond', event => {
  if (FTBUnearthedExtras.getLevel(event.player) < 3) {          // current brushing level
    FTBUnearthedExtras.setLevel(event.player, 3)                 // sets it to 3
  }
})

ItemEvents.rightClicked('minecraft:amethyst_shard', event => {
  FTBUnearthedExtras.addLevel(event.player, 1)                   // +1, clamped to 1-5
  event.player.tell(`Unearther level: ${FTBUnearthedExtras.getLevel(event.player)}`)
})

PlayerEvents.loggedIn(event => {
  if (!event.player.stages.has('got_worker')) {
    event.player.stages.add('got_worker')
    event.player.give(FTBUnearthedExtras.workerToken('minecraft:mason'))                       // profession only
    event.player.give(FTBUnearthedExtras.workerToken('minecraft:farmer', 'minecraft:savanna')) // profession and villager type
    event.player.give(FTBUnearthedExtras.workerToken('minecraft:cleric', null, 3))             // fixed level 3, default type
  }
})

ItemEvents.rightClicked('ftbunearthed:worker_token', event => {
  let token = event.item
  if (event.player.crouching) {
    let levelledUp = FTBUnearthedExtras.addWorkerXp(token, 100)  // adds worker XP, true on level up
    event.player.tell(levelledUp ? 'The worker levelled up!' : `XP progress: ${FTBUnearthedExtras.getWorkerXpProgress(token)}%`) // 0-100 to next level
    event.cancel()
  } else {
    event.player.tell(`${FTBUnearthedExtras.getWorkerProfession(token)} (${FTBUnearthedExtras.getWorkerType(token)}), level ${FTBUnearthedExtras.getWorkerLevel(token)}`) // profession, type, level
  }
})


Hephaestus Forge integration

Recipe types for the Hephaestus Forge melter and smeltery (melting, alloying, casting table, casting basin, entity melting) and startup registries for new molten fluids, fuels, casts and complete smelteries (walls, floors, glass, tanks, drains, chutes and controllers). Tool materials, parts and modifiers are on the Hephaestus Tools page.

Required mods: Hephaestus Forge 1.0.x and Athena (KubeJS Infinity Extras loads this only when Hephaestus Forge is installed)

Part Script folder
HephaestusEvents.registry(...) and the hephaestus:* registry types startup_scripts
event.recipes.hephaestus.* server_scripts

Plain names get the kubejs namespace. Nothing shows missing textures: everything defaults to Hephaestus' own textures and models. Every name gets an en_us entry from .displayName() or the id; .lang('key') uses your own translation key (kubejs/assets/<ns>/lang/<locale>.json) instead.


Startup registries

HephaestusEvents.registry('<category>', event => { event.create(id) ... })

Category Creates Same builder as a registry type
fluids Molten fluid (fluid + flowing + block + bucket, tinted molten texture) StartupEvents.registry('fluid') type 'hephaestus:molten'
fuels Melter / smeltery fuel with a heat none
casts Casting table cast item (+ optional cast creation recipe) StartupEvents.registry('item') type 'hephaestus:cast'
walls Smeltery wall / floor / glass blocks StartupEvents.registry('block') type 'hephaestus:smeltery_wall'
tanks Smeltery tanks (4000 mB, keep their fluid, render it) type 'hephaestus:smeltery_tank'
drains Smeltery drains and chutes type 'hephaestus:smeltery_drain'
controllers Smeltery controllers (structure, melting, alloying, GUI) type 'hephaestus:smeltery_controller'

fluids

Same fluid type and properties as Hephaestus' molten metals (lava-like movement, can't swim or drown). Name them molten_<material> so Hephaestus Tools turns the fluid into the tool material hephaestus_tools:<material> when casting parts. Creates the fluid <id> and the bucket <id>_bucket.

Method Description Default
.color(n | 'RRGGBB') Tint of the molten texture and bucket E06A1A
.temperature(n) Temperature in kelvin 1000
.lightLevel(0-15) Light emitted 10
.density(n) Density 2000
.viscosity(n) Viscosity (higher = slower) 10000
.texture(still, flowing) Untinted still and flowing textures molten texture
.fuel(heat) Also registers the fluid as a fuel with this heat (see fuels) not a fuel
.displayName(text) English name title-cased id
.lang(key) Own translation key; the bucket is named " Bucket" none

Any KubeJS fluid option works too (.noBucket(), .noBlock(), ...).

fuels

Hephaestus has no fuel list: a fluid is a fuel when a melting recipe names it as fuel, and its heat is the highest temperature of those recipes. This generates that recipe (by default the fluid's bucket melts into 1000 mB of it). Existing fuels can only get hotter this way. The id is the fluid.

Method Description Default
.temperature(n) (alias .heat) Heat the fuel provides 1000
.melts(itemOrTag) Item melted by the generated recipe the fluid's bucket
.result(fluid, amount) Fluid the generated recipe gives 1000 mB of the fuel itself
.time(ticks) Melting time of the generated recipe 100

casts

Method Description Default
.madeFrom(ingredient) Generates the cast creation recipe (the pattern item is consumed) no recipe
.madeWith(fluid, amount) Fluid of the cast creation recipe 90 mB of hephaestus:molten_copper
.coolingTime(ticks) Cooling time of the cast creation recipe 60
.lang(key) Own translation key none

Default texture hephaestus:item/blank_cast; every KubeJS item option works (.texture(...), .displayName(...)).

walls

Hephaestus checks the structure with block tags (c:smeltery_wall accepts floor blocks too). Default texture: seared bricks; all KubeJS block options work.

Method Description Default
.wall() Wall block (tag c:smeltery_wall) yes
.floor() Floor block (tag c:smeltery_floor, also valid as wall)
.glass() See-through glass (default texture hephaestus:block/smeltery/seared_glass)
.lang(key) Own translation key none

Retexture walls with the normal KubeJS .texture(...).

tanks

Real Hephaestus tanks; they count as tank and wall (tags c:smeltery_tanks + c:smeltery_wall).

Method Description Default
.style(name) 'ingot', 'fuel', 'ingot_gauge' or 'fuel_gauge' (Hephaestus models) 'ingot'
.fuel() Shorthand for .style('fuel')
.texture(key, texture) Retexture; keys 'side', 'top' Hephaestus tank
.bricks(texture) / .lang(key) Brick texture / own translation key

drains

Real Hephaestus drain (fluid I/O, faucets) and chute (item input) blocks.

Method Description Default
.drain() Drain block; texture keys 'bricks', 'drain', 'back' yes
.chute() Chute block; texture keys 'top', 'side', 'bricks', 'back'
.bricks(texture) Same as .texture('bricks', texture) seared bricks
.lang(key) Own translation key none

controllers

Method Description Default
.bricks(texture) Brick texture; texture keys 'front', 'bricks', 'back' seared bricks
.lang(key) Own translation key none
// startup_scripts
HephaestusEvents.registry('fluids', event => {
  event.create('kubejs:molten_mithril')    // fluid kubejs:molten_mithril + bucket kubejs:molten_mithril_bucket
    .color(0x7FD3E6)                       // tint of the molten texture and bucket (number or 'RRGGBB')
    .temperature(1700)                     // kelvin
    .lightLevel(12)                        // 0-15
    .density(2500)                         // fluid density
    .viscosity(9000)                       // higher = slower
    .fuel(1400)                            // also a melter / smeltery fuel with 1400 heat
    .displayName('Molten Mithril')         // English name

  event.create('kubejs:molten_starmetal')
    .lang('fluid.kubejs.molten_starmetal') // own translation key; the bucket is "<translation> Bucket"
    .color('3A2A7A')

  event.create('kubejs:molten_ember')
    .texture('hephaestus:fluid/molten/blaze/still', 'hephaestus:fluid/molten/blaze/flowing') // untinted still / flowing textures
    .noBucket()                            // any KubeJS fluid option works too
})

HephaestusEvents.registry('fuels', event => {
  event.create('minecraft:water')          // id = the fluid that becomes a fuel
    .temperature(400)                      // heat it provides
    .melts('minecraft:ice')                // item / #tag melted by the generated recipe
    .result('minecraft:water', 250)        // fluid the generated recipe gives
    .time(60)                              // melting time of the generated recipe

  event.create('kubejs:molten_starmetal')
    .heat(1800)                            // alias of .temperature()
})

HephaestusEvents.registry('casts', event => {
  event.create('kubejs:wire_cast')
    .madeFrom('#c:wires')                  // generates the cast creation recipe (pattern item consumed)
    .madeWith('hephaestus:molten_gold', 90) // fluid and amount of that recipe
    .coolingTime(80)                       // cooling time of that recipe
    .displayName('Wire Cast')

  event.create('kubejs:blade_cast')
    .lang('item.kubejs.blade_cast')        // own translation key
    .texture('hephaestus:item/plate_cast') // any KubeJS item option works
})

HephaestusEvents.registry('walls', event => {
  event.create('kubejs:scorched_bricks')
    .wall()                                // wall block, tag c:smeltery_wall (the default)
    .texture('hephaestus:block/smeltery/seared/fancy_bricks')
    .displayName('Scorched Bricks')

  event.create('kubejs:scorched_floor')
    .floor()                               // floor block, tag c:smeltery_floor (also valid as wall)
    .texture('hephaestus:block/smeltery/seared/paver')
    .hardness(4)

  event.create('kubejs:scorched_glass')
    .glass()                               // see-through smeltery glass
    .lang('block.kubejs.scorched_glass')   // own translation key
})

HephaestusEvents.registry('tanks', event => {
  event.create('kubejs:scorched_ingot_tank')
    .style('ingot_gauge')                  // 'ingot', 'fuel', 'ingot_gauge', 'fuel_gauge'
    .bricks('hephaestus:block/smeltery/seared/fancy_bricks') // brick texture
    .displayName('Scorched Ingot Gauge')

  event.create('kubejs:scorched_fuel_tank')
    .fuel()                                // shorthand for .style('fuel')
    .texture('side', 'hephaestus:block/smeltery/tank/casting_tank') // retexture key 'side' or 'top'
    .lang('block.kubejs.scorched_fuel_tank') // own translation key
})

HephaestusEvents.registry('drains', event => {
  event.create('kubejs:scorched_drain')
    .drain()                               // drain block (the default)
    .bricks('hephaestus:block/smeltery/seared/fancy_bricks') // = .texture('bricks', ...)

  event.create('kubejs:scorched_chute')
    .chute()                               // chute block (item input)
    .lang('block.kubejs.scorched_chute')   // own translation key
})

HephaestusEvents.registry('controllers', event => {
  event.create('kubejs:scorched_controller')
    .bricks('hephaestus:block/smeltery/seared/fancy_bricks') // brick texture; keys 'front', 'bricks', 'back'
    .hardness(4)                           // any KubeJS block option
    .lang('block.kubejs.scorched_controller') // own translation key
})

// the same builders as types of the normal registries
StartupEvents.registry('fluid', event => {
  event.create('kubejs:molten_aether', 'hephaestus:molten').color(0xE8E0A0)            // molten fluid type
})
StartupEvents.registry('item', event => {
  event.create('kubejs:ring_cast', 'hephaestus:cast').madeFrom('minecraft:gold_nugget') // cast item type
})
StartupEvents.registry('block', event => {
  event.create('kubejs:dark_bricks', 'hephaestus:smeltery_wall').texture('hephaestus:block/smeltery/seared/tile') // wall type
  event.create('kubejs:dark_tank', 'hephaestus:smeltery_tank').style('fuel_gauge')    // tank type
  event.create('kubejs:dark_drain', 'hephaestus:smeltery_drain')                      // drain type
  event.create('kubejs:dark_controller', 'hephaestus:smeltery_controller')            // controller type
})

The new smeltery blocks need normal crafting recipes (event.shaped) in server_scripts.


Recipes

Fluids are fluid stacks: Fluid.of('id', amount). Ingots are 90 mB, nuggets 10, blocks 810.

Melting (melter + smeltery)

event.recipes.hephaestus.melting(resultFluid, ingredient[, temperature, time])

Method Description Default
.fuel(fluid) Fuel consumed; that fluid becomes a fuel with this recipe's temperature Fluid.of('minecraft:lava', 50)
.temperature(n) (alias .temp) Heat needed 800
.time(ticks) Melting time 100
.damageable(bool) Tools and armor melt into less fluid the more damaged they are false

Alloying (smeltery)

event.recipes.hephaestus.alloying(outputFluid, [inputFluids][, temperature])

Method Description Default
.temperature(n) (alias .temp) Heat needed 800

Casting table

event.recipes.hephaestus.casting_table(result, fluid[, cast, coolingTime])

Method Description Default
.cast(ingredient) Item that must be on the table no cast
.castConsumed(bool) (alias .consumeCast) The cast is used up (how casts themselves are made) false
.coolingTime(ticks) (alias .time) Cooling time 60

Casting basin

event.recipes.hephaestus.casting_basin(result, fluid[, time])

Method Description Default
.cast(ingredient) Block that must be in the basin no cast
.castConsumed(bool) (alias .consumeCast) The cast is used up false
.time(ticks) (alias .coolingTime) Cooling time 200

Entity melting

event.recipes.hephaestus.entity_melting(resultFluid, entity[, damage]) — mobs inside a working smeltery.

Method Description Default
.damage(n) Damage per hit 2
// server_scripts
ServerEvents.recipes(event => {
  event.recipes.hephaestus.melting(Fluid.of('hephaestus:molten_iron', 90), '#c:ingots/iron')
  event.recipes.hephaestus.melting(Fluid.of('hephaestus:molten_gold', 810), '#c:storage_blocks/gold', 1060, 200) // temperature and time as arguments
  event.recipes.hephaestus.melting(Fluid.of('hephaestus:molten_copper', 270), 'minecraft:copper_door')
    .fuel(Fluid.of('hephaestus:molten_blaze', 25))  // fuel consumed
    .temperature(1200)                              // heat needed (alias: .temp())
    .time(150)                                      // melting time
  event.recipes.hephaestus.melting(Fluid.of('hephaestus:molten_iron', 360), 'minecraft:iron_chestplate')
    .damageable(true)                               // damaged tools melt into less fluid

  event.recipes.hephaestus.alloying(Fluid.of('hephaestus:molten_bronze', 360),
    [Fluid.of('hephaestus:molten_copper', 270), Fluid.of('hephaestus:molten_tin', 90)], 700)
  event.recipes.hephaestus.alloying(Fluid.of('hephaestus:molten_electrum', 180),
    [Fluid.of('hephaestus:molten_gold', 90), Fluid.of('hephaestus:molten_silver', 90)])
    .temperature(1000)                              // heat needed (alias: .temp())

  event.recipes.hephaestus.casting_table('minecraft:iron_ingot', Fluid.of('hephaestus:molten_iron', 90), 'hephaestus:ingot_cast', 100)
  event.recipes.hephaestus.casting_table('2x minecraft:gold_nugget', Fluid.of('hephaestus:molten_gold', 20), 'hephaestus:nugget_cast')
    .coolingTime(33)                                // cooling time (alias: .time())
  event.recipes.hephaestus.casting_table('hephaestus:gear_cast', Fluid.of('hephaestus:molten_copper', 90))
    .cast('#c:gears')                               // item that must be on the table
    .castConsumed(true)                             // the cast is used up (alias: .consumeCast())

  event.recipes.hephaestus.casting_basin('minecraft:iron_block', Fluid.of('hephaestus:molten_iron', 810), 200)
  event.recipes.hephaestus.casting_basin('minecraft:gilded_blackstone', Fluid.of('hephaestus:molten_gold', 90))
    .cast('minecraft:blackstone')                   // block that must be in the basin
    .time(120)                                      // cooling time (alias: .coolingTime())

  event.recipes.hephaestus.entity_melting(Fluid.of('hephaestus:molten_blaze', 90), 'minecraft:blaze')
  event.recipes.hephaestus.entity_melting(Fluid.of('hephaestus:molten_iron', 36), 'minecraft:iron_golem', 4)
  event.recipes.hephaestus.entity_melting(Fluid.of('minecraft:lava', 45), 'minecraft:magma_cube')
    .damage(3)                                      // damage per hit

  event.remove('hephaestus:smeltery/alloying/brass')

  // recipes for the registered content
  event.recipes.hephaestus.melting(Fluid.of('kubejs:molten_mithril', 90), '#c:ingots/mithril', 1200)
    .fuel(Fluid.of('hephaestus:molten_blaze', 50))
  event.recipes.hephaestus.casting_table('minecraft:chain', Fluid.of('hephaestus:molten_iron', 100), 'kubejs:wire_cast')
  event.shapeless('kubejs:blade_cast', ['hephaestus:blank_cast', 'minecraft:iron_sword'])
  event.shaped('kubejs:scorched_controller', ['NNN', 'NMN', 'NNN'], { N: 'kubejs:scorched_bricks', M: 'minecraft:magma_block' })
})


Hephaestus Tools integration

Startup registries for Hephaestus Tools: tool materials (stats per part slot, traits, animation, molten fluid), harvest tiers, traits built from effects, traits per tool type and Arsenal Table / Workbench modifiers. Parts and tools are tinted with the material color, so new materials need no textures.

Required mods: Hephaestus Tools 1.0.x (+ Player Animation Library on the client). Hephaestus Forge is optional; it is needed for the part casting and melting recipes of materials. (KubeJS Infinity Extras loads this only when Hephaestus Tools is installed.)

Part Script folder
HephaestusToolsEvents.registry(...) startup_scripts
Recipes that make a part of a material server_scripts

HephaestusToolsEvents.registry('<category>', event => { event.create(id) ... })

Category Creates
materials Tool materials
tiers Harvest tiers
traits Traits made of effects
tool_traits Traits every tool of one type gets
modifiers Arsenal Table / Workbench modifiers (upgrades)

Plain names get the hephaestus_tools namespace: the mod resolves bare ids there, and it casts a part of fluid <ns>:molten_<x> as material hephaestus_tools:<x>. Creating an existing id ('iron', 'magnetic'...) replaces it. Every name gets an en_us entry from .name() or the id; .lang('key') copies your own translation key to the key the mod uses. Tools and tool part types are hard-coded in the mod (table layouts), so they cannot be added.


tiers

Method Description Default
.miningLevel(n) Mining level: wood/gold 0, stone 1, iron 2, diamond 3, netherite 4, adamantite 5, aurichalcum 6. Higher tiers win 0
.incorrectFor('#tag') Block tag of the blocks this tier cannot mine (# optional) vanilla / mod tag of the mining level
.name(text) English name (key tooltip.hephaestus_tools.tier.<id>) title-cased id
.lang(key) Own translation key none
HephaestusToolsEvents.registry('tiers', event => {
  event.create('hephaestus_tools:mithril')
    .miningLevel(4)                                          // netherite level
    .incorrectFor('#minecraft:incorrect_for_netherite_tool') // blocks this tier can't mine
    .name('Mithril')                                         // English name

  event.create('hephaestus_tools:starmetal')
    .miningLevel(5)
    .lang('tier.kubejs.starmetal')                           // own translation key
})

traits

A trait is a list of effects. Amounts take a number or one value per level ([1, 2, 3]).

Method Description Default
.maxLevel(n) Maximum level (levels from several parts add up) 1
.name(text) / .lang(key) English name (key trait.hephaestus_tools.<id>) / own key title-cased id
.description(text) / .descriptionLang(key) Shift description (key ...<id>.desc) / own key none
.statAdd(stat, amount) Flat stat bonus. Stats: durability, mining_speed, attack_damage, attack_speed
.statMultiply(stat, amount) Percent stat bonus (0.1 = +10%)
.breakSpeed(amount[, e => ...]) Extra mining speed
.bonusDamage(amount[, e => ...]) Extra damage
.repairOverTime(interval[, amount, whileBroken]) Repairs amount (default 1) durability every interval ticks; whileBroken also while broken
.pullItems(interval, radius, strength[, e => ...]) Magnet; works while held in hand unless e.noCondition()
.behead(chance) Vanilla mob heads (and player heads) with this chance (number or per level)
.behead(chance, entity, head, ...) Chance, then entity / head pairs
.indestructible() Never loses durability
.effect(type, e => ...) Any effect type with its fields; full ids work for other mods' types
.effectJson(json) / .behead(chance, map) Raw JSON variants for advanced cases

Effect options (e => e...)

Method Description
.amount(n) Amount (number or per level)
.multiply() / .add() / .operation('add' | 'multiply') Multiplier or flat amount
.scale(type) Scale: wear, durability_left, target_armor
.scale(type, below) Scale with a limit: depth (below Y level), cold (below biome temperature)
.max(n) Cap of the scaled amount (number or per level)
.condition(type) Condition without options: target_wet
.condition(type, value) 'equipped' + slot group (hand, mainhand, offhand, armor...) or 'target_in_tag' + entity type tag
.conditionField(key, value) Adds a field to the current condition (other mods' conditions)
.conditionJson(json) Full raw condition object
.noCondition() Removes the condition (pull_items has equipped: hand by default)
.set(key, value) Any other field of the effect
HephaestusToolsEvents.registry('traits', event => {
  event.create('hephaestus_tools:arcane')
    .maxLevel(3)                                        // levels from several parts add up to 3
    .name('Arcane')                                     // English name
    .description('Faster in the deep, stronger against the undead.') // shift description
    .statAdd('attack_speed', 0.2)                       // flat stat bonus
    .statMultiply('durability', [0.1, 0.2, 0.3])        // +10% / +20% / +30% per level
    .breakSpeed(0.005, e => e                           // extra mining speed with options
      .multiply()                                       // multiplier instead of flat
      .scale('depth', 0)                                // scales with depth below Y 0
      .max(0.6))                                        // cap of the scaled amount
    .bonusDamage(2.0, e => e
      .condition('target_in_tag', 'minecraft:undead'))  // only against this entity tag

  event.create('hephaestus_tools:siphoning')
    .lang('trait.kubejs.siphoning')                     // own name key
    .descriptionLang('trait.kubejs.siphoning.desc')     // own description key
    .repairOverTime(60)                                 // 1 durability every 60 ticks
    .repairOverTime(100, 2)                             // 2 durability every 100 ticks
    .repairOverTime(200, 2, true)                       // ... also while broken
    .pullItems(10, 4.0, 0.1)                            // magnet: interval, radius, strength (held in hand)
    .pullItems(20, 8.0, 0.05, e => e.noCondition())     // removes the condition: anywhere in the inventory

  event.create('hephaestus_tools:headhunter')
    .behead(0.1)                                        // vanilla mob and player heads, 10% chance
    .behead([0.2, 0.4], 'minecraft:wither_skeleton', 'minecraft:wither_skeleton_skull') // chance per level, entity / head pairs
    .behead(0.05, { 'minecraft:zombie': 'minecraft:zombie_head' }) // raw JSON map: the only form this overload accepts
    .bonusDamage(1.5)                                   // flat extra damage
    .bonusDamage(0.1, e => e.scale('target_armor').max(3)) // scale without option: target armor
    .breakSpeed(3)                                      // flat extra mining speed
    .breakSpeed(3, e => e.scale('cold', 0.75))          // scale below biome temperature 0.75

  event.create('hephaestus_tools:eternal')
    .indestructible()                                   // never loses durability
    .effect('stat_add', e => e.set('stat', 'mining_speed').amount(2)) // any effect type; .set(key, value) adds a field, .amount(n) the amount
    .effect('hephaestus_tools:break_speed', e => e
      .amount(1.0)
      .add()                                            // flat amount (the default)
      .condition('hephaestus_tools:target_wet'))        // condition without options
    .effect('break_speed', e => e
      .amount(0.2)
      .operation('multiply')                            // same as .multiply(); 'add' = .add()
      .condition('equipped', 'mainhand'))               // condition with its slot option
    .effect('bonus_damage', e => e
      .amount(1)
      .condition('othermod:near_block')
      .conditionField('radius', 3))                     // extra field on the current condition
    .effect('bonus_damage', e => e
      .amount(1)
      .conditionJson({ type: 'othermod:in_rain' }))     // raw JSON: the only form this method accepts
    .effectJson({ type: 'hephaestus_tools:stat_add', stat: 'durability', amount: 50 }) // raw JSON: the only form this method accepts

  // replace a built-in trait
  event.create('hephaestus_tools:dense')
    .statMultiply('durability', 0.6)
})

materials

Use the id hephaestus_tools:<x> so the fluid <ns>:molten_<x> casts its parts.

Method Description Default
.ingredient(itemOrTag) Item that makes parts at the Arsenal Table
.color(n | 'RRGGBB') Tint of parts and tools
.name(text) / .lang(key) English name (key material.hephaestus_tools.<id>) / own key title-cased id
.head(h => ...) / .handle(h => ...) / .binding(b => ...) Stats per part slot (every slot accepts every stat)
.stats(durability, miningSpeed, attackDamage, tier) Shorthand for the head stats
.animation(type, color[, duration, pause]) 'sweep' or 'pulse', color, duration and pause in ticks
.animationShape(width, strength) Sweep width (0.5-64) and strength (0-1)
.fluid(fluid) Generates the 12 part casting + part melting recipes (Hephaestus Forge) none
.temperature(n) Part melting temperature 900
.fuel(fluid) Fuel shown by those recipes lava (≤ 1000) / molten blaze
.noPartCasting() Only generate the melting recipes

Part stats (h => h...)

Method Description
.durability(n), .miningSpeed(n), .attackDamage(n), .attackSpeed(n) Flat stats
.tier(id | 0-7) Scripted or built-in tier id, or position
.enchantability(n) Enchantability
.durabilityMult(n), .speedMult(n), .damageMult(n), .attackSpeedMult(n) Multipliers (handle)
.trait(id[, level]) Adds a trait (level 1 by default)
.noTraits() No traits (otherwise the slot inherits the head's)
.headShare(n) Share of the head stats (handle default 0.15)
HephaestusToolsEvents.registry('materials', event => {
  event.create('hephaestus_tools:mithril')
    .ingredient('#c:ingots/mithril')                    // item / #tag that makes parts at the Arsenal Table
    .color(0x7FD3E6)                                    // tint of parts and tools
    .name('Mithril')                                    // English name
    .head(h => h                                        // head stats
      .durability(900)                                  // durability
      .miningSpeed(9.0)                                 // mining speed
      .attackDamage(3.5)                                // attack damage
      .attackSpeed(1.1)                                 // attack speed
      .tier('mithril')                                  // harvest tier (id or position 0-7)
      .enchantability(18)                               // enchantability
      .trait('arcane'))                                 // trait at level 1
    .handle(h => h                                      // handle: multipliers
      .durabilityMult(0.15)                             // durability multiplier
      .speedMult(0.05)                                  // mining speed multiplier
      .damageMult(0.05)                                 // attack damage multiplier
      .attackSpeedMult(0.1)                             // attack speed multiplier
      .trait('arcane', 2)                               // trait with a level
      .headShare(0.2))                                  // share of the head stats
    .binding(b => b
      .durability(120)
      .noTraits())                                      // no traits (otherwise inherits the head's)
    .animation('sweep', 0xFFFFFF, 30, 40)               // type, color, duration, pause (ticks)
    .animationShape(4.0, 0.8)                           // sweep width and strength
    .fluid('kubejs:molten_mithril')                     // generates part casting + melting recipes
    .temperature(1200)                                  // part melting temperature
    .fuel('hephaestus:molten_blaze')                    // fuel shown by those recipes

  event.create('hephaestus_tools:starmetal')
    .ingredient('minecraft:nether_star')
    .color('3A2A7A')
    .lang('material.kubejs.starmetal')                  // own translation key
    .stats(2000, 12.0, 5.0, 'starmetal')                // shorthand: head durability, mining speed, attack damage, tier
    .animation('pulse', 0xFF66FF)                       // type and color only
    .fluid('kubejs:molten_starmetal')
    .noPartCasting()                                    // only the melting recipes

  // replace a built-in material
  event.create('hephaestus_tools:iron')
    .ingredient('minecraft:iron_ingot')
    .color(14211288)
    .head(h => h.durability(300).miningSpeed(6.5).attackDamage(2).tier('iron').enchantability(14).trait('magnetic'))
    .handle(h => h.durabilityMult(0.1))
    .binding(b => b.durability(80))
})

tool_traits

The id is the tool item.

Method Description Default
.trait(id[, level]) Adds a trait level 1
.replace() Replaces the mod's list instead of adding to it adds
HephaestusToolsEvents.registry('tool_traits', event => {
  event.create('hephaestus_tools:sword')
    .trait('hephaestus_tools:headhunter')              // level 1
    .trait('hephaestus_tools:arcane', 2)               // with a level

  event.create('hephaestus_tools:cleaver')
    .replace()                                         // replaces the mod's list (removes beheading)
    .trait('hephaestus_tools:headhunter', 1)
})

modifiers

Upgrades applied at the Arsenal Table / Workbench. The cost doubles each level. Stat values are per level.

Method Description Default
.roles(...roles) mining, combat, harvest all
.maxLevel(n) Maximum level (10+ adds the mod's extra costs above level 5) 5
.cost(item, baseCost) Item and base cost 4 diamonds
.icon(texture) Icon texture
.durability(n) / .durabilityMultiplier(n) Durability
.miningSpeed(n) / .miningSpeedMultiplier(n) Mining speed
.attackDamage(n) / .attackDamageMultiplier(n) Attack damage
.attackSpeed(n) / .attackSpeedMultiplier(n) Attack speed
.enchantability(n) Enchantability
.fortune(n) / .looting(n) Fortune / looting levels
.harvestTier(tier) Raises the harvest tier
.indestructible() Tool never loses durability
.name(text) / .lang(key) English name / own key title-cased id
.description(text) / .descriptionLang(key) Description / own key generated from the stats
HephaestusToolsEvents.registry('modifiers', event => {
  event.create('hephaestus_tools:mithril_coating')
    .roles('mining', 'combat')                          // mining, combat, harvest
    .maxLevel(3)                                        // maximum level
    .cost('kubejs:mithril_ingot', 2)                    // item and base cost (doubles each level)
    .icon('hephaestus_tools:textures/gui/arsenal_table/recipe_icons/upgrades/reach.png') // icon texture
    .durability(150)                                    // flat durability per level
    .durabilityMultiplier(0.05)                         // durability multiplier per level
    .miningSpeed(1.5)                                   // flat mining speed per level
    .miningSpeedMultiplier(0.05)                        // mining speed multiplier per level
    .attackDamage(0.5)                                  // flat attack damage per level
    .attackDamageMultiplier(0.05)                       // attack damage multiplier per level
    .attackSpeed(0.1)                                   // flat attack speed per level
    .attackSpeedMultiplier(0.02)                        // attack speed multiplier per level
    .enchantability(2)                                  // enchantability per level
    .harvestTier('mithril')                             // raises the harvest tier
    .name('Mithril Coating')                            // English name
    .description('Mithril-plated: tougher, faster and sharper.') // English description

  event.create('hephaestus_tools:lucky')
    .roles('mining', 'harvest')
    .fortune(1)                                         // fortune levels per level
    .looting(1)                                         // looting levels per level
    .lang('modifier.kubejs.lucky')                      // own name key
    .descriptionLang('modifier.kubejs.lucky.desc')      // own description key

  event.create('hephaestus_tools:everlasting')
    .maxLevel(1)
    .cost('minecraft:nether_star', 1)
    .indestructible()                                   // tool never loses durability
})

Part recipes (server)

Tool parts are items with the component hephaestus_tools:part_material. Any recipe can make a part of a material:

ServerEvents.recipes(event => {
  event.stonecutting('hephaestus_tools:tool_handle[hephaestus_tools:part_material="hephaestus_tools:mithril"]', 'kubejs:mithril_ingot')  // a mithril tool handle from one ingot
})


Hostile Neural Networks integration

Registers new entity data models, block data models, model tiers and generalized predictions from startup scripts. Data models and tiers are written into the KubeJS data pack, so they reload with /reload, sync to clients and show in JEI (simulation chamber and loot fabricator) like HNN's own. A HostileNetworksItems helper builds HNN's per-model items for recipes.

Required mods: Hostile Neural Networks 1.21.1-6.6.x and Placebo (KubeJS Infinity Extras loads this only when Hostile Neural Networks is installed)

Part Script folder
HostileNetworksEvents.registry(...) startup_scripts
StartupEvents.registry('item') with type hostilenetworks:prediction startup_scripts
Recipes using HostileNetworksItems server_scripts

HNN has no custom recipe types: its crafting recipes are vanilla shaped / shapeless.

Translations. Every name set with .name() / .displayName() / .trivia() becomes a generated en_us entry. Use .lang('your.key') (or .triviaLang('your.key')) for your own key in kubejs/assets/<namespace>/lang/<locale>.json. Your lang files always win. Generated keys:

  • Model names: <ns>.hostilenetworks.model.<path>
  • Trivia: <ns>.hostilenetworks.trivia.<path>
  • Tier names: hostilenetworks.tier.<name> (fixed by HNN)
  • Predictions: item.<ns>.<path>

Colours accept 0xRRGGBB, '#RRGGBB', 'RRGGBB' or a chat colour name ('dark_aqua').


Registry: predictions

HostileNetworksEvents.registry('predictions', event => event.create(id)) — generalized predictions: plain items like hostilenetworks:overworld_prediction. They are what a data model's .baseDrop() produces on every simulation. Plain names get the kubejs namespace. Also available as item type hostilenetworks:prediction.

Method Description Default
.color(color) Tint of HNN's grey prediction texture HNN's default tint
.displayName(name) English name id in title case
.lang(key) Own translation key —
.texture(texture) Own texture (no tint unless .color() is used) HNN's prediction texture

Any normal KubeJS item builder method also works (for example .rarity('uncommon')).

// startup_scripts
HostileNetworksEvents.registry('predictions', event => {
  event.create('kubejs:sculk_prediction')
    .color(0x0F4C5C)                                // tint of HNN's prediction texture
    .displayName('Generalized Sculk Prediction')    // English name

  event.create('kubejs:ocean_prediction')
    .color(0x2E8BC0)
    .lang('item.kubejs.ocean_prediction.custom')    // own translation key
    .rarity('uncommon')                             // any normal KubeJS item method

  event.create('kubejs:void_prediction')
    .texture('kubejs:item/void_prediction')         // own texture, no tint
})

StartupEvents.registry('item', event => {
  event.create('kubejs:ancient_prediction', 'hostilenetworks:prediction') // same builder as item type
    .color(0xC9A15A)
    .displayName('Generalized Ancient Prediction')
})

Shared data model methods

Both data_models and block_data_models builders have these methods:

Method Description Default
.name(text) Display name (en_us entry generated) entity / block name
.lang(key) / .nameKey(key) Own translation key for the name —
.color(color) / .nameColor(color) Name colour white
.simCost(fe) FE/t in the simulation chamber 256
.input(itemOrTag) Item used per simulation hostilenetworks:prediction_matrix
.baseDrop(item[, count]) Always produced per simulation hostilenetworks:overworld_prediction
.trivia(text) Deep Learner trivia (en_us entry generated) —
.triviaLang(key) / .triviaKey(key) Own translation key for the trivia —
.fabDrop(item[, count]) Loot fabricator output ('8x item' shorthand works) —
.fabDrops(...items) Several fabricator outputs at once —
.optionalFabDrop(item[, count]) Fabricator output skipped if its mod is missing —
.requiredData(tier, amount) Per-tier override of the data needed (keep tier order) tier defaults
.dataGained(tier, amount) Per-tier override of data per kill tier defaults
.displayScale(scale) Render scale in GUIs (0-5) 1 (blocks 3)
.displayOffset(x, y, z) Render offset (each -5..5) 0, 0, 0
.displayNbt(snbt) NBT of the rendered entity —
.attunement(predicate) Raw attunement predicate (entity predicate for entity models, block predicate for block models) —
.attunementField(key, value) Sets one top-level field of the attunement predicate —
.attunementFlag(flag, bool) Entity predicate flag: is_on_fire, is_sneaking, is_sprinting, is_swimming, is_on_ground, is_flying, is_baby —
.attunable(bool) Whether the model is attunable true once an attunement is set

Two models for the same entity need attunements on both.

event.remove(id) disables one of HNN's models (plain names use the hostilenetworks namespace).

Registry: data_models (entities)

HostileNetworksEvents.registry('data_models', event => event.create(id)) — written to data/<ns>/data_models/<path>.json. Using one of HNN's ids replaces that model.

Method Description Default
.entity(type) Required. Entity type that trains the model —
.variant(type) One more entity type for the same model —
.variants(...types) Several more entity types —
// startup_scripts
HostileNetworksEvents.registry('data_models', event => {
  event.create('kubejs:warden')
    .entity('minecraft:warden')                                  // entity that trains the model (required)
    .variants('minecraft:elder_guardian')                        // more entity types
    .name('Deep Dark Horror')                                    // display name
    .color('#0F4C5C')                                            // name colour (alias: .nameColor())
    .simCost(1024)                                               // FE/t in the simulation chamber
    .input('hostilenetworks:prediction_matrix')                  // item used per simulation
    .baseDrop('kubejs:sculk_prediction')                         // always produced
    .trivia('It can smell you. It can hear you. It is coming.')  // Deep Learner trivia
    .fabDrop('minecraft:echo_shard', 4)                          // fabricator output with a count
    .fabDrop('8x minecraft:sculk')                               // 'Nx item' shorthand
    .optionalFabDrop('deeperdarker:soul_crystal', 2)             // skipped if the mod is missing
    .requiredData('basic', 10)                                   // data needed for the basic tier
    .requiredData('advanced', 60)                                // data needed for the advanced tier
    .dataGained('basic', 2)                                      // data per kill at basic
    .displayScale(0.6)                                           // GUI render scale
    .displayOffset(0, -0.2, 0)                                   // GUI render offset

  event.create('kubejs:guardian')
    .entity('minecraft:guardian')
    .lang('kubejs.model.guardian')                               // own name key (alias: .nameKey())
    .triviaLang('kubejs.trivia.guardian')                        // own trivia key (alias: .triviaKey())
    .nameColor('aqua')                                           // same as .color()
    .baseDrop('kubejs:ocean_prediction', 2)                      // base drop with a count
    .fabDrops('minecraft:prismarine_shard', 'minecraft:prismarine_crystals', 'minecraft:cod') // several fabricator outputs

  event.create('kubejs:baby_zombie')
    .entity('minecraft:zombie')
    .color('dark_green')
    .fabDrops('minecraft:rotten_flesh', 'minecraft:carrot', 'minecraft:potato')
    .triviaLang('hostilenetworks.trivia.zombie')                 // reuse an existing key
    .displayNbt('{IsBaby:1b}')                                   // NBT of the rendered entity
    .attunementFlag('is_baby', true)                             // entity predicate flag
    .attunable(true)                                             // attunable (default once an attunement is set)

  // replace HNN's zombie model (needs an attunement too, since both share the entity)
  event.create('hostilenetworks:zombie')
    .entity('minecraft:zombie')
    .variant('minecraft:husk')                                   // one more entity type per call
    .variants('minecraft:drowned', 'minecraft:zombie_villager')
    .color('#3B6B2E')
    .simCost(64)
    .fabDrop('16x minecraft:rotten_flesh')
    .attunementFlag('is_baby', false)

  event.create('kubejs:skeletons')
    .entity('minecraft:skeleton')
    .attunementField('type', '#minecraft:skeletons')             // one top-level field of the predicate

  event.create('kubejs:burning_blaze')
    .entity('minecraft:blaze')
    .attunement({ flags: { is_on_fire: true } })                 // whole predicate: raw JSON is the only form this method accepts

  event.remove('hostilenetworks:bat')                            // disables an HNN model
})

Registry: block_data_models

HostileNetworksEvents.registry('block_data_models', event => event.create(id)) — models trained by mining. They follow HNN's "block data models" config option unless .ignoreConfig() is used.

Method Description Default
.block(block[, displayItem]) Required. Block that trains the model; optional item to render instead —
.variant(block[, displayItem]) One more block —
.variants(...blocks) Several more blocks —
.requiresNoSilkTouch() Only mining without Silk Touch counts —
.upgradeCondition(type) Loot item condition type that must pass (for example minecraft:random_chance) —
.upgradeConditionField(key, value) One field of that condition —
.attunementBlocks(...blocks) Block predicate for attunement —
.ignoreConfig() Load even if block data models are disabled in HNN's config —
// startup_scripts
HostileNetworksEvents.registry('block_data_models', event => {
  event.create('kubejs:ancient_debris')
    .block('minecraft:ancient_debris')                                  // block that trains the model (required)
    .variant('minecraft:netherite_block', 'minecraft:netherite_ingot')  // more blocks, with a display item
    .variant('minecraft:respawn_anchor')                                // more blocks, no display item
    .variants('minecraft:crying_obsidian')                              // several more blocks
    .name('Ancient Debris')
    .color('#5C3A2E')
    .simCost(2560)
    .baseDrop('kubejs:ancient_prediction')
    .fabDrop('minecraft:netherite_scrap', 2)
    .requiresNoSilkTouch()                                              // only mining without Silk Touch counts
    .upgradeCondition('minecraft:random_chance')                        // loot condition that must pass
    .upgradeConditionField('chance', 0.5)                               // field of that condition
    .displayScale(3)                                                    // block models default to 3
    .ignoreConfig()                                                     // load even if disabled in HNN's config

  event.create('kubejs:mossy_stone')
    .block('minecraft:mossy_cobblestone', 'minecraft:moss_block')       // render another item
    .attunementBlocks('minecraft:mossy_cobblestone')                    // block predicate for attunement
    .trivia('Moss grows on the stones nobody looks at.')

  event.remove('hostilenetworks:blocks/coal_ore')                       // disables an HNN block model
})

Registry: model_tiers

HostileNetworksEvents.registry('model_tiers', event => event.create(name)) — written to data/hostilenetworks/model_tiers/<name>.json. Tier names always live in the hostilenetworks namespace. HNN orders tiers by required data: the tier with 0 is the first, the highest is the max tier. Built-in: faulty 0, basic 6, advanced 54, superior 354, self_aware 1254. Using a built-in name replaces it; event.remove(name) disables a tier.

Method Description Default
.requiredData(n) Data needed to reach the tier (its place in the order) 0
.dataGained(n) Data per kill at this tier 1
.color(color) Tier colour 'white'
.accuracy(f) Predictions per simulation (0-64) 0.5
.canSim(bool) Whether models of this tier can be simulated true
.displayName(name) English name name in title case
.lang(key) Own key; its en_us text is copied to hostilenetworks.tier.<name> —

The built-in max tier self_aware gains 0 data per kill, so tiers above it are only reachable if you give it data gain.

// startup_scripts
HostileNetworksEvents.registry('model_tiers', event => {
  event.create('transcendent')
    .requiredData(5000)            // data needed (its place in the order)
    .dataGained(0)                 // data per kill at this tier
    .color('aqua')                 // tier colour
    .accuracy(2.0)                 // predictions per simulation
    .canSim(true)                  // can be simulated
    .displayName('Transcendent')   // English name

  event.create('ascended')
    .requiredData(2500)
    .dataGained(1)
    .color(0xFF55FF)
    .accuracy(1.5)
    .lang('kubejs.tier.ascended')  // own key, copied to hostilenetworks.tier.ascended

  event.create('self_aware')       // replaces the built-in max tier
    .requiredData(1254)
    .dataGained(2)
    .color('gold')
    .accuracy(1)

  event.remove('superior')         // disables a tier
})

Recipes and HostileNetworksItems

HNN's per-model items (model predictions and data models) are one item each with the model stored in a data component. Build them with the HostileNetworksItems binding (plain model names use the hostilenetworks namespace):

Call Returns
HostileNetworksItems.prediction(model[, count]) Prediction of that model
HostileNetworksItems.dataModel(model[, data]) Data model item, optionally with stored data
// server_scripts
ServerEvents.recipes(event => {
  event.shapeless('4x hostilenetworks:prediction_matrix', ['minecraft:glass', 'minecraft:redstone', 'minecraft:lapis_lazuli']) // vanilla recipe

  event.shaped('minecraft:sculk_catalyst', ['PPP', 'PBP', 'PPP'], {
    P: 'kubejs:sculk_prediction',  // generalized predictions are plain items
    B: 'minecraft:bone_block'
  })

  event.shapeless(HostileNetworksItems.dataModel('kubejs:warden', 6), ['hostilenetworks:blank_data_model', 'minecraft:echo_shard'])  // data model with 6 data
  event.shapeless(HostileNetworksItems.dataModel('blaze'), ['hostilenetworks:blank_data_model', 'minecraft:blaze_rod'])              // empty blaze data model
  event.shapeless(HostileNetworksItems.prediction('zombie', 4), ['hostilenetworks:overworld_prediction', 'minecraft:rotten_flesh'])  // 4 zombie predictions
  event.shapeless('minecraft:ender_pearl', [HostileNetworksItems.prediction('enderman')])                                           // 1 enderman prediction
})


Irregular Implements integration

Adds the Imbuing Station recipe type to KubeJS. Imbuing is the only data-driven recipe type of the mod: its other serializers are special crafting recipes with no data fields, and its normal crafting recipes are vanilla ones (event.shaped / event.shapeless).

Required mods: Irregular Implements (KubeJS Infinity Extras loads this only when Irregular Implements is installed)

Part Script folder
event.recipes.irregular_implements.imbuing server_scripts

Value formats

Value Format
Item input 'minecraft:vine', '#c:slime_balls', 'minecraft:potion[potion_contents={potion:"minecraft:water"}]'
Item output 'irregular_implements:imbue_fire', '2x minecraft:diamond'

Imbuing

event.recipes.irregular_implements.imbuing(output, centerIngredient, [outerIngredients])

Argument Description
output Result item
centerIngredient Item in the middle slot (the mod uses a water bottle; any ingredient works)
outerIngredients 1 to 3 items around it, matched in any order

There are no chained options.

ServerEvents.recipes(event => {
    event.recipes.irregular_implements.imbuing('irregular_implements:imbue_experience',
        'minecraft:potion[potion_contents={potion:"minecraft:water"}]',
        ['minecraft:experience_bottle', '#c:gems/lapis', '#c:dusts/glowstone']) // output, center item, 1-3 outer items

    event.recipes.irregular_implements.imbuing('2x minecraft:glow_berries', 'minecraft:sweet_berries', ['#c:dusts/glowstone']) // any center item, one outer item
    event.recipes.irregular_implements.imbuing('minecraft:enchanted_golden_apple', 'minecraft:golden_apple',
        ['#c:storage_blocks/gold', 'minecraft:nether_star'])
})


JEI integration

KubeJS Infinity Extras sends every JEI plugin step to scripts as a JEIEvents event. You can remove categories and recipes before JEI loads them, build your own categories (slots, drawables, text, tooltips, custom layouts), add recipes, catalysts, transfer handlers and click areas, and control JEI at runtime. The JEIHelpers binding builds drawables (textures, items, fluids, entities, timers, animations).

Required mods: Just Enough Items (always required by KubeJS Infinity Extras).

Part Script folder
Every JEIEvents event and the JEIHelpers binding kubejs/client_scripts/

JEI only exists on the client, so JEIEvents and JEIHelpers do not exist in server or startup scripts.

When the events run

Every JEIEvents listener runs each time JEI loads: when you join a world, after /reload, and with /kube_jei reload. Order of one load:

denyCategories, denyRecipes, configure, registerItemSubtypes, registerFluidSubtypes, registerIngredients, registerExtraIngredients, registerIngredientAliases, registerModInfo, registerAdvancedSearch, registerCategories, registerVanillaCategoryExtensions, registerCatalysts, registerAdvanced, registerRecipes, registerTransferHandlers, registerGuiHandlers, registerRuntime, runtimeAvailable (and runtimeUnavailable when JEI stops).

KubeJS' own RecipeViewerEvents (addEntries, removeEntries, addInformation, groupEntries, registerSubtypes, removeCategories, removeRecipes) still work. Use them for item entries and information pages. The deny events below are the early version of removeCategories / removeRecipes.

Commands

Client side, no permission needed.

Command What it does
/kube_jei reload Reloads client scripts, then restarts JEI (every JEIEvents listener runs again).
/kube_jei reload all Also runs the server /reload (server scripts, recipes, tags) when you are allowed to. JEI restarts by itself once the new recipes arrive.
/kube_jei categories Lists every JEI category id. Click an id to copy it.

After editing a client script use /kube_jei reload; plain /kubejs reload client_scripts does not restart JEI.

Value formats

Value Format
Category id 'minecraft:smelting', 'create:crushing', 'kubejs:grinding'. An id without namespace ('grinding') means the script category kubejs:grinding if it exists, else minecraft:grinding.
Item 'minecraft:furnace', Item.of('minecraft:diamond', 2)
Ingredient 'minecraft:cobblestone', '#c:ingots/iron'
Fluid Fluid.of('minecraft:water', 1000)
Text Text.of('Hello').gold(), Text.translate('my.key')
Color 0xRRGGBB for text, 0xAARRGGBB for fill

Members of every event

Member Description
e.jeiHelpers JEI's IJeiHelpers.
e.guiHelper JEI's IGuiHelper.
e.ingredientManager JEI's IIngredientManager (null before registerCategories).
e.recipeType(id) JEI RecipeType of a category id.
e.earlyDeny / e.isEarlyDeny() true when the deny events remove content before loading (see below).
e.registration Registration events only: the exact object JEI gives an IModPlugin, for anything the shortcuts don't cover.
JEIEvents.registerRecipes(e => {
  console.info(e.recipeType('minecraft:smelting'))   // RecipeType of a category
  console.info(e.earlyDeny)                           // early deny active?
  console.info(e.jeiHelpers.getFocusFactory())        // raw JEI helpers
  console.info(e.guiHelper.getSlotDrawable())         // raw gui helper
  console.info(e.ingredientManager.getAllItemStacks().size()) // raw ingredient manager
  console.info(e.registration.getVanillaRecipeFactory())      // raw IRecipeRegistration
})

JEIEvents.denyCategories

Removes whole categories before JEI processes them. JEI never knows a denied category: no recipes, catalysts, transfer handlers or click areas are registered for it.

Method Description
e.deny(...ids) Denies categories by id.
e.denyNamespace(...namespaces) Denies every category whose id has this namespace.
e.denyIf(id => boolean) Denies every category for which the callback returns true.
JEIEvents.denyCategories(e => {
  e.deny('minecraft:smoking', 'minecraft:blasting')                  // by id
  e.denyNamespace('create')                                         // every category of a mod
  e.denyIf(id => id.endsWith('_fuel') && id != 'minecraft:fuel')   // by callback
})

JEIEvents.denyRecipes

Filters recipes out before JEI builds their layouts.

Method Description
e.deny(category) Denies every recipe of a category (the category stays registered; JEI hides it while empty).
e.deny(category, (id, recipe) => boolean) Denies the recipes of one category matching the callback. id is '' when the recipe has none.
e.denyId(...ids) Denies recipe ids in every category.
e.denyNamespace(...namespaces) Denies every recipe whose id has this namespace.
e.denyIf((category, id, recipe) => boolean) Denies recipes in any category matching the callback.
JEIEvents.denyRecipes(e => {
  e.deny('minecraft:campfire_cooking')                                                  // whole category
  e.deny('minecraft:smelting', (id, recipe) => id.includes('from_smelting_deepslate')) // filtered
  e.denyId('minecraft:iron_ingot_from_nuggets', 'minecraft:gold_ingot_from_nuggets')    // by recipe id
  e.denyNamespace('somemod')                                                            // by id namespace
  e.denyIf((category, id, recipe) => category == 'minecraft:stonecutting' && id.includes('cut_copper'))
})

How it works: KubeJS Infinity Extras wraps every JEI plugin. Denied categories are dropped from addRecipeCategories, and denied recipes from addRecipes. Catalysts, transfer handlers, click areas, decorators and recipe manager plugins of denied categories are skipped too. This is cheaper than hiding after loading. If a future JEI version breaks the wrapping, the same rules fall back to hiding once JEI has loaded (logged in latest.log). JEIHelpers.isEarlyDeny() tells which mode is active.


Registration events with raw access

These events expose JEI's registration object as e.registration; only some have shortcuts.

Event e.registration Shortcuts
configure IJeiFeatures e.disableInventoryEffectRendererGuiHandler()
registerItemSubtypes ISubtypeRegistration none (prefer RecipeViewerEvents.registerSubtypes('item', ...))
registerFluidSubtypes ISubtypeRegistration e.fluidHelper (JEI's IPlatformFluidHelper)
registerIngredients IModIngredientRegistration none
registerExtraIngredients IExtraIngredientRegistration e.addItems(...), e.addFluids(...)
registerIngredientAliases IIngredientAliasRegistration none
registerModInfo IModInfoRegistration none
registerAdvancedSearch IAdvancedSearchRegistration none
registerVanillaCategoryExtensions IVanillaCategoryExtensionRegistration none
registerAdvanced IAdvancedRegistration none
registerRuntime IRuntimeRegistration none
JEIEvents.configure(e => {
  e.disableInventoryEffectRendererGuiHandler()   // turn off JEI's potion-effect GUI handler
})

JEIEvents.registerFluidSubtypes(e => {
  console.info(e.fluidHelper)                    // JEI's IPlatformFluidHelper
})

JEIEvents.registerExtraIngredients(e => {
  e.addItems(Item.of('minecraft:diamond_sword[damage=500]'))   // extra item stacks in the list
  e.addFluids(Fluid.of('minecraft:lava', 1000))                 // extra fluid stacks in the list
})

JEIEvents.registerVanillaCategoryExtensions(e => {
  console.info(e.registration.getCraftingCategory())            // raw access, no shortcut
})

JEIEvents.registerCategories

e.create(id) starts a script category and returns a builder. e.add(category) adds a raw IRecipeCategory object.

Category builder

Method Description Default
.title(text) Fixed title. key jei.category.<ns>.<path>, falling back to the title case of the id
.lang(key) Title from your own lang key. see above
.icon(item) Item icon. first catalyst
.iconDrawable(drawable) Any drawable as icon. first catalyst
.background(drawable) Background drawable (also sets the size). none
.size(width, height) Category size. background size, else bounds of slots and drawables
.noSlotBackgrounds() Slots are drawn without JEI's slot texture. slot backgrounds on
.noBorder() No recipe border. border on
.shapeless() JEI's shapeless icon on every recipe. off
.inputSlot(x, y) Item input slot, filled by recipe inputs in order. -
.outputSlot(x, y) Item output slot, filled by recipe outputs in order. -
.fluidInputSlot(x, y, w, h, capacity) Fluid input tank; capacity in mB. -
.fluidOutputSlot(x, y, w, h, capacity) Fluid output tank; capacity in mB. -
.drawable(drawable, x, y) Draws a drawable. -
.arrow(x, y) JEI's static arrow. -
.animatedArrow(x, y, ticks) JEI's arrow, fills every ticks. -
.animatedFlame(x, y, ticks) JEI's flame, burns down every ticks. -
.plus(x, y) JEI's plus sign. -
.text(text, x, y[, color[, shadow]]) Static text. color 0x404040, no shadow
.tooltipArea(x, y, w, h, ...lines) Tooltip lines when hovering that area. -
.draw(ctx => ...) Draw callback, every frame, per recipe. -
.tooltip(ctx => ...) Tooltip callback while the mouse is over the recipe (outside slots). -
.layout(ctx => ...) Full control of the recipe layout. -
.recipeType(...types) Also shows every recipe of these real recipe types. -
.recipeMapper((recipe, out) => ...) Builds the shown recipe from a real recipe (recipe is the RecipeHolder). ingredients to inputs, result to first output
.recipe(r => ...) Adds a recipe right here (see Recipe builder). -
.catalyst(...items) Catalyst items. -
JEIEvents.registerCategories(e => {
  // a fully scripted category
  e.create('kubejs:grinding')
    .icon('minecraft:grindstone')                       // item icon
    .size(120, 44)                                      // width, height
    .inputSlot(10, 14)                                  // first input
    .inputSlot(28, 14)                                  // second input
    .outputSlot(94, 14)                                 // first output
    .animatedArrow(56, 14, 100)                         // arrow filling every 100 ticks
    .text(Text.of('Grind!'), 4, 34, 0x606060)           // static text with color
    .tooltipArea(56, 14, 24, 17, Text.of('Takes 5 seconds'))  // hover tooltip
    .catalyst('minecraft:grindstone')                   // catalyst item
    .draw(ctx => {                                      // per-frame drawing
      if (ctx.isHovered(56, 14, 24, 17)) ctx.fill(56, 14, 24, 17, 0x30FFFFFF)
    })
    .tooltip(ctx => {                                   // tooltip callback
      if (ctx.isHovered(0, 30, 50, 14)) ctx.add(Text.of('Hand-cranked').gray())
    })
    .recipe(r => r.id('kubejs:grinding/gravel').input('minecraft:cobblestone').output('minecraft:gravel').data('time', 100))

  // fluids, textures and an entity
  e.create('kubejs:melting')
    .lang('jei.kubejs.melting')                         // title from a lang key
    .iconDrawable(JEIHelpers.fluid(Fluid.of('minecraft:lava', 1000)))  // drawable icon
    .size(140, 60)
    .inputSlot(6, 22)
    .fluidInputSlot(30, 40, 16, 16, 1000)               // fluid input tank
    .fluidOutputSlot(110, 4, 16, 52, 4000)              // fluid output tank
    .drawable(JEIHelpers.entity('minecraft:blaze', 18).spin(45), 60, 6)   // any drawable
    .animatedFlame(7, 42, 200)                          // burning flame
    .catalyst('minecraft:cauldron')
    .noBorder()                                         // no recipe border

  // a shapeless crafting-like view
  e.create('kubejs:mixing')
    .title(Text.of('Mixing'))                           // fixed title
    .icon('minecraft:bowl')
    .shapeless()                                        // shapeless icon
    .inputSlot(1, 1)
    .plus(20, 1)                                        // plus sign
    .inputSlot(38, 1)
    .arrow(58, 1)                                       // static arrow
    .outputSlot(90, 1)
    .text(Text.of('Stir'), 2, 22, 0xFFFFFF, true)       // text with shadow

  // fed by a real recipe type
  e.create('kubejs:stonecutter_view')
    .title(Text.of('Stonecutter (compact)'))
    .icon('minecraft:stonecutter')
    .background(JEIHelpers.compound()                   // background drawable
      .add(JEIHelpers.slot(), 0, 0)
      .add(JEIHelpers.arrow(), 24, 0)
      .add(JEIHelpers.outputSlot(), 54, -4)
      .size(84, 22))
    .noSlotBackgrounds()                                // the background already draws slots
    .inputSlot(1, 1)
    .outputSlot(59, 1)
    .recipeType('minecraft:stonecutting')               // show every stonecutting recipe
    .recipeMapper((recipe, out) => {                    // build the shown recipe yourself
      out.input(recipe.value().getIngredients().get(0))
      out.output(recipe.value().getResultItem(Client.level.registryAccess()))
    })

  // full control of the layout
  e.create('kubejs:ritual')
    .icon('minecraft:enchanting_table')
    .size(100, 60)
    .layout(ctx => {
      let inputs = ctx.recipe.inputs
      for (let i = 0; i < inputs.size(); i++) ctx.input(4 + i * 18, 4, inputs.get(i))
      ctx.output(80, 22, ctx.recipe.outputs.get(0))
      ctx.catalyst(40, 40, 'minecraft:enchanting_table')
    })
})
JEIEvents.registerCategories(e => {
  e.add(myRawCategory)                                  // a raw IRecipeCategory object (advanced)
})

Draw context (.draw(ctx => ...))

Member Description
ctx.recipe The shown recipe (ctx.recipe.get('key') reads its data).
ctx.graphics, ctx.font Minecraft GuiGraphics and font.
ctx.mouseX, ctx.mouseY Mouse position inside the recipe.
ctx.width, ctx.height Category size.
ctx.slots JEI's IRecipeSlotsView.
ctx.isHovered(x, y, w, h) true when the mouse is in that area.
ctx.drawable(drawable, x, y) Draws a drawable.
ctx.text(text, x, y[, color[, shadow]]) Left-aligned text.
ctx.centeredText(text, centerX, y, color) Centered text.
ctx.rightText(text, rightX, y, color) Right-aligned text.
ctx.item(item, x, y) Draws an item.
ctx.fill(x, y, w, h, argb) Fills a rectangle.
e.create('kubejs:drawn')
  .size(120, 40)
  .draw(ctx => {
    let time = ctx.recipe.get('time')                                       // recipe data
    if (time) ctx.rightText(Text.of(`${time / 20}s`), 118, 30, 0x404040)    // right-aligned text
    ctx.text(Text.of('Hi'), 2, 2)                                           // left text
    ctx.centeredText(Text.of('Center'), ctx.width / 2, 14, 0x404040)        // centered text
    ctx.item('minecraft:clock', 100, 2)                                     // an item
    ctx.drawable(JEIHelpers.flame(), 2, 20)                                 // a drawable
    if (ctx.isHovered(0, 0, 20, 20)) ctx.fill(0, 0, 20, 20, 0x30FFFFFF)     // highlight
  })

Tooltip context (.tooltip(ctx => ...))

Member Description
ctx.recipe, ctx.slots, ctx.mouseX, ctx.mouseY Same as the draw context.
ctx.tooltip JEI's ITooltipBuilder.
ctx.isHovered(x, y, w, h) true when the mouse is in that area.
ctx.add(text) Adds a tooltip line.
e.create('kubejs:tipped')
  .tooltip(ctx => {
    if (ctx.isHovered(0, 0, 50, 14)) ctx.add(Text.of('Needs power').red())   // tooltip line
  })

Layout context (.layout(ctx => ...))

Member Description
ctx.builder JEI's IRecipeLayoutBuilder.
ctx.recipe, ctx.focuses The recipe and JEI's focus group.
ctx.input(x, y, ingredient) Adds an input slot; returns JEI's slot builder.
ctx.output(x, y, item) Adds an output slot.
ctx.fluid(input, x, y, w, h, capacity, fluid) Adds a fluid tank (input = true for input).
ctx.catalyst(x, y, ingredient) Adds a catalyst slot (shown, not used for lookups).
ctx.shapeless() Marks this recipe as shapeless.
e.create('kubejs:laid_out')
  .size(100, 60)
  .layout(ctx => {
    ctx.input(4, 4, 'minecraft:diamond')                                     // input slot
    ctx.output(80, 4, 'minecraft:nether_star')                               // output slot
    ctx.fluid(true, 4, 24, 16, 32, 1000, Fluid.of('minecraft:water', 500))  // input tank
    ctx.catalyst(40, 40, 'minecraft:enchanting_table')                       // catalyst slot
    ctx.shapeless()                                                          // shapeless icon
  })

JEIEvents.registerRecipes

e.add(category) starts a recipe for a script category. e.addRaw(category, list) adds raw objects of the class a category expects (advanced).

Recipe builder

The same builder is used by .recipe(r => ...) and .recipeMapper((recipe, out) => ...).

Method Description
.id(id) Recipe id (shown with JEI's advanced tooltips).
.input(ingredient) Adds one item input.
.inputs(...ingredients) Adds several item inputs.
.output(item) Adds one item output.
.outputs(...items) Adds several item outputs.
.fluidInput(fluid) Adds a fluid input.
.fluidOutput(fluid) Adds a fluid output.
.tooltip(text) Tooltip line for the whole recipe.
.data(key, value) Stores a value, read back with ctx.recipe.get(key).
JEIEvents.registerRecipes(e => {
  e.add('kubejs:grinding').input('minecraft:gravel').output('minecraft:sand').data('time', 60)   // data for draw()
  e.add('kubejs:grinding').input('#c:ores/iron').input('minecraft:flint').output(Item.of('minecraft:raw_iron', 2))
    .tooltip(Text.of('Ore doubling').green())                                                   // recipe tooltip
  e.add('kubejs:melting').id('kubejs:melting/stone').input('#c:cobblestones')
    .fluidOutput(Fluid.of('minecraft:lava', 250))                                               // fluid output
  e.add('kubejs:melting').input('minecraft:ice').fluidInput(Fluid.of('minecraft:water', 100))   // fluid input
    .fluidOutput(Fluid.of('minecraft:water', 1000))
  e.add('kubejs:ritual').inputs('minecraft:diamond', 'minecraft:emerald', 'minecraft:gold_ingot') // several inputs
    .outputs('minecraft:nether_star', 'minecraft:experience_bottle')                            // several outputs
  e.addRaw('some:category', [rawRecipeA, rawRecipeB])                                           // raw objects (advanced)
})

JEIEvents.registerCatalysts

Method Description
e.add(item, ...categories) Item catalyst for one or more categories.
e.addFluid(fluid, ...categories) Fluid catalyst for one or more categories.
JEIEvents.registerCatalysts(e => {
  e.add('minecraft:furnace', 'kubejs:melting')                       // item catalyst
  e.add('minecraft:blast_furnace', 'grinding')                       // 'grinding' = kubejs:grinding
  e.addFluid(Fluid.of('minecraft:lava', 1000), 'kubejs:melting')     // fluid catalyst
})

JEIEvents.registerTransferHandlers

e.add(menuClass, menuType, category, recipeSlotStart, recipeSlotCount, inventorySlotStart, inventorySlotCount) lets the [+] button move items into a menu. menuType is '' if the menu has none.

JEIEvents.registerTransferHandlers(e => {
  e.add('net.minecraft.world.inventory.FurnaceMenu', 'minecraft:furnace', 'kubejs:melting', 0, 1, 3, 36)
})

JEIEvents.registerGuiHandlers

e.clickArea(screenClass, x, y, width, height, ...categories): clicking that area of the screen opens the categories.

JEIEvents.registerGuiHandlers(e => {
  e.clickArea('net.minecraft.client.gui.screens.inventory.FurnaceScreen', 78, 32, 28, 23, 'kubejs:melting', 'minecraft:smelting')
})

JEIEvents.runtimeAvailable / runtimeUnavailable

runtimeAvailable runs once JEI has loaded. Changes here happen after loading; prefer the deny events to remove content. runtimeUnavailable runs when JEI stops (leaving the world or restarting).

Member Description
e.runtime JEI's IJeiRuntime.
e.recipeManager, e.ingredientManager, e.jeiHelpers JEI managers.
e.categoryIds Every loaded category id.
e.hideCategory(id) Hides a category.
e.showCategory(id) Shows a hidden category again.
e.showRecipes(item, output) Opens the recipes screen for an item (true = recipes making it, false = recipes using it).
e.showCategories(...ids) Opens the recipes screen on these categories.
e.setFilterText(text) Sets JEI's search text.
JEIEvents.runtimeAvailable(e => {
  console.info(`JEI loaded with ${e.categoryIds.length} categories (early deny: ${e.earlyDeny})`)
  e.hideCategory('minecraft:brewing')            // hide a category
  e.showCategory('minecraft:brewing')            // show it again
  e.showRecipes('minecraft:gravel', true)        // open recipes making gravel
  e.showCategories('kubejs:grinding')            // open a category
  e.setFilterText('@kubejs')                     // set the search field
  console.info(e.recipeManager)                  // raw IRecipeManager
})

JEIEvents.runtimeUnavailable(e => {
  console.info('JEI stopped')
})

JEIHelpers binding

Available in any client script, at any time.

Method Returns Description
JEIHelpers.texture(path, u, v, w, h) texture Region of a texture. .textureSize(w, h) sets the texture size (default 256x256).
JEIHelpers.item(item) item Item icon. .scale(f), .noDecorations() (no count/durability).
JEIHelpers.fluid(fluid) drawable 16x16 fluid icon.
JEIHelpers.text(text) text Text. .color(rgb), .shadow().
JEIHelpers.entity(type, scale) entity Rendered entity. .size(w, h), .rotation(deg), .pitch(deg), .spin(degPerSecond), .offset(x, y).
JEIHelpers.compound() compound Several parts: .add(drawable, x, y), .add(drawable) (at 0, 0), .size(w, h).
JEIHelpers.stack(a, b, ...) compound Drawables overlaid at 0, 0.
JEIHelpers.blank(w, h) drawable Empty space.
JEIHelpers.timer(ticks, max, countDown) timer Looping tick timer: .value, .maxValue, .progress.
JEIHelpers.animated(static, timer, dir) drawable Reveals a texture following a timer. dir: left, right, top, bottom.
JEIHelpers.animatedTicks(static, ticks, dir) drawable Same, with a new timer.
JEIHelpers.arrow(), arrowFilled(), animatedArrow(ticks) drawable JEI arrows.
JEIHelpers.flame(), animatedFlame(ticks) drawable JEI flames.
JEIHelpers.plus() drawable JEI plus sign.
JEIHelpers.slot(), outputSlot() drawable JEI slot backgrounds.
JEIHelpers.runtime(), jeiHelpers(), guiHelper() JEI objects Raw JEI access (runtime() is null while JEI is not loaded).
JEIHelpers.recipeType(id) RecipeType JEI recipe type of a category id.
JEIHelpers.categoryIds() list Every loaded category id.
JEIHelpers.isEarlyDeny() boolean Whether deny events run before loading.
JEIHelpers.itemType(), fluidType() ingredient type JEI ingredient types for raw registration calls.
JEIEvents.registerCategories(e => {
  let burn = JEIHelpers.texture('minecraft:textures/gui/sprites/container/furnace/burn_progress.png', 0, 0, 24, 16)
    .textureSize(24, 16)                                                   // real texture size
  let lit = JEIHelpers.texture('minecraft:textures/gui/sprites/container/furnace/lit_progress.png', 0, 0, 14, 14)
    .textureSize(14, 14)

  e.create('kubejs:helpers_demo')
    .size(160, 80)
    .drawable(JEIHelpers.item('minecraft:diamond').scale(2).noDecorations(), 0, 0)          // scaled item
    .drawable(JEIHelpers.fluid(Fluid.of('minecraft:water', 1000)), 40, 0)                   // fluid icon
    .drawable(JEIHelpers.text(Text.of('Text')).color(0xFF5555).shadow(), 60, 0)             // colored text
    .drawable(JEIHelpers.entity('minecraft:zombie', 16).size(30, 40).rotation(30).pitch(10).spin(20).offset(0, 4), 120, 0) // entity
    .drawable(JEIHelpers.stack(JEIHelpers.slot(), JEIHelpers.plus()), 0, 30)                 // overlay
    .drawable(JEIHelpers.compound().add(JEIHelpers.slot()).add(JEIHelpers.blank(4, 4), 18, 0).size(40, 18), 20, 30) // compound + blank
    .drawable(JEIHelpers.animatedTicks(burn, 80, 'left'), 60, 30)                            // animation with its own timer
    .drawable(JEIHelpers.animated(lit, JEIHelpers.timer(200, 14, true), 'top'), 90, 30)      // animation with a timer
    .drawable(JEIHelpers.arrowFilled(), 0, 56)                                               // filled arrow
    .drawable(JEIHelpers.animatedArrow(60), 30, 56)                                          // animated arrow
    .drawable(JEIHelpers.flame(), 60, 56)                                                    // flame
    .drawable(JEIHelpers.animatedFlame(120), 80, 56)                                         // animated flame
    .drawable(JEIHelpers.outputSlot(), 100, 52)                                              // big output slot
    .drawable(JEIHelpers.arrow(), 130, 56)                                                   // arrow
})

let timer = JEIHelpers.timer(100, 10, false)
console.info(`${timer.value} / ${timer.maxValue} (${timer.progress})`)   // timer state
console.info(JEIHelpers.categoryIds())                                     // loaded categories
console.info(JEIHelpers.isEarlyDeny())                                     // deny mode
console.info(JEIHelpers.recipeType('minecraft:smelting'))                  // JEI RecipeType
console.info(JEIHelpers.runtime(), JEIHelpers.jeiHelpers(), JEIHelpers.guiHelper())  // raw JEI objects
console.info(JEIHelpers.itemType(), JEIHelpers.fluidType())                // ingredient types


Just Dire Things integration

Adds KubeJS recipe types for Just Dire Things: goo spreading (by block or block tag), fluid drop conversions, ability upgrades and paxels. All of them show up in the mod's JEI categories.

Required mods: Just Dire Things (KubeJS Infinity Extras loads this only when Just Dire Things is installed)

Part Script folder
event.recipes.justdirethings.* server_scripts

Not scriptable: goo tiers (4 fixed blocks), the Ore-to-Resource JEI page and the coal tier fuel multipliers (hard-coded). Furnace burn times of the coals are the NeoForge furnace_fuels item data map. For the Just Dyna Things addon see Just Dyna Things.

Value formats

Value Format
Block Block state: 'minecraft:stone' or 'minecraft:furnace[facing=north,lit=false]'. The input must be that exact state; properties not given use the block's default state.
Block tag '#minecraft:terracotta'
Item 'justdirethings:coal_t2'

The id field the mod needs inside each recipe is filled in automatically from the recipe id, so .id(...) is optional.

Goo spread

event.recipes.justdirethings.goospread(outputBlock, inputBlock) — a goo block converts the input block into the output (JEI "Goo Spread"). event.recipes.justdirethings.goospread_tag(outputBlock, '#blockTag') — same, the input is any block of a block tag (JEI "Goo Spread (Tag)").

Method Description Default
.tier(1-4) (alias .tierRequirement) Goo tier needed 1
.duration(ticks) (aliases .time, .craftingDuration) Time to convert 2400
ServerEvents.recipes(event => {
  event.recipes.justdirethings.goospread('minecraft:diamond_ore', 'minecraft:coal_ore')
    .tier(3)                                // goo tier needed (alias: .tierRequirement())
    .duration(4800)                         // conversion time in ticks (aliases: .time(), .craftingDuration())
    .id('kubejs:goo_coal_to_diamond_ore')   // optional recipe id

  event.recipes.justdirethings.goospread('minecraft:mud', 'minecraft:dirt')

  event.recipes.justdirethings.goospread('justdirethings:raw_coal_t2_ore[facing=north]', 'minecraft:coal_block')
    .tier(2)
    .time(3600)                             // alias of .duration()

  event.recipes.justdirethings.goospread_tag('minecraft:sand', '#minecraft:terracotta')
    .tier(2)
    .duration(1200)
})

Fluid drop

event.recipes.justdirethings.fluiddrop(outputFluidBlock, inputFluidBlock, catalystItem) — drop the catalyst item into a fluid source block to turn it into another fluid. Output and input are fluid source blocks. No chained options.

ServerEvents.recipes(event => {
  event.recipes.justdirethings.fluiddrop('justdirethings:refined_t2_fluid_block', 'minecraft:lava', 'justdirethings:coal_t2')
    .id('kubejs:lava_to_refined_t2')
})

Ability upgrade

event.recipes.justdirethings.ability(base, addition) — smithing table: tool or armor plus an upgrade item (JEI "Ability Upgrade").

Method Description Default
.template(ingredient) Smithing template none
ServerEvents.recipes(event => {
  event.recipes.justdirethings.ability('justdirethings:ferricore_pickaxe', 'justdirethings:upgrade_oreminer')
  event.recipes.justdirethings.ability('justdirethings:blazegold_pickaxe', 'justdirethings:upgrade_smelter')
    .template('justdirethings:template_ferricore') // smithing template slot
})

Paxel

event.recipes.justdirethings.paxel(result, template, base, addition) — smithing table; the mod uses pickaxe, axe and shovel. No chained options.

ServerEvents.recipes(event => {
  event.recipes.justdirethings.paxel('justdirethings:celestigem_paxel',
    'justdirethings:ferricore_pickaxe', 'justdirethings:ferricore_axe', 'justdirethings:ferricore_shovel')
})

Removing recipes

ServerEvents.recipes(event => {
  event.remove('justdirethings:budding_time_timeblock')
  event.remove('justdirethings:time_fluid_block-fluiddrop')
})


Just Dyna Things integration

Recipes for the Paradox Mixer and the Reforger of Just Dyna Things (a Just Dire Things addon), plus startup edits to its data maps: Thermo Generator heat sources and coolants, and the repair materials of the Ferricore, Blazegold and Eclipse Alloy anvils.

Required mods: Just Dyna Things (KubeJS Infinity Extras loads this only when Just Dyna Things is installed)

Part Script folder
JustDynaThingsEvents.registry(...) (needs a game restart) startup_scripts
event.recipes.justdynathings.* server_scripts

Not scriptable: the fuel JEI pages (built from Just Dire Things' hard-coded coal tiers). Just Dire Things recipes are on the Just Dire Things page.


Data maps (startup)

JustDynaThingsEvents.registry('<category>', e => { ... })

Event method Description
e.create(idOrTag) Adds or replaces an entry (id or '#tag'); chain the value method below
e.remove(idOrTag) Removes an entry, including the mod's own ones

Entries use the block, fluid or item's own name, so there is nothing to translate.

Category Entry type Value method Mod defaults (for reference)
thermo_heat_sources block .heatEfficiency(n) (default 1.0) lava 1.0, campfire 0.5, coal block T4 10.5
thermo_coolants fluid .coolantEfficiency(n) (default 1.0) water 1.0, time fluid 5.0
ferricore_repair item .durability(n) (default 64) iron ingot 64, ferricore ingot 128
blazegold_repair fluid .efficiency(n) (default 1.0) lava 1.0, refined T4 fluid 7.5
eclipsealloy_repair fluid .percentage(0-99) (alias .percentuage, default 10) time fluid 10

A value method used in the wrong category is ignored with a warning; out-of-range values are clamped.

JustDynaThingsEvents.registry('thermo_heat_sources', e => {
  e.create('minecraft:soul_fire').heatEfficiency(1.5)      // add or replace a heat source block
  e.create('minecraft:soul_campfire').heatEfficiency(0.75)
  e.create('#minecraft:campfires').heatEfficiency(0.5)     // a block tag works too
  e.remove('minecraft:magma_block')                        // remove an entry (also the mod's own)
})

JustDynaThingsEvents.registry('thermo_coolants', e => {
  e.create('justdirethings:refined_t2_fluid_source').coolantEfficiency(3.0) // coolant fluid efficiency
})

JustDynaThingsEvents.registry('ferricore_repair', e => {
  e.create('minecraft:iron_block').durability(576)         // durability repaired per item
  e.create('#c:ingots/steel').durability(96)
})

JustDynaThingsEvents.registry('blazegold_repair', e => {
  e.create('justdirethings:unrefined_t2_fluid_source').efficiency(1.5) // repair fluid efficiency
})

JustDynaThingsEvents.registry('eclipsealloy_repair', e => {
  e.create('justdirethings:polymorphic_fluid_source').percentage(5)    // percent repaired (alias: .percentuage())
})

Paradox Mixer

event.recipes.justdynathings.paradox_mixer(outputFluid, inputFluid, catalystItem) — no chained options.

ServerEvents.recipes(event => {
  event.recipes.justdynathings.paradox_mixer(
    Fluid.of('justdirethings:refined_t2_fluid_source', 1000),
    Fluid.of('minecraft:lava', 1000),
    'justdirethings:coal_t2'
  ).id('kubejs:paradox/lava_to_refined_t2')

  event.recipes.justdynathings.paradox_mixer(
    Fluid.of('justdirethings:time_fluid_source', 1000),
    Fluid.of('minecraft:water', 1000),
    '#c:gems/diamond'
  )
})

Reforger

event.recipes.justdynathings.reforger(output, input, catalyst)

output and input are a block id or a block tag; a tag as output gives a random block of the tag ('#c:ores_in_ground/stone').

Method Description Default
.chance(0-100) (alias .chanceToUse) Chance (%) that the catalyst is used up 50
ServerEvents.recipes(event => {
  event.recipes.justdynathings.reforger('minecraft:deepslate', 'minecraft:cobbled_deepslate', 'minecraft:flint')
    .chance(25)     // % chance the catalyst is used up (alias: .chanceToUse())

  event.recipes.justdynathings.reforger('#c:ores_in_ground/deepslate', 'minecraft:deepslate', 'justdirethings:celestigem')
    .chance(75)
    .id('kubejs:reforger/deepslate_ores')

  event.recipes.justdynathings.reforger('justdirethings:raw_coal_t1_ore', '#minecraft:coal_ores', 'justdirethings:coal_t1')

  event.remove('justdynathings:reforger/stone_to_stone_with_diamond')
})


KubeJS Recipe Maker

An in-game tool that writes KubeJS recipe scripts for you. Build a recipe in a GUI (or read it from a filled Extended Crafting table) and it is saved to kubejs/server_scripts/generated_<namespace>.js, ready for /reload.

Required mods: Extended Crafting (the tool is a variant of its Recipe Maker). No script is needed.


Getting it

Extended Crafting's creative tab has a third Recipe Maker next to the "Datapack" and "CraftTweaker" ones, with the tooltip Type: KubeJS. It is the same extendedcrafting:recipe_maker item with the component type: "KubeJS", so it also works from /give:

/give @s extendedcrafting:recipe_maker[extendedcrafting:recipe_maker={type:"KubeJS",shapeless:false}]

Writing files happens on the server, so it also works on a dedicated server; only operators (or the singleplayer owner) can save.


Recipe creation GUI

Right-click the air (or a block that does nothing with it) to open the GUI.

  • Categories: the < > arrows at the top left switch between Extended Crafting, Vanilla and one category per supported mod that is installed: AE2, NuclearCraft, Mekanism: More Machine, Mekanism Elements, Hephaestus, Twilight Forest, XyCraft Machines, Ad Astra, Excessive Utilities, Irregular Implements, Create Crafts & Additions, Farming for Blockheads, Enchanted, Agritech: Two / Evolved, Botany Pots, Just Dire Things, Just Dyna Things, FTB Stuff, Masterful Botany and Apotheosis. Mods that are not installed are not listed.
  • Machines: the buttons below pick the machine of the category (8 per page, < > under them for more). Hover a button to see the call it writes.
    • Extended Crafting: Basic 3x3, Advanced 5x5, Elite 7x7 and Ultimate 9x9 tables, Ender Crafter, Flux Crafter (3x3), Combination (core slot + up to 49 pedestal items) and Compressor (input + optional catalyst), with Shaped/Shapeless and, for tables, "Exact tier" (.tier(n)) or "Any table".
    • Vanilla: shaped / shapeless crafting, furnace, blast furnace, smoker, campfire, stonecutter and smithing table (event.shaped, event.shapeless, event.smelting(...).xp(v).cookingTime(t), ...).
    • Mod machines: the item-based machines of each mod, for example the AE2 inscriber (Top / Middle / Bottom, "Mode: press / inscribe"), charger, transform and entropy manipulator.
  • Slots: only the grid cells the machine uses are shown; named slots have a label above them. Put real items from your inventory in them and the result (stack size and components kept) in Output. Machines with several results show up to 4 output slots. Everything is given back when the GUI closes or a slot stops being used.
  • Fields: the fields on the right become chained methods (.time(v).energy(v), .cookingTime(v), .powerRequired(v), ...). An empty field means the schema default and is not written. Fluids and chemicals are typed as id amount (several separated by commas where the machine takes a list) and written the way the mod expects: Fluid.of('minecraft:water', 1000) or '500x mekanism:oxygen'. You can also drag fluids and chemicals from JEI.
  • Toggles: shaped/shapeless, mode, explosion, ... are the buttons above Save.
  • Save: writes the recipe (shaped patterns trimmed to the used rows/columns) to kubejs/server_scripts/generated_<namespace of the output>.js (for fluid- or chemical-only results, the namespace of that fluid or chemical). The GUI and the chat show the result or what is missing.

Reading a filled Extended Crafting machine

  1. Fill the grid of a Basic / Advanced / Elite / Ultimate (or Auto) Table, an Ender Crafter or a Flux Crafter, or put the center item on a Crafting Core and the ingredients on its pedestals.
  2. Hold the KubeJS Recipe Maker in the main hand and the recipe output in the off hand (stack size and components are kept, for example 4 stone).
  3. Sneak + right-click the air to switch Shaped / Shapeless (same as Extended Crafting's maker).
  4. Right-click the table / crafter / core. The recipe is written to kubejs/server_scripts/generated_<output namespace>.js inside its ServerEvents.recipes(event => { ... }) block (file and block are created when missing), and the chat shows the file (click to copy its path). Run /reload to load it.

Same rules as Extended Crafting's Datapack / CraftTweaker exporters: the grid size gives the tier, the useTags / useDataComponents options of config/extendedcrafting-common.toml decide whether an ingredient becomes '#tag' or 'item[component=value]' (partial match), and flux recipes get the configured power rate.


Output

Every recipe gets an id in the kubejs namespace (kubejs:<mod>/<type>/<item>, then _2, _3, ... when taken), and an identical recipe is never written twice. Example file:

ServerEvents.recipes(event => {
  event.recipes.extendedcrafting.shaped_table('minecraft:beacon', [
    'AAAAA',
    'ABBBA',
    'ABCBA',
    'ABBBA',
    'AAAAA'
  ], {
    A: 'minecraft:obsidian',
    B: 'minecraft:glass',
    C: 'minecraft:nether_star'
  }).tier(2).id('kubejs:extendedcrafting/shaped_table/beacon')   // tier from the grid size, generated id
  event.recipes.extendedcrafting.combination('minecraft:elytra', 'minecraft:phantom_membrane', [
    'minecraft:feather',
    'minecraft:feather'
  ]).id('kubejs:extendedcrafting/combination/elytra')   // generated id in the kubejs namespace
})

See Extended Crafting for every option of the generated calls.



Masterful Botany integration

Adds recipe schemas for Masterful Botany's own machines: the mana infuser (Alfheim agglomeration plate) and the rune ritual.

Required mods: Masterful Botany 1.0.x and its dependencies (KubeJS Infinity Extras loads this only when Masterful Botany is installed)

Part Script folder
event.recipes.masterfulbotany.* server_scripts

Masterful Botany's other recipes (runic altar, petals, mana infusion, elven trade) use its base mod's own recipe types and are not part of this integration.


Mana infuser

event.recipes.masterfulbotany.infuser(output, ingredients[, mana])

Method Description Default
.mana(n) Mana consumed 500000
.fromColor(color) / .fromColour(...) Colour at the start of the infusion 0x0000FF
.toColor(color) / .toColour(...) Colour at the end 0x00FF00

Ingredients accept items and tags.

// server_scripts
ServerEvents.recipes(event => {
  event.recipes.masterfulbotany.infuser('minecraft:netherite_ingot', ['minecraft:netherite_scrap', 'minecraft:netherite_scrap', 'minecraft:gold_ingot'], 750000)
    .fromColor(0x3D2B1F)   // colour at the start (alias: .fromColour())
    .toColor(0xFF9900)     // colour at the end (alias: .toColour())

  event.recipes.masterfulbotany.infuser('2x minecraft:echo_shard', ['minecraft:amethyst_shard', 'masterfulbotany:alfsteel_nugget'])
    .mana(200000)          // mana consumed, chained instead of the third argument
})

Rune ritual

event.recipes.masterfulbotany.rune_ritual(outputs, center, inputs)

  • outputs: one item or a list. May be an empty list [] when .specialOutput() is used.
  • center: the item in the middle of the ritual.
  • inputs: items thrown around the center (one or a list).
Method Description Default
.rune(rune, x, z) Places a rune (not consumed) at block offset x/z from the center —
.consumedRune(rune, x, z) Places a rune that the ritual consumes —
.runeRing(rune, x, z) Places the same rune at (x, z), (-x, -z), (-z, x) and (z, -x): a 4-fold symmetric pattern —
.inputs(list) Replaces the thrown inputs —
.runes(list) Replaces every rune; each entry is [rune, x, z, consumed?] —
.mana(n) Mana consumed 0
.ticks(n) / .time(n) Ritual duration in ticks 200
.specialInput(id) Special input hook registered by Masterful Botany (for example masterfulbotany:wandering_trader) none
.specialOutput(id) Special output hook (for example masterfulbotany:mjoellnir) none
// server_scripts
ServerEvents.recipes(event => {
  event.recipes.masterfulbotany.rune_ritual(['minecraft:elytra', 'minecraft:phantom_membrane'], 'masterfulbotany:fimbultyr_tablet', ['minecraft:feather'])
    .runeRing('masterfulbotany:asgard_rune', 3, 0)        // runes at (3,0) (-3,0) (0,3) (0,-3)
    .rune('masterfulbotany:asgard_rune', 2, 2)            // rune at x 2, z 2, not consumed
    .consumedRune('masterfulbotany:asgard_rune', -2, -2)  // rune consumed by the ritual
    .mana(250000)                                         // mana consumed
    .ticks(300)                                           // ritual duration (alias: .time())

  event.recipes.masterfulbotany.rune_ritual([], 'masterfulbotany:fimbultyr_tablet', ['minecraft:emerald'])
    .runeRing('masterfulbotany:asgard_rune', 2, 2)        // 4-fold symmetric ring
    .specialInput('masterfulbotany:wandering_trader')     // special input hook
    .specialOutput('masterfulbotany:mjoellnir')           // special output hook (outputs list is empty)
    .mana(500000)

  event.recipes.masterfulbotany.rune_ritual('minecraft:trident', 'masterfulbotany:fimbultyr_tablet', [])
    .inputs(['minecraft:prismarine_shard', 'minecraft:heart_of_the_sea'])   // replaces the thrown inputs
    .runes([['masterfulbotany:asgard_rune', 2, 0], ['masterfulbotany:asgard_rune', -2, 0, true]]) // replaces every rune: [rune, x, z, consumed?]
})


Mekanism addons integration (More Machine, Elements, Extras)

Recipes for the machines of Mekanism: More Machine and Mekanism Elements, plus Mekanism: More Machine's replicator costs and solar heat generator fluids. Mekanism Extras has no recipe types of its own (see below).

Required mods: Mekanism, plus Mekanism: More Machine (mekmm), Mekanism Elements (mekanismelements) and/or Mekanism Extras (mekanism_extras). Each part loads only when its mod is installed. KubeJS Mekanism is not required.

Part Script folder
event.recipes.mekmm.*, event.recipes.mekanismelements.* server_scripts
MekmmEvents.registry('replicator' | 'solar_heat_fluid', ...) startup_scripts

Value formats:

Kind Examples
item input 'minecraft:dirt', '3x minecraft:dirt', '#c:ingots/iron', '2x #c:gems'
item output '4x minecraft:diamond', Item.of('minecraft:diamond', 4)
fluid input '50x minecraft:water', Fluid.of('minecraft:water', 50) (mB)
chemical input '250x mekanism:hydrogen', '10x #some:chemical_tag'
chemical output '500x mekanism:oxygen'

A chemical without <n>x defaults to 1000 mB. Mekanism's own recipe types (mekanism:enriching, mekanism:oxidizing, mekanism:reaction, ...) that these addons' machines also use are not covered here: write them with event.custom(...).


Mekanism: More Machine (mekmm)

Planting Station

event.recipes.mekmm.planting(mainOutput, itemInput, chemicalInput[, secondaryOutput, secondaryChance])

Method Description Default
.secondaryOutput(item) Secondary output (set .secondaryChance too: the mod requires it) none
.secondaryChance(0..1) Chance of the secondary output none
.perTickUsage(bool) true: the chemical amount is used every tick (keep it small); false: one-shot cost true

Recycler

event.recipes.mekmm.recycler(output, input[, chance]) — .chance(0..1), default 1.

CNC Stamper

event.recipes.mekmm.stamper(output, input, mold) — the mold is not consumed.

CNC Lathe and CNC Rolling Mill

event.recipes.mekmm.lathe(output, input) and event.recipes.mekmm.rolling_mill(output, input) — no options.

Presser

event.recipes.mekmm.pressing(output, primaryInput, secondaryInput, tertiaryInput) — no options.

// kubejs/server_scripts/mekanism_addons.js
ServerEvents.recipes(event => {
  event.recipes.mekmm.planting('6x minecraft:melon_slice', 'minecraft:melon_seeds', '1x mekmm:nutrient_solution')   // main output, seed, chemical per tick
  event.recipes.mekmm.planting('9x minecraft:potato', 'minecraft:potato', '1x mekmm:nutrient_solution')
    .secondaryOutput('minecraft:poisonous_potato')   // secondary output
    .secondaryChance(0.25)                           // its chance (required with a secondary output)
  event.recipes.mekmm.planting('4x minecraft:wheat', 'minecraft:wheat_seeds', '100x mekmm:nutrient_solution', '2x minecraft:wheat_seeds', 0.5)   // 5-argument form
    .perTickUsage(false)                             // one-shot chemical cost instead of per tick

  event.recipes.mekmm.recycler('mekmm:scrap', '#minecraft:logs', 0.2)     // chance as 3rd argument
  event.recipes.mekmm.recycler('minecraft:iron_nugget', 'minecraft:chain')
    .chance(0.5)                                     // 50 % chance

  event.recipes.mekmm.stamper('4x minecraft:iron_bars', 'minecraft:iron_ingot', 'minecraft:iron_trapdoor')   // output, input, mold (kept)
  event.recipes.mekmm.lathe('4x minecraft:stick', '#minecraft:planks')                   // CNC Lathe
  event.recipes.mekmm.rolling_mill('3x minecraft:iron_bars', '2x minecraft:iron_ingot')  // CNC Rolling Mill
  event.recipes.mekmm.pressing('minecraft:diamond', '9x minecraft:coal_block', 'minecraft:obsidian', '4x #c:dusts/redstone')   // output, primary, secondary, tertiary

  event.remove({ type: 'mekmm:planting', output: 'minecraft:bamboo' })   // remove a planting recipe
})

Replicator costs — MekmmEvents.registry('replicator', ...) (startup)

Data maps for the Item / Fluid / Chemical Replicator, merged with the mod's defaults. Ids may be tags with #.

Method Description Limits
event.item(idOrTag, uuAmount) UU matter (mB) per item uu 1-10000
event.fluid(idOrTag, inputAmount, uuAmount, outputAmount) Fluid replication cost input 1-5000, uu 1-10000, output 1-10000
event.chemical(idOrTag, inputAmount, uuAmount, outputAmount) Chemical replication cost all 1-10000
event.removeItem(idOrTag) / event.removeFluid(idOrTag) / event.removeChemical(idOrTag) Remove a default entry -

Solar heat generator fluids — MekmmEvents.registry('solar_heat_fluid', ...) (startup)

Method Description
event.add(idOrTag, consumption, generationModifier) Fluid burnt by the solar heat generator: mB used and generation modifier (> 0)
event.remove(idOrTag) Remove a default fluid
// kubejs/startup_scripts/mekanism_addons.js
MekmmEvents.registry('replicator', event => {
  event.item('minecraft:diamond', 50)                  // 50 mB UU matter per diamond
  event.item('#c:gems', 20)                            // tags work too
  event.removeItem('minecraft:dragon_egg')             // remove a default item cost
  event.fluid('minecraft:lava', 1000, 2, 500)          // input mB, UU mB, output mB
  event.removeFluid('#c:water')                        // remove a default fluid cost
  event.chemical('mekanism:hydrogen', 1000, 1, 500)    // input mB, UU mB, output mB
  event.removeChemical('mekanism:antimatter')          // remove a default chemical cost
})

MekmmEvents.registry('solar_heat_fluid', event => {
  event.add('minecraft:lava', 50, 2.0)                 // mB used, generation modifier
  event.remove('minecraft:water')                      // remove a default fluid
})

Mekanism Elements (mekanismelements)

All four types have no chained options.

Machine Signature
Adsorption Separator event.recipes.mekanismelements.adsorption(chemicalOutput, itemInput, fluidInput)
Chemical Demolition Machine event.recipes.mekanismelements.chemical_demolition(mainOutput, secondaryOutput, itemInput, chemicalInput) (both outputs required)
Infinity Ore Reprocessing event.recipes.mekanismelements.infinity_ore_reprocessing(output, itemInput, chemicalInput)
Radiation Irradiator event.recipes.mekanismelements.radiation_irradiating(chemicalOutput, itemInput, chemicalInput)
ServerEvents.recipes(event => {
  event.recipes.mekanismelements.adsorption('400x mekanismelements:beryllium', 'mekanismelements:high_performance_adsorbent_beryllium', '50x mekanismelements:seawater')   // chemical out, item in, fluid in
  event.recipes.mekanismelements.chemical_demolition('8x minecraft:iron_ingot', '2x minecraft:redstone', 'minecraft:piston', '5x mekanismelements:seawater')   // main out, secondary out, item in, chemical in
  event.recipes.mekanismelements.infinity_ore_reprocessing('16x mekanism:dust_osmium', '#c:ingots/osmium', '9500x mekanismelements:seawater')   // item out, item in, chemical in
  event.recipes.mekanismelements.radiation_irradiating('250x mekanism:polonium', 'mekanismelements:pellet_neutron_source', '4x mekanism:plutonium')   // chemical out, item in, chemical in

  event.remove({ type: 'mekanismelements:adsorption' })   // remove every adsorption recipe
})

Mekanism Extras (mekanism_extras)

Mekanism Extras registers no recipe types of its own: its machines (tiered factories, enriching, oxidizing, metallurgic infusing, rotary, reaction, nucleosynthesizing, ...) run Mekanism's own mekanism:* recipes, so write those with event.custom(...). Its tiers are hard-coded and its chemicals live in Mekanism's chemical registry, so there is nothing extra to register.

ServerEvents.recipes(event => {
  // raw JSON is the only accepted form here: Mekanism's own types are not covered by KubeJS Infinity Extras
  event.custom({ type: 'mekanism:enriching', input: { count: 1, item: 'minecraft:coal_block' }, output: { count: 2, id: 'minecraft:diamond' } })   // used by Mekanism Extras' enriching machines too
})


Mekanism Generators integration

Mekanism hard-codes its reactor fuels (fissile fuel -> nuclear waste, deuterium + tritium / D-T fuel). KubeJS Infinity Extras adds two recipe types so scripts can add more Fission Reactor and Fusion Reactor fuels, both shown in JEI and in chemical tooltips.

Required mods: Mekanism and Mekanism Generators. KubeJS Infinity Extras loads this only when Mekanism Generators is installed.

Part Script folder
event.recipes.mekanismgenerators.fission / fusion server_scripts (/reload)

Value formats: chemical input '1x mekanism:plutonium', '5x #some:chemical_tag'; chemical output '2x mekanism:spent_nuclear_waste'. A chemical without <n>x defaults to 1000 mB. The chemicals must already exist (Mekanism's own or another mod's).


Fission Reactor fuel

event.recipes.mekanismgenerators.fission(waste, fuel) — recipe type kjsinfinityextras:fission_fuel.

The reactor's fuel tank accepts the fuel. Burning <fuel amount> mB makes <waste amount> mB of waste, so only the ratio matters ('2x' waste per '1x' fuel = 2 mB of waste per mB burned). Shown in Mekanism's own Fission Reactor JEI category, one entry per coolant.

Method Description Default
.heat(joules) Heat made per mB burned. More heat boils more coolant and heats the reactor faster Mekanism's energyPerFissionFuel config (1 000 000 J, same as fissile fuel)

A recipe for mekanism:fissile_fuel itself replaces Mekanism's behavior (Mekanism's own fissile fuel entries stay in JEI).

// kubejs/server_scripts/mekanism_reactors.js
ServerEvents.recipes(event => {
  event.recipes.mekanismgenerators.fission('2x mekanism:spent_nuclear_waste', '1x mekanism:plutonium')   // 2 mB waste per mB burned
    .heat(2500000)                                 // joules per mB burned

  event.recipes.mekanismgenerators.fission('1x mekanism:nuclear_waste', '1x mekanism:uranium_hexafluoride')   // same heat as fissile fuel, 1:1 waste

  event.recipes.mekanismgenerators.fission('1x mekanism:polonium', '1x mekanism:fissile_fuel')   // replaces fissile fuel's behavior
    .heat(500000)                                  // half the heat
})

Fusion Reactor fuel

event.recipes.mekanismgenerators.fusion(fuel) — recipe type kjsinfinityextras:fusion_fuel.

The fuel is piped straight into the reactor, like D-T fuel. Shown in the "Fusion Reactor Fuel" JEI category next to Mekanism's D-T fuel. Chemical amounts are not used by fusion recipes.

Method Description Default
.energy(multiplier) Plasma heat per mB burned; D-T fuel = 1 1
.secondFuel(chemical) Fuel pair, like deuterium + tritium: the fuel goes into the deuterium tank, the second fuel into the tritium tank, and the reactor injects 1 mB of each as 2 mB of fuel none

A paired fuel can not be piped straight into the reactor; give it its own fusion() recipe for that.

ServerEvents.recipes(event => {
  event.recipes.mekanismgenerators.fusion('mekanism:antimatter')   // piped straight into the reactor
    .energy(8)                                     // 8x the plasma heat of D-T fuel

  event.recipes.mekanismgenerators.fusion('mekanism:hydrogen')     // goes into the deuterium tank
    .secondFuel('mekanism:lithium')                // goes into the tritium tank (fuel pair)
    .energy(0.5)
})


Mekanism: Isotope Logistics integration

Adds the IsotopeLogistics binding to build and read filled radioisotope capsules. Capsule contents are data components, so they cannot be written as a plain item id; the binding creates the right stack for you.

Required mods: Mekanism: Isotope Logistics (mod id nuclearentangloporter) (KubeJS Infinity Extras loads this only when Isotope Logistics is installed)

Part Script folder
IsotopeLogistics binding any (startup_scripts, server_scripts, client_scripts)

The mod has no recipe types and no data pack registries or data maps. The Radiological Encapsulator, Isotopic Phase Controller and Chemical Reconstitution Chamber work with any radioactive Mekanism chemical (radioactivity is a chemical attribute). Its own recipes are vanilla crafting (event.shaped / event.shapeless) plus one mekanism:metallurgic_infusing.

IsotopeLogistics binding

Method Returns Description
IsotopeLogistics.capsule(chemical) ItemStack Active capsule filled with the chemical (always full)
IsotopeLogistics.capsule(chemical, phaseLocked) ItemStack phaseLocked = true gives a phase-locked (stabilized) capsule
IsotopeLogistics.capsuleCapacity() number Capsule capacity in mB; any other amount is set to it
IsotopeLogistics.contents(stack) ChemicalStack Chemical inside a capsule (.amount, .chemical)
IsotopeLogistics.radiation(stack) number Radiation of a capsule (Sv/h)
IsotopeLogistics.isActive(stack) boolean Whether the capsule is an active capsule
IsotopeLogistics.isPhaseLocked(stack) boolean Whether the capsule is phase-locked

Chemical format: 'mekanism:polonium' (1000 mB) or '500x mekanism:polonium'.

Capsules work as recipe results. As ingredients only the item is matched, not its contents.

// server_scripts
ServerEvents.recipes(event => {
    event.shaped(IsotopeLogistics.capsule('1000x mekanism:polonium', true), [ // true = phase-locked capsule
        'LPL',
        'PCP',
        'LPL'
    ], {
        L: '#c:ingots/lead',
        P: 'mekanism:pellet_polonium',
        C: 'nuclearentangloporter:empty_containment_capsule'
    })
})

// a plain active capsule (not phase-locked) as a result
ServerEvents.recipes(event => {
    event.shapeless(IsotopeLogistics.capsule('mekanism:polonium'), ['nuclearentangloporter:empty_containment_capsule', 'mekanism:pellet_polonium'])
})

// reading a capsule at runtime
ItemEvents.rightClicked('nuclearentangloporter:active_radioisotope_capsule', event => {
    event.player.tell(`${IsotopeLogistics.contents(event.item).amount} mB of ${IsotopeLogistics.contents(event.item).chemical}`) // ChemicalStack inside
    event.player.tell(`${IsotopeLogistics.radiation(event.item)} Sv/h`)                     // radiation of the capsule
    event.player.tell(`active: ${IsotopeLogistics.isActive(event.item)}`)                   // is it an active capsule
    event.player.tell(`phase locked: ${IsotopeLogistics.isPhaseLocked(event.item)}`)        // is it phase-locked
    event.player.tell(`capacity: ${IsotopeLogistics.capsuleCapacity()} mB`)                 // capsule capacity
})


NuclearCraft integration

Recipes for every NuclearCraft: Neoteric recipe type (processors, fission, fusion, turbines, nuclear blast, particle physics), written with chained options, plus new plates, rods, gears, radioactive items, heat sinks, accelerator coolers, fission fuels, fluids and coolants. Every recipe made here is a real NuclearCraft recipe and shows in NuclearCraft's JEI categories (accelerator_coolant has no JEI category in NuclearCraft itself).

Required mods: NuclearCraft: Neoteric. KubeJS Infinity Extras loads this only when NuclearCraft is installed.

Part Script folder
NuclearcraftEvents.registry(...) and NuclearCraft builder types startup_scripts (game restart)
NuclearCraft's own NuclearCraftEvents.registerFissionFuel / registerHeatSink / registerParticleSource startup_scripts
event.recipes.nuclearcraft.* recipes server_scripts (/reload)

NuclearCraft's own KubeJS events (NuclearCraftEvents.*, capital C) are part of NuclearCraft and keep working; see NuclearCraft's documentation for them. KubeJS Infinity Extras adds everything below on top of them.

// NuclearCraft's own event, still works (startup)
NuclearCraftEvents.registerHeatSink(event => {
  event.register('iridium', 190, ['#nuclearcraft:moderators', 'osmium_heat_sink'])   // name, heat, rules
})

Radiation (all registries)

Every registry builder below (items, fluids, coolants, heat sinks, coolers, fuels) accepts:

Method Description Default
.radioactive(bool) Default isotope nr:pu_239, 3.57e21 atoms (about one Pu-239 item) false (true for radioactive)
.radiation(isotope, atoms) Exact isotope and atom count; call several times for several isotopes -

Isotopes: nr:u_233 u_234 u_235 u_238 pu_238..pu_242 am_241..am_243 cm_243..cm_247 bk_247 bk_248 cf_249..cf_252 th_230 th_232 np_236 np_237 co_60 cs_137 sr_90 i_131 ir_192 po_210 ... (see the Nuclear Radiation library).


Registries — NuclearcraftEvents.registry('<category>', event => ...) (startup)

Categories (aliases in brackets): plates, rods, gears, radioactive (radioactive_items), heat_sinks (heats, heat_sink), coolers, fuels, fluids, coolants (refrigerants). Plain ids get the kubejs namespace. All usual KubeJS item/block/fluid options (.displayName(), .texture(), .color(), ...) work too.

Plates — 'plates'

Tags c:plates and c:plates/<material>. A pressurizer recipe #c:ingots/<material> -> plate is generated (loaded only while that ingot tag has entries). Default texture: NuclearCraft's iron plate.

Method Description Default
.material(name) Material for tags and the recipe taken from the id (osmium_plate -> osmium)
.ingot(ingredient) Other pressurizer input #c:ingots/<material>
.recipeTime(ticks) Pressurizer time NuclearCraft default
.recipeEnergy(rf) Pressurizer energy per tick NuclearCraft default
.noRecipe() No generated recipe recipe on

Rods and gears — 'rods', 'gears'

Tags c:rods(/x) and c:gears(/x), no recipes. Methods: .material(name), .radioactive(), .radiation().

Radioactive items — 'radioactive'

Items that are radioactive by default, plus radiation for content that already exists:

Method Description
event.create(id) New radioactive item (default isotope)
event.bindItem(itemOrTag, isotope, atoms) Make an existing item (or #tag) radioactive
event.bindBlock(blockOrTag, isotope, atoms) Same for blocks
event.bindFluid(fluidOrTag, isotope, atoms) Same for fluids
// kubejs/startup_scripts/nuclearcraft.js
NuclearcraftEvents.registry('plates', event => {
  event.create('osmium_plate')                     // material 'osmium' taken from the id
  event.create('kubejs:hot_steel_plate')
    .material('hot_steel')                         // tags c:plates/hot_steel
    .ingot('#c:ingots/steel')                      // other pressurizer input
    .recipeTime(300)                               // pressurizer time
    .recipeEnergy(80)                              // pressurizer RF/t
    .color(0, 0xC04020)                            // KubeJS tint
    .displayName('Hot Steel Plate')
  event.create('plutonium_plate').radioactive(true)                        // default isotope
  event.create('silly_plate').noRecipe().texture('kubejs:item/silly_plate')   // no generated recipe
})

NuclearcraftEvents.registry('rods', event => {
  event.create('thorium_rod')
    .material('thorium')                           // tags c:rods/thorium
    .radiation('nr:th_232', 5e22)                  // exact isotope and atoms
    .texture('kubejs:item/thorium_rod')
})

NuclearcraftEvents.registry('gears', event => {
  event.create('tough_alloy_gear')
    .material('tough_alloy')                       // tags c:gears/tough_alloy
    .texture('kubejs:item/tough_alloy_gear')
})

NuclearcraftEvents.registry('radioactive', event => {
  event.create('glowing_shard')                                    // radioactive by default
  event.create('cobalt_source').radiation('nr:co_60', 1e18)        // own isotope
  event.bindItem('minecraft:glowstone_dust', 'nr:sr_90', 1e17)     // existing item (or #tag)
  event.bindBlock('#c:storage_blocks/osmium', 'nr:u_238', 1e24)    // existing block (or #tag)
  event.bindFluid('minecraft:lava', 'nr:cs_137', 1e15)             // existing fluid (or #tag)
})

Fission heat sinks — 'heat_sinks'

Registers block nuclearcraft:<name>_heat_sink, a real NuclearCraft heat sink (reactor validation, fission designer, JEI placement rules).

Method Description Default
.heat(h) Heat removed per tick -
.rules(rules...) Placement rules (NuclearCraft syntax) none
.texture(path) Block texture NuclearCraft's iron heat sink
.displayName(name) English name generated
event.modify(name, def => def.heat(h)) Change a built-in heat sink -
event.remove(name) Disable a built-in heat sink -

Rule syntax: >N at least, =N exactly, <N less than, -N between, ^N in corner, a|b either; ids without namespace are NuclearCraft ids.

Accelerator coolers — 'coolers'

Real NuclearCraft cooler blocks for the linear and ring accelerators.

Method Description Default
.cooling(n) / .heat(n) Cooling per tick -
.rules(rules...) Placement rules (same syntax) none
.texture(path) Block texture NuclearCraft's iron cooler
NuclearcraftEvents.registry('heat_sinks', event => {
  event.create('osmium')                                           // block nuclearcraft:osmium_heat_sink
    .heat(170)                                                     // heat removed per tick
    .rules('fission_reactor_solid_fuel_cell', '#nuclearcraft:moderators>2')   // placement rules
    .texture('kubejs:block/osmium_heat_sink')                      // own texture
    .displayName('Osmium Heat Sink')                               // English name
  event.create('radium').heat(200).rules('osmium_heat_sink').radioactive(true)
  event.modify('water', def => def.heat(70))                       // change a built-in heat sink
  event.remove('obsidian')                                         // disable a built-in heat sink
})

NuclearcraftEvents.registry('coolers', event => {
  event.create('osmium_cooler')
    .cooling(150)                                                  // cooling per tick
    .rules('water_cooler', '#nuclearcraft:rf_amplifiers>2')        // placement rules
    .texture('kubejs:block/osmium_cooler')
  event.create('iridium_cooler')
    .heat(180)                                                     // alias of .cooling()
})

Fission fuels — 'fuels'

event.create(group, name): NuclearCraft creates fuel_<group>_<name> (+ _ox, _ni, _za, _tr), depleted items and molten fluids. KubeJS Infinity Extras generates the nuclearcraft:fission_reactor recipes so the fuel burns in the reactor.

Method Description Default
.forgeEnergy(rf) / .energy(rf) RF/t -
.heat(h) H/t -
.criticality(n) Criticality -
.depletion(s) Depletion time in seconds -
.efficiency(n) Efficiency -
.isotopes(first, second) Isotope numbers -
.recipeModifiers(time, power, radiation) Modifiers for the generated recipes 1, 1, 1
.noRecipes() Do not generate the fission reactor recipes recipes on
event.modify(group, name, def => ...) Change a built-in fuel -
event.remove(group, name) Disable a built-in fuel -
NuclearcraftEvents.registry('fuels', event => {
  event.create('osmium', 'leo-190')                // group, name -> fuel_osmium_leo_190
    .forgeEnergy(300)                              // RF/t
    .heat(70)                                      // H/t
    .criticality(90)                               // criticality
    .depletion(200)                                // seconds
    .efficiency(110)                               // efficiency
    .isotopes(190, 192)                            // isotope numbers
    .radioactive(true)
  event.create('iridium', 'hei-192')
    .energy(350)                                   // alias of .forgeEnergy()
    .heat(80)
    .recipeModifiers(1.5, 1.2, 1.0)                // time, power, radiation of the generated recipes
  event.create('test', 'tst-1')
    .noRecipes()                                   // write the fission reactor recipes yourself
  event.modify('uranium', 'leu-235', def => def.heat(55))   // change a built-in fuel
  event.remove('mixed', 'mix-241')                           // disable a built-in fuel
})

Fluids — 'fluids'

Fluids with NuclearCraft textures.

Method Description Default
.liquid() / .molten() / .gas() / .steam() Texture style .liquid()
.color(rgb) Tint -
.temperature(K) Temperature -
.noBucket() No bucket item (KubeJS option) bucket on
NuclearcraftEvents.registry('fluids', event => {
  event.create('molten_osmium').molten().color(0x8899AA)          // molten texture, tint
  event.create('radon').gas().color(0x88FF88).radioactive(true)   // gas texture
  event.create('hot_vapor').steam()                               // steam texture
  event.create('brine').liquid()                                  // plain liquid texture (default)
  event.create('heavy_brine').color(0x3366AA).temperature(290).noBucket()   // temperature in K, no bucket
})

Coolants / refrigerants — 'coolants'

Registers kubejs:<name> (cold) and kubejs:hot_<name> (hot) and the recipes for every option you set. With no recipe option at all you get fission boiling with heat 100.

Method Description Default
.fissionHeat(heatRequired) nuclearcraft:fission_boiling recipe (fission coolant) -
.fusionCooling(rate) nuclearcraft:fusion_coolant recipe -
.acceleratorHeat(heatPerMb[, minK]) nuclearcraft:accelerator_coolant recipe -
.heatExchanger(heat) nuclearcraft:heat_exchanger recipe (hot -> cold) -
.amount(mB) mB per operation 10
.color(rgb) / .hotColor(rgb) Cold / hot tint -
.displayName(name) English name generated
.coldFluid(idOrTag) Use an existing cold fluid instead of registering one registered
.hotFluid(id) Use an existing hot fluid (id, not a tag; checked at startup) registered
.cold(f => ...) / .hot(f => ...) Edit the cold / hot fluid builder (.gas(), .molten(), ...) -
NuclearcraftEvents.registry('coolants', event => {
  event.create('cryo_gel')
    .displayName('Cryo Gel')                       // English name
    .color(0x66CCFF)                               // cold tint
    .hotColor(0xFF7733)                            // hot tint
    .fissionHeat(150)                              // fission boiling recipe
    .fusionCooling(2000)                           // fusion coolant recipe
    .acceleratorHeat(600, 20)                      // accelerator coolant: heat per mB, min K
    .heatExchanger(120)                            // heat exchanger recipe (hot -> cold)
  event.create('lithium_coolant')
    .coldFluid('#c:molten_lithium')                // existing cold fluid (id or #tag)
    .displayName('Lithium Coolant')
    .hotColor(0xFF5522)
    .fissionHeat(300)
    .amount(20)                                    // mB per operation
  event.create('helium_mix')
    .hotFluid('nuclearcraft:hot_helium')           // existing hot fluid (id only)
    .fusionCooling(900)
})

NuclearcraftEvents.registry('refrigerants', event => {
  event.create('freon')
    .color(0xEEEEFF)
    .fusionCooling(1500)
    .cold(f => f.gas())                            // edit the cold fluid builder
    .hot(f => f.steam())                           // edit the hot fluid builder
})

Builder types for StartupEvents.registry

Item nuclearcraft:plate, nuclearcraft:rod, nuclearcraft:gear, nuclearcraft:radioactive; block nuclearcraft:cooler; fluid nuclearcraft:fluid.

StartupEvents.registry('item', event => {
  event.create('lead_plate_x', 'nuclearcraft:plate').material('lead')                  // plate type
  event.create('steel_rod_x', 'nuclearcraft:rod').material('steel')                    // rod type
  event.create('bronze_gear_x', 'nuclearcraft:gear').material('bronze')                // gear type
  event.create('uranium_chunk', 'nuclearcraft:radioactive').radiation('nr:u_238', 2e24) // radioactive type
})
StartupEvents.registry('block', event => {
  event.create('tin_cooler_x', 'nuclearcraft:cooler').cooling(120).rules('lapis_cooler>2')   // cooler type
})
StartupEvents.registry('fluid', event => {
  event.create('molten_lead_x', 'nuclearcraft:fluid').molten().color(0x404060)        // fluid type
})

Recipes (server)

Processors

event.recipes.nuclearcraft.<type>(outputs, inputs[, time[, energy]])

Types: alloy_smelter, analyzer, assembler, centrifuge, chemical_reactor, crystallizer, decay_hastener, electrolyzer, extractor, fluid_enricher, fluid_infuser, fuel_reprocessor, gas_scrubber, ingot_former, irradiator, isotope_separator, leacher, manufactory, melter, msr_controller, pressurizer, pump, rock_crusher, steam_turbine, subatomic_liquifier, supercooler.

outputs / inputs are one value or an array mixing items and fluids. NuclearCraft's 6-argument form also works: (itemInputs, fluidInputs, itemOutputs, fluidOutputs, time, energy).

Method Description Default
.time(ticks) Process time 200
.energy(rf) Energy per tick 50
.itemInputs(...) Replace the item inputs from arguments
.fluidInputs(...) (alias .fluid) Replace the fluid inputs from arguments
.itemOutputs(...) Replace the item outputs from arguments
.fluidOutputs(...) Replace the fluid outputs from arguments
.extraInput(item) / .extraFluid(fluid) Append one more item / fluid input -
.extraOutput(item) / .extraFluidOutput(fluid) Append one more item / fluid output -

Value formats: items 'minecraft:iron_ingot', '2x #c:dusts/copper', Item.of('minecraft:diamond', 2); fluids Fluid.of('minecraft:water', 250), fluid tags Fluid.sizedIngredientOf('#c:steam', 100).

// kubejs/server_scripts/nuclearcraft.js
ServerEvents.recipes(event => {
  event.recipes.nuclearcraft.alloy_smelter('4x minecraft:copper_ingot', ['3x #c:ingots/tin', 'minecraft:iron_ingot'])
    .time(300)                                     // ticks
    .energy(60)                                    // RF/t
  event.recipes.nuclearcraft.analyzer('minecraft:filled_map', 'minecraft:map', 1100, 500)          // time and energy as arguments
  event.recipes.nuclearcraft.assembler('nuclearcraft:basic_processor', ['#c:dusts/redstone', '2x #c:ingots/copper', 'minecraft:quartz'])
  event.recipes.nuclearcraft.centrifuge([Fluid.of('minecraft:water', 800), Fluid.of('nuclearcraft:oxygen', 200)], Fluid.of('nuclearcraft:heavy_water', 1000))   // fluids in and out
  event.recipes.nuclearcraft.chemical_reactor([Fluid.of('nuclearcraft:nitric_oxide', 750)], [Fluid.of('nuclearcraft:ammonia', 350), Fluid.of('nuclearcraft:oxygen', 650)])
  event.recipes.nuclearcraft.crystallizer('2x minecraft:redstone', Fluid.of('minecraft:lava', 500))
  event.recipes.nuclearcraft.decay_hastener('nuclearcraft:neptunium_237', 'nuclearcraft:americium_241')
  event.recipes.nuclearcraft.electrolyzer([Fluid.of('nuclearcraft:hydrogen', 500), Fluid.of('nuclearcraft:oxygen', 250)], Fluid.of('minecraft:water', 500))
  event.recipes.nuclearcraft.extractor(['nuclearcraft:cocoa_solids', Fluid.of('nuclearcraft:cocoa_butter', 90)], 'minecraft:cocoa_beans')   // item + fluid output
  event.recipes.nuclearcraft.fluid_enricher(Fluid.of('nuclearcraft:molten_baratol', 1000), ['#c:dusts/barium_nitrate', Fluid.of('nuclearcraft:molten_tnt', 200)])
  event.recipes.nuclearcraft.fluid_infuser('minecraft:wet_sponge', ['minecraft:sponge', Fluid.of('minecraft:water', 1000)])
  event.recipes.nuclearcraft.fuel_reprocessor(['3x nuclearcraft:uranium_238', 'nuclearcraft:plutonium_239'], 'nuclearcraft:depleted_fuel_uranium_leu_235')
  event.recipes.nuclearcraft.gas_scrubber(Fluid.of('nuclearcraft:irradiated_borax_solution', 250), Fluid.of('nuclearcraft:borax_solution', 250))
  event.recipes.nuclearcraft.ingot_former('minecraft:gold_ingot', Fluid.of('nuclearcraft:molten_gold', 90))
  event.recipes.nuclearcraft.irradiator('#c:dusts/polonium', '#c:dusts/bismuth')
  event.recipes.nuclearcraft.isotope_separator(['nuclearcraft:uranium_235', '8x nuclearcraft:uranium_238'], '9x #c:ingots/uranium')
  event.recipes.nuclearcraft.leacher(Fluid.of('nuclearcraft:aluminum_slurry', 1000), ['#c:ores/aluminum', Fluid.of('nuclearcraft:aqua_regia_acid', 250)])
  event.recipes.nuclearcraft.manufactory('4x minecraft:stick', '#minecraft:planks')
  event.recipes.nuclearcraft.melter(Fluid.of('nuclearcraft:molten_iron', 90), '#c:ingots/iron')
  event.recipes.nuclearcraft.msr_controller('nuclearcraft:depleted_fuel_uranium_leu_235_tr', 'nuclearcraft:fuel_uranium_leu_235_tr').energy(0)
  event.recipes.nuclearcraft.pressurizer('kubejs:osmium_plate', '#c:ingots/osmium')
  event.recipes.nuclearcraft.pump(Fluid.of('minecraft:water', 500), 'minecraft:bucket')
  event.recipes.nuclearcraft.rock_crusher(['#c:dusts/yttrium', '#c:dusts/hafnium'], '32x minecraft:amethyst_block')
  event.recipes.nuclearcraft.steam_turbine(Fluid.of('nuclearcraft:exhaust_steam', 100), Fluid.of('nuclearcraft:high_pressure_steam', 100))
  event.recipes.nuclearcraft.subatomic_liquifier(Fluid.of('nuclearcraft:subliquid_matter', 4050), '#c:storage_blocks/iron')
  event.recipes.nuclearcraft.supercooler(Fluid.of('nuclearcraft:condensate_water', 1000), Fluid.of('nuclearcraft:exhaust_steam', 1000))

  // inputs and outputs set later in the chain
  event.recipes.nuclearcraft.melter([], 'minecraft:obsidian')
    .fluidOutputs(Fluid.of('minecraft:lava', 250))           // replace the fluid outputs
    .extraOutput('minecraft:cobblestone')                    // append one item output
    .time(400)
  event.recipes.nuclearcraft.fluid_infuser([], [])
    .itemInputs('minecraft:dirt')                            // replace the item inputs
    .fluidInputs(Fluid.of('minecraft:water', 250))           // replace the fluid inputs (alias: .fluid())
    .itemOutputs('minecraft:mud')                            // replace the item outputs
    .extraInput('minecraft:clay_ball')                       // append one item input
    .extraFluid(Fluid.of('nuclearcraft:oxygen', 50))         // append one fluid input
    .extraFluidOutput(Fluid.of('minecraft:water', 50))       // append one fluid output

  // NuclearCraft's 6-argument form: itemInputs, fluidInputs, itemOutputs, fluidOutputs, time, energy
  event.recipes.nuclearcraft.alloy_smelter(['minecraft:iron_ingot', 'minecraft:coal'], [], ['nuclearcraft:steel_ingot'], [], 200, 50)
})

Fission reactor

event.recipes.nuclearcraft.fission_reactor(output, input)

Method Description Default
.time(ticks) Burn time 4800
.power(rf) / .energy(rf) RF per tick 240
.heat(h) Heat 50

Fission boiling (fission coolant)

event.recipes.nuclearcraft.fission_boiling(outputFluid, inputFluid)

Method Description Default
.heat(n) / .heatRequired(n) Heat required 100
event.recipes.nuclearcraft.fission_reactor('nuclearcraft:depleted_fuel_uranium_leu_235', 'nuclearcraft:fuel_uranium_leu_235')
  .time(4800)                                      // burn time
  .power(240)                                      // RF/t (alias: .energy())
  .heat(50)                                        // heat
event.recipes.nuclearcraft.fission_boiling(Fluid.of('nuclearcraft:hot_helium', 10), Fluid.of('nuclearcraft:helium', 10))
  .heat(400)                                       // heat required (alias: .heatRequired())

Fusion reactor

event.recipes.nuclearcraft.fusion_reactor([outputs], inputA, inputB) — inputs are fluids.

Method Description Default
.energy(n) Energy 100000
.temperature(K) Optimal temperature 1e9
.time(ticks) Process time 200

Fusion coolant

event.recipes.nuclearcraft.fusion_coolant(outputFluid, inputFluid)

Method Description Default
.cooling(rate) / .coolingRate(rate) Cooling rate 1000
event.recipes.nuclearcraft.fusion_reactor([Fluid.of('nuclearcraft:helium', 1000)], Fluid.of('nuclearcraft:deuterium', 1000), Fluid.of('nuclearcraft:tritium', 1000))
  .energy(352000)                                  // energy
  .temperature(6.4e8)                              // optimal temperature in K
  .time(200)                                       // process time
event.recipes.nuclearcraft.fusion_coolant(Fluid.of('nuclearcraft:nitrogen', 10), Fluid.of('nuclearcraft:liquid_nitrogen', 10))
  .cooling(1800)                                   // cooling rate (alias: .coolingRate())

Heat exchanger and turbine

event.recipes.nuclearcraft.heat_exchanger(outputFluid, inputFluid) — .heat(n), default 100. event.recipes.nuclearcraft.turbine(outputFluid, inputFluid) — .power(modifier) (alias .energy), default 1.0.

event.recipes.nuclearcraft.heat_exchanger(Fluid.of('minecraft:water', 10), Fluid.of('nuclearcraft:exhaust_steam', 10))
  .heat(100)                                       // heat
event.recipes.nuclearcraft.turbine(Fluid.of('nuclearcraft:low_pressure_steam', 10), Fluid.of('nuclearcraft:high_pressure_steam', 10))
  .power(1.2)                                      // power modifier (alias: .energy())

Nuclear blast (bomb conversions)

event.recipes.nuclearcraft.nuclear_blast(output, input) — .chance(0..1), default 1.

event.recipes.nuclearcraft.nuclear_blast('minecraft:diamond_block', '#c:storage_blocks/coal')
  .chance(0.25)                                    // 25 % of the blocks convert

Particle chambers

event.recipes.nuclearcraft.decay_chamber() event.recipes.nuclearcraft.target_chamber() or event.recipes.nuclearcraft.target_chamber(outputs, inputs) (items / fluids like the processors, plus the processor chains such as .itemInputs()) event.recipes.nuclearcraft.collision_chamber()

Method Description Default
.species(id[, amount]) Input particle. Decay/target: one input, repeating adds another accepted species; collision: one more input per call - (required)
.minEnergy(keV) / .maxEnergy(keV) / .minFocus(f) Apply to the last .species() -
.particle(id[, amount]) Output particle focus 1.0
.focus(f) / .particleEnergy(keV) Apply to the last .particle() -
.crossSection(f) Cross section 1.0
.releasedEnergy(keV) (alias .releasedEnergyKev) Released energy 0
.priority(n) Recipe priority 0
.orderedInputs(bool) Collision chamber: inputs must match in order false

A recipe without any .species() is reported as an error in the KubeJS server log.

event.recipes.nuclearcraft.decay_chamber()
  .species('nuclearcraft:pion_plus', 1).minFocus(1.0)              // input particle, min focus
  .particle('nuclearcraft:antimuon', 1).focus(1.0)                 // output particle, its focus
  .particle('nuclearcraft:muon_neutrino', 1).particleEnergy(500)   // output particle energy in keV
  .crossSection(0.99)                                              // cross section
  .releasedEnergy(34000)                                           // released keV (alias: .releasedEnergyKev())

event.recipes.nuclearcraft.target_chamber('minecraft:gold_ingot', '#c:ingots/lead')   // item output, item input
  .species('nuclearcraft:proton', 1000000).minEnergy(1000).maxEnergy(20000).minFocus(1.0)   // energy window of the input
  .particle('nuclearcraft:neutron', 1).focus(1.0)
  .crossSection(0.3)
  .releasedEnergy(500)

event.recipes.nuclearcraft.target_chamber()
  .itemInputs('#c:ingots/aluminum')                                // processor chains work here too
  .itemOutputs('nuclearcraft:silicon_gem')
  .species('nuclearcraft:alpha', 2500000).minEnergy(12000).maxEnergy(17500).minFocus(1.0)
  .particle('nuclearcraft:positron', 1)
  .particle('nuclearcraft:neutron', 1)
  .crossSection(0.4)
  .releasedEnergy(568)
  .priority(1)                                                     // recipe priority

event.recipes.nuclearcraft.collision_chamber()
  .species('nuclearcraft:proton', 1).minEnergy(1000).maxEnergy(10000).minFocus(1.0)    // first colliding particle
  .species('nuclearcraft:neutron', 1).minEnergy(1000).maxEnergy(10000).minFocus(1.0)   // second colliding particle
  .particle('nuclearcraft:deuteron', 1).focus(1.0)
  .particle('nuclearcraft:photon', 1)
  .crossSection(0.5)
  .releasedEnergy(2200)
  .orderedInputs(false)                                            // inputs may match in any order

Accelerator coolant

event.recipes.nuclearcraft.accelerator_coolant(outputFluid, inputFluid)

Method Description Default
.heat(n) / .heatPerMb(n) Heat per mB 1000
.minTemperature(K) / .minimumTemperature(K) Minimum temperature none

Kugelblitz chamber

event.recipes.nuclearcraft.kugelblitz_chamber(output, input)

Method Description Default
.timeModifier(f) (alias .time) Time modifier 1.0
.powerModifier(f) (alias .power) Power modifier 1.0
event.recipes.nuclearcraft.accelerator_coolant(Fluid.of('nuclearcraft:nitrogen', 1), Fluid.of('nuclearcraft:liquid_nitrogen', 1))
  .heat(800)                                       // heat per mB (alias: .heatPerMb())
  .minTemperature(77)                              // minimum K (alias: .minimumTemperature())
event.recipes.nuclearcraft.kugelblitz_chamber('minecraft:ender_eye', 'minecraft:ender_pearl')
  .timeModifier(2.0)                               // time modifier (alias: .time())
  .powerModifier(1.5)                              // power modifier (alias: .power())

Smelting, blasting and removal

NuclearCraft's smelting and blasting recipes are plain vanilla recipes: use event.smelting(...) / event.blasting(...). Removing recipes works as usual:

event.smelting('nuclearcraft:lead_ingot', '#c:dusts/lead')     // vanilla furnace
event.blasting('nuclearcraft:lead_ingot', '#c:dusts/lead')     // vanilla blast furnace
event.remove({ type: 'nuclearcraft:rock_crusher' })            // remove every rock crusher recipe


The Twilight Forest integration

Adds recipe schemas for every Twilight Forest recipe type (uncrafting, drying rack, no-template smithing, scepter repair, Traveller's gear modifiers and the special crafting recipes), a recipe that changes the portal activator, and events to edit the mod's data maps (Crumble Horn, Transformation Powder, Ominous Fire, ore and magic map colours).

Required mods: The Twilight Forest (KubeJS Infinity Extras loads this only when Twilight Forest is installed)

Part Script folder
event.recipes.twilightforest.* (including the portal activator) server_scripts
TwilightForestEvents.* (data maps) server_scripts
Optional JEI information page for the activator client_scripts

Nothing goes in startup_scripts: everything reloads with /reload.

Value formats

  • Item input: 'minecraft:arrow', '#c:gems/emerald'
  • Item output: 'twilightforest:beef_jerky', '2x minecraft:leather', Item.of('minecraft:leather', 2)
  • Block / mob: 'minecraft:stone', '#minecraft:logs', 'minecraft:pig', '#minecraft:skeletons'

Portal activator

event.recipes.twilightforest.portal_activator(itemOrTag)

By default the portal is lit by throwing a diamond (#c:gems/diamond) into a 2x2 (or larger) water pool surrounded by flowers. This recipe replaces the activator (it rebinds the item tag twilightforest:portal/activator after the data load). Several calls add up.

Method Description Default
.keepDefault() Keeps the current activators (diamonds) and adds this one replaces them
ServerEvents.recipes(event => {
  event.recipes.twilightforest.portal_activator('minecraft:emerald')                  // emeralds replace diamonds
  event.recipes.twilightforest.portal_activator('#c:gems/amethyst').keepDefault()    // adds amethyst, keeps the current activators
})

You can also edit the tag twilightforest:portal/activator with ServerEvents.tags('item', ...). Use one way or the other: portal_activator() wins because it is applied last.

Uncrafting table

event.recipes.twilightforest.uncrafting(pattern, key, input[, cost]) — what the Uncrafting Table gives back (pattern + key) for input. The item does not need a crafting recipe. Shown in Twilight Forest's "Uncrafting" JEI category.

Method Description Default
.inputCount(n) / .count(n) Items needed 1
.cost(n) / .xp(n) XP levels; -1 lets the table compute it -1
event.recipes.twilightforest.uncrafting(['AAA', 'A A', 'AAA'], { A: 'minecraft:arrow' }, 'minecraft:tipped_arrow')
  .inputCount(8)   // 8 tipped arrows are needed (alias: .count())
  .cost(4)         // 4 XP levels (alias: .xp())
event.recipes.twilightforest.uncrafting(['GGG', 'GAG', 'GGG'], { G: 'minecraft:gold_block', A: 'minecraft:apple' }, 'minecraft:enchanted_golden_apple', 10) // cost as 4th argument

Uncrafting is also controlled with the item tags twilightforest:banned_uncraftables, twilightforest:banned_uncrafting_ingredients and twilightforest:uncrafting_ignores_cost.

Drying rack

event.recipes.twilightforest.drying(result, input[, dryingTime])

Method Description Default
.dryingTime(ticks) / .filterTime(ticks) / .time(ticks) Drying time 6000 (5 minutes)
event.recipes.twilightforest.drying('minecraft:leather', 'minecraft:rotten_flesh')            // default 6000 ticks
event.recipes.twilightforest.drying('2x minecraft:dried_kelp', 'minecraft:kelp', 1200)       // drying time as 3rd argument
event.recipes.twilightforest.drying('twilightforest:arctic_fur', '#minecraft:wool')
  .dryingTime(2400)   // drying ticks (aliases: .filterTime(), .time())

Smithing without a template

event.recipes.twilightforest.no_template_smithing(base, addition) — the result is the base item with extra data components (this is how Emperor's Cloth works). The base must not already have those components.

Method Description Default
.component(type[, value]) Adds one data component (repeatable; no value = empty component) —
event.recipes.twilightforest.no_template_smithing('#minecraft:swords', 'minecraft:nether_star')
  .component('minecraft:enchantment_glint_override', true)  // component with a value
  .component('minecraft:rarity', 'epic')                    // another component
event.recipes.twilightforest.no_template_smithing('#c:armors', 'twilightforest:emperors_cloth')
  .component('twilightforest:emperors_cloth')               // empty component (no value)
event.recipes.twilightforest.no_template_smithing('#minecraft:pickaxes', 'minecraft:heart_of_the_sea')
  .additionalData({ 'minecraft:rarity': 'rare' })           // whole component map at once: raw JSON is the only form this method accepts
Method Description Default
.additionalData(json) Sets the whole component map at once (raw JSON only) —

Scepter repair (crafting table)

event.recipes.twilightforest.scepter_repair(scepter, repairIngredients, durability)

  • One repair ingredient: any number of them next to the scepter, each repairs durability.
  • Several ingredients: all of them once (shapeless), repairing durability in total.
Method Description Default
.addRepairIngredient(item) Adds one more repair ingredient —
.category(name) Recipe book category: misc, building, redstone, equipment misc
.equipmentCategory() / .buildingCategory() / .redstoneCategory() Category shortcuts —
event.recipes.twilightforest.scepter_repair('twilightforest:lifedrain_scepter', 'minecraft:fermented_spider_eye', 20) // each eye repairs 20
  .category('misc')                         // recipe book category by name
event.recipes.twilightforest.scepter_repair('twilightforest:twilight_scepter', ['twilightforest:torchberries', 'minecraft:ender_pearl'], 50)
  .addRepairIngredient('#c:gems/diamond')   // one more shapeless ingredient
  .equipmentCategory()                      // category: equipment
event.recipes.twilightforest.scepter_repair('twilightforest:zombie_scepter', 'minecraft:rotten_flesh', 10)
  .buildingCategory()                       // category: building
event.recipes.twilightforest.scepter_repair('twilightforest:fortification_scepter', 'minecraft:shulker_shell', 5)
  .redstoneCategory()                       // category: redstone

Traveller's gear modifiers

The pattern or ingredients must contain the Traveller's item (boots, vest, goggles...) that gets the modifier. Modifier ids come from the data pack registry twilightforest:travellers_modifiers (twilightforest:auto_repair, double_jump, high_jump, step_up, water_walk, swift_swim, stealth, haste, zoom, ...).

Shaped

event.recipes.twilightforest.travellers_gear_modifier_shaped_recipe(modifier, pattern, key)

Method Description Default
.rotated() / .isRotated(bool) Marks a rotated copy of another recipe for the same modifier false

Shapeless

event.recipes.twilightforest.travellers_gear_modifier_shapeless_recipe(modifier, ingredients)

Method Description Default
.addIngredient(item) Adds one more ingredient —
event.recipes.twilightforest.travellers_gear_modifier_shaped_recipe('twilightforest:auto_repair', [' E ', 'ITI', ' E '], {
  E: 'minecraft:experience_bottle',
  I: 'twilightforest:ironwood_ingot',
  T: 'twilightforest:travellers_boots'
})
event.recipes.twilightforest.travellers_gear_modifier_shaped_recipe('twilightforest:auto_repair', ['IEI', ' T ', 'IEI'], {
  E: 'minecraft:experience_bottle',
  I: 'twilightforest:ironwood_ingot',
  T: 'twilightforest:travellers_boots'
}).rotated()                 // rotated copy of the recipe above
event.recipes.twilightforest.travellers_gear_modifier_shaped_recipe('twilightforest:step_up', ['F', 'T'], {
  F: 'minecraft:feather',
  T: 'twilightforest:travellers_boots'
}).isRotated(false)          // explicit flag form of .rotated()

event.recipes.twilightforest.travellers_gear_modifier_shapeless_recipe('twilightforest:swift_swim', [
  'twilightforest:travellers_vest',
  'minecraft:prismarine_crystals',
  'minecraft:nautilus_shell'
]).addIngredient('twilightforest:naga_scale')   // one more ingredient

Special crafting recipes

Hard-coded recipes with no arguments: casket_repair_recipe, emperors_cloth_recipe, essence_repair_recipe, magic_map_cloning_recipe, maze_map_cloning_recipe, moonworm_queen_repair_recipe, travellers_vest_gloves_merge_recipe. Useful to bring one back after removing it. They accept .category(...) and the category shortcuts.

event.remove({ type: 'twilightforest:magic_map_cloning_recipe' })
event.recipes.twilightforest.magic_map_cloning_recipe().id('kubejs:magic_map_cloning')  // brings magic map cloning back
event.recipes.twilightforest.maze_map_cloning_recipe()                                  // maze map cloning
event.recipes.twilightforest.casket_repair_recipe().equipmentCategory()                 // keepsake casket repair
event.recipes.twilightforest.emperors_cloth_recipe()                                    // emperor's cloth application
event.recipes.twilightforest.essence_repair_recipe()                                    // repair with essence
event.recipes.twilightforest.moonworm_queen_repair_recipe()                             // moonworm queen repair
event.recipes.twilightforest.travellers_vest_gloves_merge_recipe().category('equipment') // vest + gloves merge

event.remove({ type: 'twilightforest:drying', output: 'twilightforest:monster_jerky' })
event.remove('twilightforest:uncrafting/written_book')

Data maps (TwilightForestEvents)

Server events that edit the mod's data maps (what its Crumble Horn, Transformation Powder and Ominous Fire JEI categories show). Entries merge into the mod's defaults: add() overrides an entry, remove(idOrTag) deletes one (defaults too). Ids or tags ('#...') go on the left.

Event add signature Notes
crumbleHorn add(block, result[, chance]) chance 0-1, default 0.2; result 'minecraft:air' breaks the block
transformationPowder add(mob, result), addReversible(a, b) addReversible adds both directions
ominousFire add(mob, result) Exanimate Essence on a mob
oreMapColor add(block, color) color = map colour id (1-63) or a block whose map colour is used
magicMapColor add(biome, color[, brightness]) brightness 0-3, default 1
// server_scripts
TwilightForestEvents.crumbleHorn(event => {
  event.add('minecraft:stone_bricks', 'minecraft:cracked_stone_bricks', 0.3)  // 30% chance to crack
  event.add('#minecraft:planks', 'minecraft:air', 0.05)                      // air = breaks the block
  event.add('minecraft:sandstone', 'minecraft:sand')                         // default chance 0.2
  event.remove('minecraft:cobblestone')                                      // removes a default entry
})

TwilightForestEvents.transformationPowder(event => {
  event.add('minecraft:sheep', 'twilightforest:bighorn_sheep')               // one direction
  event.addReversible('minecraft:rabbit', 'twilightforest:dwarf_rabbit')     // both directions
  event.remove('minecraft:bat')
})

TwilightForestEvents.ominousFire(event => {
  event.add('minecraft:zombie', 'minecraft:husk')                            // Exanimate Essence turns zombies into husks
  event.remove('minecraft:villager')
})

TwilightForestEvents.oreMapColor(event => {
  event.add('#c:ores/tin', 'minecraft:light_gray_wool')                      // colour taken from a block
  event.add('#c:ores/silver', 22)                                            // map colour id
  event.remove('#minecraft:coal_ores')
})

TwilightForestEvents.magicMapColor(event => {
  event.add('twilightforest:enchanted_forest', 'minecraft:purple_wool', 2)   // brightness 2
  event.add('twilightforest:clearing', 'minecraft:lime_wool')                // brightness 1
  event.remove('twilightforest:dark_forest')                                 // removes a default entry
})

JEI information page (optional)

Twilight Forest has no JEI page for the portal. This plain KubeJS snippet adds one to whatever the activator is (it reads the tag, so it follows portal_activator()):

// client_scripts
RecipeViewerEvents.addInformation('item', event => {
  event.add('#twilightforest:portal/activator', [ // info page on every activator item
    'Throw this item into a 2x2 (or larger) pool of water surrounded by flowers or other small plants to open a portal to the Twilight Forest.'
  ])
})


Vanilla: trades and Nether portal

Two vanilla features that need no other mod: villager and wandering trader trades (add and remove, per profession or all in one event), and changing what lights the Nether portal.

Required mods: none besides KubeJS Infinity Extras

Part Script folder
TradeEvents.villager / TradeEvents.wanderer server_scripts
PortalEvents.nether startup_scripts

Trades

NeoForge rebuilds the trade tables on every server data load (world start and /reload) and these events run while that happens, so /reload applies changes without duplicating trades. Villagers keep the offers they already rolled; new levels and new villagers / wandering traders use the new tables.

Levels: 1 novice, 2 apprentice, 3 journeyman, 4 expert, 5 master. Prices and outputs are item stacks ('2x minecraft:emerald'). Removal filters accept an id, a '#tag' or a /regex/.

Every trade in one event

TradeEvents.villager('villager', event => event.add(level, price, output)) — each trade says who sells it. Without .profession() every profession sells it.

One profession

TradeEvents.villager(professionId, event => { ... }) — works with any registered profession, including modded ones and ones made with StartupEvents.registry('villager_profession', ...).

Call Description
event.add(level, price, output) Adds a trade (returns the trade builder)
event.removeAll([level]) Removes every trade, or every trade of one level
event.removeByOutput([level,] filter) Removes trades selling a matching item (every level, or one level)
event.removeByInput(filter) Removes trades asking for a matching item in either input slot
event.count(level) Number of trades in a level, including script ones
event.profession / event.professionType Profession id / object

Wandering trader

TradeEvents.wanderer(event => { ... }) — each trader offers 5 random generic trades and 1 random rare trade.

Call Description
event.add(price, output) Adds a generic trade (.rare() for the rare pool)
event.removeAll() Removes every generic and rare trade
event.removeAllGeneric() / event.removeAllRare() Removes one pool
event.removeByOutput(filter) / event.removeByInput(filter) Removes matching trades

Trade builder

Method Description Default
.secondInput(item) Second item the player gives none
.maxUses(n) Uses before restocking 12
.xp(n) Villager XP per use 1
.priceMultiplier(f) Demand / reputation price effect (vanilla uses 0.05 or 0.2) 0.05
.profession(...ids) Professions that sell it ('villager' event only) every profession
.wanderingTrader(bool) Only wandering traders sell it (level and profession ignored) false
.rare() Wandering trader rare pool generic pool
// server_scripts
TradeEvents.villager('villager', event => {
  event.add(2, '2x minecraft:emerald', 'minecraft:golden_carrot')  // level, price, output
    .secondInput('minecraft:carrot')     // second item the player gives
    .maxUses(12)                         // uses before restocking
    .xp(5)                               // villager XP per use
    .priceMultiplier(0.05)               // demand / reputation price effect
    .profession('minecraft:farmer')      // only farmers

  event.add(3, '8x minecraft:emerald', 'minecraft:name_tag')
    .profession('minecraft:librarian', 'minecraft:cartographer') // several professions

  event.add(5, '64x minecraft:emerald', 'minecraft:nether_star')  // no .profession(): every profession
    .maxUses(1)
    .xp(30)

  event.add(1, '5x minecraft:emerald', 'minecraft:diamond')
    .maxUses(3)
    .wanderingTrader(true)               // only wandering traders
    .rare()                              // rare pool

  event.add(1, 'minecraft:emerald', '4x minecraft:glow_berries')
    .wanderingTrader(true)               // generic wandering trader pool
})

TradeEvents.villager('minecraft:farmer', event => {
  event.add(1, 'minecraft:wheat_seeds', '3x minecraft:bone_meal')  // new novice trade
  event.removeByOutput('minecraft:bread')       // trades selling bread, every level
  event.removeByOutput(3, '#c:crops')           // trades selling crops, level 3 only
  event.removeByInput('minecraft:pumpkin')      // trades asking for pumpkins
  console.info(`${event.profession} level 1 has ${event.count(1)} trades (${event.professionType})`) // id, count, profession object
})

TradeEvents.villager('minecraft:librarian', event => {
  event.removeAll(1)                            // clears level 1
  event.add(1, '10x minecraft:emerald', 'minecraft:book')
})

TradeEvents.villager('minecraft:nitwit', event => {
  event.removeAll()                             // clears every level
})

TradeEvents.wanderer(event => {
  event.add('3x minecraft:emerald', 'minecraft:sponge')            // generic trade
  event.add('20x minecraft:emerald', 'minecraft:trident').rare()  // rare trade
  event.removeByOutput('minecraft:blue_ice')    // trades selling blue ice
  event.removeByInput('minecraft:tropical_fish') // trades asking for tropical fish
  event.removeAllGeneric()                      // every generic trade
})

TradeEvents.wanderer(event => {
  event.removeAllRare()                         // every rare trade
})

TradeEvents.wanderer(event => {
  event.removeAll()                             // every generic and rare trade
})

Nether portal activator

PortalEvents.nether(event => { ... }) — runs on the client and the server so both agree on what lights the portal. Reload with /kubejs reload startup_scripts. The frame stays obsidian (or any block NeoForge treats as a portal frame); only the way it is lit changes.

Method Description Default
event.activator(filter) Item that lights an empty frame when used on a block inside it: id, '#tag' or /regex/. Call again for more none
.consume(bool) Takes one activator item (never in creative) true
.damage(n) Damageable activators lose durability instead of being consumed; 0 turns it off 0
.sound(id[, volume, pitch]) Sound when lit minecraft:block.portal.trigger
.noSound() Lights silently —
.requireSneaking(bool) Only while sneaking false
.dimensions(...ids) Dimensions where activators work overworld + nether
.disableFire() Fire (flint and steel, fire charges) no longer lights portals fire works
.fire(bool) Whether fire still lights portals true

event.disableFire() alone means Nether portals can no longer be lit at all.

// startup_scripts
PortalEvents.nether(event => {
  event.activator('minecraft:blaze_rod')                 // use it on a block inside an empty frame
    .activator('#c:rods/blaze')                          // more activators
    .consume(true)                                       // takes one item (never in creative)
    .sound('minecraft:block.portal.trigger', 0.5, 1.0)   // sound, volume, pitch
    .disableFire()                                       // fire no longer lights portals
})
// startup_scripts - flint and steel that only works while sneaking, in three dimensions
PortalEvents.nether(event => {
  event.activator('minecraft:flint_and_steel')
    .damage(1)                                           // loses 1 durability instead of being consumed
    .requireSneaking(true)                               // only while sneaking
    .dimensions('minecraft:overworld', 'minecraft:the_nether', 'mymod:my_dimension') // where it works
    .fire(true)                                          // fire keeps working too
    .sound('minecraft:item.flintandsteel.use')           // sound id only
})
// startup_scripts - silent lighting with an ender eye
PortalEvents.nether(event => {
  event.activator('minecraft:ender_eye')
    .noSound()                                           // lights silently
})


XyCraft integration

Recipes for the two XyCraft Machines blocks that actually use recipes: the Extractor (a block it is attached to produces items or fluids, with optional catalyst, adjacent blocks/fluids and valid sides) and the Isolator (a block produces Xynergy).

Required mods: XyCraft Machines (with XyCraft Core / World). KubeJS Infinity Extras loads this only when XyCraft Machines is installed.

Part Script folder
event.recipes.xycraft_machines.extractor / isolator server_scripts

There are no startup scripts for XyCraft. XyCraft World / Override / Core only ship vanilla crafting, stonecutting and smelting recipes; use event.shaped, event.stonecutting, ... for those.

Value formats

Kind Examples
item 'minecraft:cobblestone', '#c:cobblestones', '2x minecraft:sand'
fluid Fluid.of('minecraft:water', 100)
block rule 'minecraft:stone' (exact block), '#minecraft:logs' (block tag), 'minecraft:furnace[lit=true]' (block with these properties, others ignored)
direction down, up, north, south, west, east

Extractor

event.recipes.xycraft_machines.extractor(output, targetRule) — output is an item or Fluid.of(...); the target is the block the Extractor is attached to.

Method Description Default
.ticks(n) (aliases .time, .duration) Ticks per operation 30
.adjacent(rule) A block next to the target must match (repeatable; each rule needs its own block) none
.adjacentFluid(fluid) Same for a fluid: 'minecraft:water', '#c:water', Fluid.of(...) (repeatable) none
.adjacentProperty(name, value) Any block next to the target with that property value (repeatable) none
.adjacentState(state) Exact block state next to the target (repeatable) none
.catalyst(rule) The Extractor's catalyst block must match none
.catalystFluid(fluid) Same for a fluid none
.catalystProperty(name, value) Catalyst block must have that property value none
.catalystState(state) Exact catalyst block state none
.targetState(state) Exact target block state (every property) rule from the 2nd argument
.waterloggedFluid(id) (alias .waterlogged) Fluid the Extractor must be waterlogged with none
.validDirection(dir) A side it may be attached on (repeatable) all sides
.validDirections([dirs]) (alias .directions) Replace the whole side list all sides
.hidden() / .hidden(bool) Hide the recipe from JEI/EMI false

A plain 'block[prop=value]' string only checks the listed properties; the *State methods match the exact state.

// kubejs/server_scripts/xycraft.js
ServerEvents.recipes(event => {
  event.recipes.xycraft_machines.extractor('minecraft:amethyst_shard', 'minecraft:budding_amethyst')   // output, target block
    .adjacentFluid('minecraft:water')                  // water must touch the target
    .ticks(1200)                                       // ticks per operation

  event.recipes.xycraft_machines.extractor('minecraft:chorus_fruit', 'minecraft:end_stone')
    .catalyst('#xycraft:chorus_stem')                  // catalyst block rule
    .validDirection('up')                              // allowed side (repeatable)
    .duration(200)                                     // alias of .ticks() (also .time())

  event.recipes.xycraft_machines.extractor('minecraft:cobblestone', 'minecraft:stone')
    .adjacentFluid('#c:lava')                          // fluid tag next to the target
    .adjacentFluid('#c:water')                         // a second adjacent rule (each needs its own block)
    .adjacent('minecraft:furnace[lit=true]')           // adjacent block rule
    .validDirections(['north', 'south', 'east', 'west'])   // replace the side list

  event.recipes.xycraft_machines.extractor(Fluid.of('minecraft:water', 50), '#minecraft:leaves')   // fluid output
    .catalystFluid('minecraft:water')                  // catalyst is a fluid
    .waterloggedFluid('minecraft:water')               // Extractor must be waterlogged with water
    .hidden()                                          // hide from JEI/EMI
    .time(30)                                          // alias of .ticks()

  event.recipes.xycraft_machines.extractor('minecraft:glowstone_dust', 'minecraft:redstone_lamp')
    .targetState('minecraft:redstone_lamp[lit=true]')  // exact target state
    .adjacentProperty('powered', 'true')               // any powered block next to it

  event.recipes.xycraft_machines.extractor('minecraft:blaze_powder', 'minecraft:netherrack')
    .adjacentState('minecraft:furnace[facing=north,lit=true]')   // exact adjacent state, every property
    .catalystProperty('lit', 'true')                   // any lit catalyst block
    .waterlogged('minecraft:lava')                     // alias of .waterloggedFluid()
    .directions(['up', 'down'])                        // alias of .validDirections()
    .hidden(false)                                     // shown in JEI/EMI (explicit)

  event.recipes.xycraft_machines.extractor('minecraft:redstone', 'minecraft:stone')
    .catalystState('minecraft:redstone_lamp[lit=true]')  // exact catalyst state
})

Isolator

event.recipes.xycraft_machines.isolator(xynergy, targetRule) — Xynergy produced by isolating the block.

Method Description Default
.xynergy(n) / .energy(n) Change the Xynergy output 1st argument
ServerEvents.recipes(event => {
  event.recipes.xycraft_machines.isolator(5000, 'minecraft:magma_block')          // 5000 Xynergy from magma
  event.recipes.xycraft_machines.isolator(1000, '#c:storage_blocks/redstone')
    .xynergy(20000)                                                               // change the Xynergy output
  event.recipes.xycraft_machines.isolator(1000, 'minecraft:glowstone')
    .energy(8000)                                                                 // alias of .xynergy()
})


Requirements

Every other mod listed above is optional.

License

All Rights Reserved

Clone this wiki locally