#Scripting help

5 messages · Page 1 of 1 (latest)

mental edge
#

This is supposed to allow you to break stone with your fist, but it doesn't seem to work. Could someone with more experience with KubeJS show me how to properly do this?

sturdy finchBOT
#

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

fierce pulsar
#

Your code transcribed into text:

StartupEvents.registry('item', event => {
  event.create("stone_rod")
})

BlockEvents.modification(event => {
  event.modify("minecraft:stone", block => {
    block.destroySpeed = 0.4
    block.requiredTool;false
  })
})

The issues:

  • block.requiredTool does not exist
  • You accidentally inserted a semicolon between block.requiredTool and false
#
StartupEvents.registry('item', event => {
  event.create("stone_rod")
})

BlockEvents.modification(event => {
  event.modify("minecraft:stone", block => {
    block.destroySpeed = 0.4
    block.requiresTool = false
  })
})

Note that destroySpeed and requiresTool are write-only beans! So you can't get values back from those

mental edge
#

Thanks!