I'm getting started with kubejs today and have already made most of the new crops I want and everything is going well so far. I am running into an issue with the last one though - I want this sweet potato crop to function just like a vanilla potato, but kubejs keeps creating a seed item instead of using the sweet potato itself to plant the crop. How can I get this to work? Here are the relevant parts of my current script:
// Sweet potato item
event.create("sweet_potato").food(food => {
food
.hunger(3)
.saturation(0.5)
})
//Sweet potato crop
event.create("sweet_potato_crop", "crop")
.age(7, builder => {
builder
.shape(0, 0, 0, 0, 16, 4, 16)
.shape(1, 0, 0, 0, 16, 4, 16)
.shape(2, 0, 0, 0, 16, 6, 16)
.shape(3, 0, 0, 0, 16, 6, 16)
.shape(4, 0, 0, 0, 16, 6, 16)
.shape(5, 0, 0, 0, 16, 6, 16)
.shape(6, 0, 0, 0, 16, 6, 16)
.shape(7, 0, 0, 0, 16, 14, 16)
})
.survive((state, level, pos) => {
const FARMLAND = Java.loadClass('net.minecraft.world.level.block.FarmBlock')
let blockState = level.getBlockState(pos.below())
let mcBlock = blockState.block
if (mcBlock instanceof FARMLAND) {
return true
}
else return false
})
.growTick((tickevent) => 5)
.dropSeed(true)
.crop("kubejs:sweet_potato", 3)
.texture(0, "kubejs:block/soybeans_stage0")
.texture(1, "kubejs:block/soybeans_stage0")
.texture(2, "kubejs:block/soybeans_stage1")
.texture(3, "kubejs:block/soybeans_stage1")
.texture(4, "kubejs:block/soybeans_stage1")
.texture(5, "kubejs:block/soybeans_stage1")
.texture(6, "kubejs:block/soybeans_stage1")
.texture(7, "kubejs:block/soybeans_stage3")
.tagBlock('minecraft:mineable/pickaxe')
.item((seedItem) => {
seedItem.texture("kubejs:sweet_potato")
})