[BDS-19626] Await Script API not functioning as expected Created: 18/Aug/24  Updated: 19/Aug/24  Resolved: 19/Aug/24

Status: Resolved
Project: Bedrock Dedicated Server
Affects Version/s: 1.21.21
Fix Version/s: None

Type: Bug
Reporter: LittleRAT Assignee: Unassigned
Resolution: Awaiting Response Votes: 0
Labels: None

Confirmation Status: Unconfirmed

 Description   
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")
}

 
 
 
 



 Comments   
Comment by [MCQA] v-krbaj [ 19/Aug/24 ]

Hi,
We do not have enough information to reproduce this issue.

Please include the following information to help us understand your problem:

Steps to Reproduce:
1. (Explain what needs to be done for the issue to happen)
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

Please also attach any needed commands, datapacks, resourcepacks, screenshots, videos, or worlds needed to help reproduce this issue.

Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.

Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 BDS Wiki – 📖 FAQs

Comment by [Mod] Jarl-Penguin [ 18/Aug/24 ]

Please do not mark issues as private, unless your bug report is an exploit or contains personal information/information about your username or server.

Generated at Sat Jan 11 08:26:16 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.