Skip to main content

KJSPKG

KJSPKG is a package manager for KubeJS that can allow you to download different example scripts and libraries into your instance. It will automatically manage minecraft version, modloader, dependency and incompatibility control. It works with KubeJS 6 (1.19), KubeJS Legacy (1.16/1.18) and should even work with some pre-legacy versions (1.12)!

kjspkgbig.png

Installation

  1. Download either the CLI version of KJSPKG or the WIP GUI client.
  2. Open a terminal in the kubejs directory inside of your instance.

  3. Run kjspkg init and select your minecraft version/modloader.

Now you are able to install packages into your instance.

Usage

  • To download a package, run kjspkg install <package_name>
  • To remove a package, run kjspkg remove <package_name>
  • To search for a package, run kjspkg search <query>
  • To list all packages in your instance, run kjspkg list
  • To list all of the commands available, run kjspkg help

Adding your own package

If you have an example script you would like to share on KJSPKG, check out the "Adding your own package" section of KJSPKG's README. We are always happy to add more scripts from different authors to our list!

Notable packages

more-recipe-types (Legacy, 1.16.5/1.18.2, Forge/Fabric)

This package simplifies the process of adding recipes to custom machines from different mods without downloading any addons. For example, this bit of code will add a recipe transforming a stick and an iron ingot to Powah's Energizing Orb:

onEvent('recipes', event => {
	global.mrt.powah.energizing(event, "minecraft:gold_ingot", ["minecraft:stick", "minecraft:iron_ingot"], 1000);
})

For other types, check out the README file on GitHub.

create-depot-crafting (Legacy, 1.18.2, Fabric)

This package allows you to add custom recipes that use manual combination on the create depot. Example from the README:

onEvent('block.right_click', event => {
    global.recipes.create.manual_depot_application(event,
        // Output
        Item.of('expandeddelight:cheese_sandwich'),
        // Inputs
        Ingredient.of('minecraft:bread'), // On depot
        Ingredient.of('expandeddelight:cheese_slice') // In hand
    )
});

Showcase:

68747470733a2f2f692e6962622e636f2f426e59505671572f6578616d706c652d6d696e2e676966.gif

If you're looking for a Forge port of this package, checkout create-depot-crafting-forge. A lot of the times KJSPKG's packages' names end in -6 if they are a port of a different package for KubeJS 6 (1.19), and end in -<modloader> if they are a port of another package for a different modloader as per naming convention. 

soljs (KubeJS 6, 1.19.2, Forge/Fabric)

This package ports the mechanics of the 1.12.2 version of The Spice of Life mod to 1.19 using only KubeJS. It works like a standalone mod and does not require any configuration. Depends on AppleSkin.