Uploaded image for project: 'Bedrock Dedicated Server'
  1. Bedrock Dedicated Server
  2. BDS-19626

Await Script API not functioning as expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • 1.21.21
    • None
    • Unconfirmed

      await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)

      Command above works when typed in game yet using it within my behaviour pack it does not? nor does it even return in chat or console.
      I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
       
      Bigger snippet here

      form.show(player).then(async r => {
      if (r.selection == 0) {
      try {
      await player.runCommandAsync(`clear @s[hasitem={item=brick_block,quantity=1..}] brick_block 0 1`)
      world.sendMessage("Removed 1 brick_block from your inventory")
      }
      catch (error)
      {
      world.sendMessage("You have no more brick_block to remove from your inventory")
      }

       
       
       
       

            Unassigned Unassigned
            LittleRAT LittleRAT
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: