#Help with updating old script

6 messages · Page 1 of 1 (latest)

lost ermine
#

Hi, i have no idea what the new replacement for onEvent(block.right_click) is

    if(event.item.id == "minecraft:glass_bottle"){
        if(event.block.id=="bradditions:carpet"){
            event.item.count--;
            event.player.give(Item.of("bradditions:carpet_fluid_bottle"))
            event.block.set("minecraft:brown_wool")
        }

    }
});```
outer skyBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

lost ermine
#

yes, i looked at the wiki
i didn't find anything

frank aspen
#
// Before

onEvent('block.right_click', event => {
  if(event.block.id === 'minecraft:dirt') {
    console.info('Hi!')
  }
})

// After

BlockEvents.rightClicked(event => {
  if(event.block.id === 'minecraft:dirt') {
    console.info('Hi!')
  }
})
lost ermine
#

that works, thanks