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
itemparam must be created usingItem.of()KubeJS method. Example :Item.of("minecraft:diamond", 42)The
slotparam must be a string corresponding to a slot id defined in a custom machine json Item Componentslotproperty.The
tagparam must be a string starting with # defining a valid tag id. Example :"#forge:stone"The
amountparam must be a positive integer.The
nbtparam 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