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(filter, amount, radius)
.checkDrops(filter, amount, radius, whitelist)
.consumeDropOnStart(item, amount, radius)
.consumeAnyDropOnStart(amount, radius)
.consumeDropsOnStart(filter, amount, radius)
.consumeDropsOnStart(filter, amount, radius, whitelist)
.consumeDropOnEnd(item, amount, radius)
.consumeAnyDropOnEnd(amount, radius)
.consumeDropsOnEnd(filter, amount, radius)
.consumeDropsOnEnd(filter, amount, radius, whitelist)
.dropItemOnStart(item)
.dropItemOnEnd(item)The
itemparam must be an item created usingItem.of(). Example :Item.of("minecraft:dirt")The
amountparam must be a positive integer, it represents the amount of items checked/consumed.The
radiusparam must be a positive integer, it represents the maximum distance to the machine the items will be searched.The
filterparam must be an array of items. Example :[Item.of("minecraft:diamond"), Item.of("minecraft:cobblestone")]. It represents a whitelist of items to search.The
whitelistparam must be a boolean, if set tofalsethe filter will be a blacklist instead of a whitelist.
Example
onEvent('recipes', event => {
event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
.checkDrop(Item.of("minecraft:diamond"), 1, 10)
})Last updated