Item
Use the item requirement in a KubeJS recipe
Use one of these methods to add an Item Requirement to the recipe.
.requireItem(item)
.requireItem(item, "slot")
.requireItemTag("tag", amount)
.requireItemTag("tag", amount, nbt)
.requireItemTag("tag", amount, "slot")
.requireItemTag("tag", amount, nbt, "slot")
.produceItem(item)
.produceItem(item, "slot")
The
item
param must be created usingItem.of()
KubeJS method. Example :Item.of("minecraft:diamond", 42)
The
slot
param must be a string corresponding to a slot id defined in a custom machine json Item Componentslot
property.The
tag
param must be a string starting with # defining a valid tag id. Example :"#forge:stone"
The
amount
param must be a positive integer.The
nbt
param must be a map. Example:{nbt1: 1, nbt2: "something"}
.
Example
onEvent('recipes', event => {
event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
.requireItem(Item.of("minecraft:cobblestone"))
.produceItem(Item.of("minecraft:gravel", 1))
})
Last updated