#why is my script giving syntax error in the command? is it correct

1 messages · Page 1 of 1 (latest)

shrewd sage
#

world.beforeEvents.itemUseOn.subscribe((evd) => {
  const { source: player, block, itemStack: itemUsed } = evd;

  if (!itemUsed) return;

  if (flint.includes(itemUsed.typeId)) {
    if (block.permutation.matches("ecbl_bs:brazier")) {
      const blockPosition = block.location;

      system.run(() => {
        player.runCommand(`setblock ${block.location.x} ${block.location.y} ${block.location.z} ecbl_bs:brazier["ecbl_bs:light"=1]`);
        
      });
    }
  }
});```
#

using command in chat works, and the block permutation is placed correctly, I just needed to put it in the script but it is giving this error, without using [ ] it works

foggy elk
#

...or just use native methods

shrewd sage
#

wtf

#

works???

#

why?

foggy elk
#

Funny design choice

foggy elk
#

*Quite inconsistent design choice