#I tried a script someone had shown me and I cant quite seem to get it to work
8 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Thank you, I am a complete noob at stuff like this but trying my best, Everything works besides giving the bucket back
any idea why?
The way you are trying to do it, best case scenario it always spawns on top of you since it has to be reletive to the player that triggers the event. Try this, which makes it reletive to a block instead. It worked for me
BlockEvents.rightClicked(/.*/, event => {
const dim = event.block.level.dimension
const x = event.block.x
const y = event.block.y
const z = event.block.z
if (event.item.id == 'minecraft:lava_bucket') {
event.item.count--
event.player.give('minecraft:bucket')
event.server.runCommandSilent(`execute in ${dim} positioned ${x} ${y} ${z} run summon magma_cube ~ ~1 ~ {Health:1f,Size:0}`)
event.server.runCommandSilent(`execute in ${dim} positioned ${x} ${y} ${z} run playsound minecraft:item.bucket.empty_lava master @a ~ ~ ~ 1 0`)
event.server.runCommandSilent(`execute in ${dim} positioned ${x} ${y} ${z} run particle lava ~ ~ ~ 0 0 0 0.5 10 force`)
}
})
BTW - you don't need a filter in BlockEvents.rightClicked