#Is this possible?
1 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Please chuck me a ping if youre able to help
I would do it with BlockEvents.rightClicked('minecraft:dirt', event => {})
if(event.item.id === 'kubejs:fossilized_acorn' && event.block.up.id === 'minecraft:air') {
let arr = ['minecraft:oak_sapling', '...']
event.block.up.set(arr[Math.random() * arr.length])
}```
Something like that
@verbal notch
(in server events)
Will that do it on any block or only ones saplings can be planted on?
Only "minecraft:dirt"
See event call, thats where you specify what block it goes on
If you need multiple you can do ...rightClicked(['minecraft:dirt', 'minecraft:grass_block'], event => ... etc
And don`t forget to remove "acorn item" from hand.
Sweet thanks, how would I go about removing the item from my hand once a sapling has been placed?
event.item.count-- (or event.item.shrink() is a thing aswell?)
Oh right, yes, that
BlockEvents.rightClicked(['minecraft:dirt', 'minecraft:grass_block', '...'], event => {
const {item, block} = event
if(item.id === 'kubejs:fossilized_acorn' && block.up.id === 'minecraft:air') {
let arr = ['minecraft:oak_sapling', '...']
block.up.set(arr[Math.random() * arr.length])
item.count--
}
})```
like so then (just putting everything together whats being tossed in here)
I wouldnt leave the ... In lel
/tableflip obviously