Download MekaJS — Minecraft Mods — MetaMods

MekaJS

Active

Downloads

0

Last update

4 years ago
Client
Addons

MekaJS - Modification for Mekanism and KubeJS

This modification serves as an addon for Mekanism and KubeJS, providing a unique capability to create custom gases and infusion types using KubeJS JavaScript scripts.

Custom Gases Creation

To create an individual gas in Mekanism, you only need a registration name (gas identifier), which should contain only lowercase letters without spaces or special characters (numbers and underscores are permitted).

You also need to specify the gas color in numerical format (integer). If no color is specified, the gas will appear black. Optionally, you can configure a custom texture for display in JEI and machine interfaces - the color will overlay the texture.

Code example:

onEvent('gas.registry', event => {
    event.create("test_gas").color(16711688).texture("kubejs:gases/test_gas_texture.png")
})

This code creates a gas named "test_gas" colored bright red, with texture located at kubejs/assets/kubejs/textures/gases/test_gas_texture.png. Important: add localization entry for proper in-game name display: "gas.kubejs.test_gas":"Test Gas" in kubejs/assets/lang/en_us.json.

Custom Infusion Types Creation

The process of creating custom infusion types is similar to gas creation. Requires registration name, valid color (numerical format) and optional texture.

Code example:

onEvent('infuse_type.registry', event => {
    event.create("test_infuse_type").color(16711688).texture("kubejs:infuse_types/test_infuse_type_texture.png")
})

Important: for proper name display, add corresponding entries to project localization files.

Project members
frinn38

frinn38

Created: 25 May 2021

ID: 92468