generated from NeoForgeMDKs/MDK-1.21-ModDevGradle
-
-
Notifications
You must be signed in to change notification settings - Fork 1
KubeJS Devs
wolfieboy09 edited this page Dec 2, 2025
·
3 revisions
Note
This must go in the startup scripts
To register a custom gas, you can do:
StartupEvents.registry("qtech:gas", event => {
event.create("some_gas")
.poisonous(true) // When a living entity enters the gas, they start taking poison damage
.heavy(true) // Makes the gas heavier then air
.tint(0xFFFFFF) // Set's the gas particle color
.flammable(true) // Makes the gas flammable
.effects(MobEffectInstance.of(MobEffects.CONFUSION)) // There are better ways to do this, but this is how you would give the gas a side effect. You can have as many effects you want
})Note
This can go into the server scripts
To add new fuels to the smeltery, you can do this:
QTEvents.registerFuels(event => {
// Param 1: The fuel (also accepts tags)
// Param 2: Burn time of the fuel
// Param 3: The fuel's burn temperature
event.registerItem("minecraft:dirt", 12, 12)
// Same thing as above, but for fluids
event.registerFluid("minecraft:water", 2, 5)
})To replace a fuel, you can do the following:
QTEvents.registerFuels(event => {
// Let's make bamboo burn longer and hotter
// Add the "true" to the end to declare that it will replace the original one
event.registerItem("minecraft:bamboo", 400, 500, true)
// Same thing as above, but let's make lava a bad fuel source
event.registerFluid("minecraft:lava", 5, 12, true)
})ServerEvents.recipes(event => {
event.recipes.qtech.disk_assembly(
"minecraft:dirt", // This is the output item
["minecraft:stick", "minecraft:sand"], // This is the three main ingredients
["minecraft:oak_log"], // There are the extras
400, // The amount of energy that's needed to make the recipe
200 // The amount of ticks it will take to make the recipe
)
})ServerEvents.recipes(event => {
event.recipes.qtech.smeltery(
["minecraft:nether_star"], // The 0-3 fluids and 0-3 items. List order does not matter. At least one item OR fluid must be present
["minecraft:stick"], // The result. MUST contain at least ONE item OR fluid. ["item", "fluid"] or ["fluid", "item"], does not matter
["minecraft:dirt"], // Waste output. Just like above, but it's all optional
200, // Minimum temperature
20 // Time in ticks needed to make their cipe
)
})This event is cancellable. Do event.cancel() to cancel this recipe
Inside server scripts, you can do
QTEvents.onVoidCrafting(event => {
// code here
})The event param gives you the following:
-
getRecipe- Returns VoidCraftingRecipe
-
getThrower- Returns the entity that threw the items into the void. This can be nullable!!
-
level- This returns the
ServerLevelwhere the recipe is being produced at
- This returns the
-
getPosition- The position of where this recipe is being produced (Returns
Vec3)
- The position of where this recipe is being produced (Returns
-
getIngredients -
The item entities being consumed in this craft. (Returns a list of
ItemEntity) -
getResults- The results that will be spawned (can be empty if all rolls failed). This can be modified. You can add/remove/change the results
-
hasResults- Whether any results will be produced from this craft