KubeJS Create Automation

Quick rating

Community listing page, reviews here may not be monitored by the author.

KubeJS Create Automation

By vomiterOwner

No reviews yet

An automation hook mod that bridges Create machines with KubeJS, allowing pack makers to intercept and customize automated actions through scripts.

API/Library
Mod Loaders
Forge
NeoForge
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Where It Runs
Client and Server

Must be installed on both the client and the server.

About

Project Details

Type
Mod
License
MIT License
Latest Version
kjscauto-0.9.0-beta-neoforge.jar

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

About

Description

KubeJS Hooks for Create Automation

KJSCAuto allows KubeJS scripts to modify key automation behaviors in Create.

This mod exposes several Create actions as script events so pack makers can intercept and modify them without writing Java mods.

Recipe modification is intentionally not included, as that functionality is already provided by KubeJS Create.

Currently supported hooks include:

  • Deployer item/tool usage
  • Basin recipe operations
  • Block breaking by drills and saws
  • Contraption disassembly
  • Mechanical Arm collect/deposit
  • Custom fan processing type regitration

These events allow scripts to:

  • adjust tool durability usage on Deployer
  • modify Basin recipe inputs and outputs
  • intercept or replace block drops when destroyed by machines or contraptions

These hooks were selected to address several common automation control issues I often see discussed in the KubeJS community. If you feel there are other Create behaviors that would benefit from script hooks, feel free to suggest them in the discussion forum.

For more example scripts, check the wiki.

Support

If you'd like to support my modding work, including maintenance, updates, and compatibility work, Patreon is available here: https://patreon.com/vomiter_scp

KubeJS Hooks for Create Automation

KJSCAuto allows KubeJS scripts to modify key automation behaviors in Create.

This mod exposes several Create actions as script events so pack makers can intercept and modify them without writing Java mods.

Recipe modification is intentionally not included, as that functionality is already provided by KubeJS Create.

Currently supported hooks include:

  • Deployer item/tool usage
  • Basin recipe operations
  • Block breaking by drills and saws
  • Contraption disassembly

These events allow scripts to:

  • adjust tool durability usage on Deployer
  • modify Basin recipe inputs and outputs
  • intercept or replace block drops when destroyed by machines or contraptions

These hooks were selected to address several common automation control issues I often see discussed in the KubeJS community.

If you feel there are other Create behaviors that would benefit from script hooks, feel free to suggest them in the discussion forum.

Several breaking changes are introduced in 1.21.1, so the following example would not work well in that version. Check the wiki for 1.21.1 example.

Example Script: (All goes into server script.)

Deploying tool without consuming durability.

When a diamond block is placed beneath the belt/depot, the Deployer gains a special effect: sandpaper no longer loses durability, and the sanding result turns into a diamond.

KJSCAutoEvents.deployerUse(event => {
    var {block, outputs, heldItem} = event
    if(heldItem != "create:sand_paper") return //only works for sand paper
    if(!block.offset(0, -3, 0).blockState.is(Blocks.DIAMOND_BLOCK)) return; //only works when the belt/deposit (y = -2) has a diamond block below.
    event.setDamage(0) //set the durability usage to 0
    while(outputs.length > 0) outputs.remove(0) //remove all original outputs
    outputs.add(0, Item.of("diamond")) //add diamond
})

Mixing wool and red dye while not consuming the dye

This is to enable some "catalyst" recipe.

Technical note: In Create’s Basin, outputs are kept separate from the input/ingredient inventory, so an item returned as an output will not be treated as an ingredient for the next operation.

KJSCAutoEvents.basinOperation(event => {
    var {basin, block, fluidOutputs, heatLevel, outputs, recipe} = event;
    if(recipe.getId().toString() == "minecraft:dye_red_wool"){
        event.addInput("red_dye")
    }
})

Conditional Silk Touch for Drills

Drills can gain a Silk Touch-like effect when a certain condition is met. If an amethyst block is placed beneath the ore, the drill will drop the ore block itself instead of the normal drops.

//This works for stationary drill.
KJSCAutoEvents.blockDestroy(event => {
    const { level, targetPos, targetBlock } = event
    const below = level.getBlockState(targetPos.below())
    if (!below.is("minecraft:amethyst_block")) return
    if (!(targetBlock.blockState.is("minecraft:diamond_ore") || targetBlock.blockState.is("minecraft:emerald_ore")))return
    targetBlock.popItem(targetBlock.blockState.block.asItem())
    level.destroyBlock(targetPos, false)
    event.cancel()
})

//This works for drill on contraption.
ContraptionEvents.afterBlockDestroy(event => {
    const { level, targetPos, targetBlock, drops } = event
    const below = level.getBlockState(targetPos.below())
    if (!below.is("minecraft:amethyst_block")) return
    if (!(targetBlock.blockState.is("minecraft:diamond_ore") || targetBlock.blockState.is("minecraft:emerald_ore")))return
    while(drops.length > 0) { drops.remove(0) }
    drops.add(Item.of(targetBlock.blockState.block.asItem()))

})

Protective Ground for Contraptions

Blocks placed on soul soil cannot be broken contraption machines.

ContraptionEvents.beforeBlockDestroy(event => {
    const { level, targetPos } = event
    const below = level.getBlockState(targetPos.below())

    if (!below.is("minecraft:soul_soil")) return

    event.cancel() // prevent the contraption from breaking the block
})

Cancel Disassembly

Prevent contraption disassembly when a sea lantern is in the disassembly range.

ContraptionEvents.beforeDisassemble(event => {
    console.log("disassemble")
    let shouldCancel = event.testTargetBlock(block => {
        return block == "minecraft:sea_lantern"
    })
    if(shouldCancel) event.cancel()
})

Support

If you'd like to support my modding work, including maintenance, updates, and compatibility work, Patreon is available here: https://patreon.com/vomiter_scp

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~10,000
Total Downloads
CurseForge
~8,000
Modrinth
~1,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works