Download KubeJS Roots — Minecraft Mods — MetaMods

KubeJS Roots

Active

Downloads

1

Last update

1 year ago
Client
Magic
Utils

KubeJS Roots

This mod provides integration capabilities for the Roots Classic modification in Minecraft version 1.21 using KubeJS. You gain complete control over creating recipes, rituals, spells, and mutations, opening endless possibilities for gameplay customization.

Recipe Configuration

Using simple JavaScript code, you can create various types of recipes for Roots Classic:

ServerEvents.recipes(event => {
    let { rootsclassic } = event.recipes

    // Creating a ritual recipe for the growth ritual
    rootsclassic.ritual('rootsclassic:grow',
        ['bone_meal', 'apple'], // Input ingredients
        ['bone', 'porkchop'],   // Items to burn as incense
        0, '#aabbcc'              // Altar level and color
    )

    // Creating a mortar recipe
    rootsclassic.component(
        'minecraft:tnt',        // Output item
        ['gunpowder', 'gunpowder', 
        'gunpowder', 'gunpowder'],// Input ingredients
    )

    // and a spell powder recipe
    rootsclassic.component(
        'rootsclassic:spell_powder',  // Spell powder item to record effect data
        ["oak_button", "oak_button", 
        "oak_button", "oak_button"],// Input ingredients
        'kubejs:boom',                  // Spell to apply to the powder
        true                            // Must be true for spell recipes
    )
})

Creating Custom Rituals

Develop unique rituals with individual effects:

StartupEvents.registry('rootsclassic:ritual', event => {
    event.create('big_boom')
        // Effect that will run when the ritual is completed
        .ritualEffect(context => {
            let { level, pos } = context;
            level.createExplosion(pos.x, pos.y, pos.z)
                .strength(8)
                .explosionMode('tnt')
                .causesFire(true)
                .explode()
        })
})

The ritual execution process on the altar consists of two stages: first, the progress time countdown begins (think of it as a cooldown or processing time), then the ritual effect is triggered.

Spell Development

StartupEvents.registry('rootsclassic:component', event => {
    event.create('boom')
        .sourceItem('acacia_boat')
        .manaCost(8)                // 2 leaves in the bar
        .spellEffect(context => {   // Effect that will run when the spell is cast
            let { caster, level } = context
            level.createExplosion(caster.x, caster.y, caster.z)
                .strength(4)
                .causesFire(true)
                .explode()
        })
})

Mutation Configuration

RootsEvents.mutagen(event => {
    // Mutating a dandelion into a TNT block
    event.add('kubejs:test', "minecraft:tnt", "minecraft:dandelion", builder => {
        // Additional items to throw near the dandelion
        builder.inputs('acacia_button')
        // Effect that will run if the mutation is successful
        builder.onCrafted((block, player) => player.potionEffects.add('regeneration', 1000, 0))
        // Additional conditions for successful mutation
        builder.matches((items, block, player) => player.xpLevel > 10)
    })
})
Project members
Amygdaloideae

Amygdaloideae

Created: 10 Oct 2024

ID: 61931