Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Kubejs Botany Pots Wiki › Guides › How to Control Crop Drops, Chances, and Rolls

How to Control Crop Drops, Chances, and Rolls

The Loot Array

Each crop's fourth argument is an array of item entries. Every entry is built with Item.of(...) and then chained with .withChance(...) and .withRolls(min, max).

`js

[

Item.of("minecraft:candle").withChance(100).withRolls(1, 2),

Item.of("minecraft:stick").withChance(50).withRolls(1, 1)

]

`

How Chance and Rolls Interact

withChance is a weight, not a strict percentage. When multiple entries exist, the game picks among them based on their relative weights. An entry with a higher number is more likely to be selected than one with a lower number.

withRolls(min, max) sets how many times that chosen entry is granted, picked randomly between the two values. So .withRolls(1, 2) yields either one or two of the item each time it is selected.

To make a guaranteed single drop, use a high chance value and .withRolls(1, 1). To create rare bonus drops, add a second entry with a much lower chance value. Keep weights consistent across entries so the ratios behave predictably, and test by harvesting a few pots after /reload.