Kubejs Botany Pots Wiki › Guides › How to Add a Custom Crop to Botany Pots with KubeJS
How to Add a Custom Crop to Botany Pots with KubeJS
Writing the Crop Recipe
Crops in this mod are registered through a server script event. Create a .js file in your kubejs/server_scripts folder and use ServerEvents.recipes. The crop method takes a seed item, a list of soil categories it can grow on, a display block, a loot array, and a growth tick value.
`js
ServerEvents.recipes(event => {
event.recipes.botanypots.crop(
"minecraft:wheat_seeds",
["dirt"],
{ block: "minecraft:wheat" },
[Item.of("minecraft:wheat").withChance(100).withRolls(1, 3)],
1200,
1
)
})
`
Understanding Each Argument
- Seed item: the item players place into the pot to start growing.
- Categories: which soils the crop accepts. These must match categories you defined on your soil recipes.
- Display block: what visually appears on top of the pot as it grows.
- Loot array: the drops.
withChanceweights entries against each other, andwithRolls(min, max)controls how many times that entry is rolled. - growthTicks: base time to mature.
- growthModifier: usually left at
1; it scales growth speed.
Reload with /reload after saving to test the crop in-game.