Drop
Use the drop requirement in a KubeJS recipe
Use one of these methods to add a Drop Requirement to the recipe.
//Check for a specific item.
.checkDrop(item, amount, radius)
//Check for any item.
.checkAnyDrop(amount, radius)
//Check for a list of items.
.checkDrops(ingredient, radius)
.checkDrops(ingredient, radius, whitelist)
.consumeDropOnStart(item, amount, radius)
.consumeAnyDropOnStart(amount, radius)
.consumeDropsOnStart(ingredient, radius)
.consumeDropsOnStart(ingredient, radius, whitelist)
.consumeDropOnEnd(item, amount, radius)
.consumeAnyDropOnEnd(amount, radius)
.consumeDropsOnEnd(ingredient, radius)
.consumeDropsOnEnd(ingredient, radius, whitelist)
.dropItemOnStart(item)
.dropItemOnEnd(item)
The
item
param must be an ItemStack created using one of the following syntax:String syntax :
"diamond"
or"botania:pure_daisy"
or"4x mekanism:osmium_ingot"
Item.of()
KubeJS method :Item.of("minecraft:diamond", 42)
The
amount
param must be a positive integer, it represents the amount of items checked/consumed.The
radius
param must be a positive integer, it represents the maximum distance to the machine the items will be searched.The
ingredient
param must be a SizedIngredient. KubeJS support various ingredient types : "item_id", "#tag_id", "@mod_id" or even regex.The
whitelist
param must be a boolean, if set tofalse
the filter will be a blacklist instead of a whitelist.
Example
The recipe will consume 10 stones dropped in a 10 blocks radius of the machine.
ServerEvents.recipes(event => {
event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
.consumeDropsOnStart("10x #c:stones", 10)
})
Last updated