Mojira Archive
BDS-19626

Await Script API not functioning as expected

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

 
 
 
 

Comments2

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

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

History9

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here
0 

0
0
0button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here
0 

0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

[Mod] Jarl-Penguin

Removed Security Level: Minecraft - Private

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here
0 

0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here0 

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0000
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs

0
0
0clear @s ${id} 0 ${slider}
0
0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0 (r.selection == 0) {                         0 {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs

0
0
0clear @s ${id} 0 ${slider}
0
0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs but this still does not fix my issue using double @@

00
0
0clear @s ${id} 0 ${slider}
0
0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs but this still does not fix my issue using double @@

0
0
0clear @s ${id} 0 ${slider}
0
0
0
0.button(`Sell`)                 0.button(`Cancel`)                 0.show(player).then(async r => {                     0if (r.selection == 0) {                         0try {                                                        0await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)                             0//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);                             0// Everything below get's executed??? regardless of above0player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`);             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`)                                  0} catch (e) {                             0player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`)                             0}                     0if (r.selection == 1) {                        0return0}
0
0

 
0 
0 
0 

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs but this still does not fix my issue using double @@

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

 
0 
0 
0 

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

0

[Update]

0

 runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect 

0
0
0`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`
0
0

 instead runs but this still does not fix my issue using double @@

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

 
0 
0 
0 

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

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

 
0 
0 
0 

0

LittleRAT

Changed description:

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

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.
0I'd found similar code from another script as I went digging after I couldn't get my own to work and same issue arises?
0 
0Bigger snippet here

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

 
0 
0 
0 

[MCQA] v-krbaj
Awaiting Response
LittleRAT
0
0
Unconfirmed
1.21.21