LittleRAT
- LittleRAT
- JIRAUSER790594
- Europe/Stockholm
- Yes
- No
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
button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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
.button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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
.button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs
clear @s ${id} 0 ${slider}.button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs
clear @s ${id} 0 ${slider}.button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs but this still does not fix my issue using double @@
clear @s ${id} 0 ${slider}.button(`Sell`) .button(`Cancel`) .show(player).then(async r => { if (r.selection == 0) { try { await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`) //await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`); // Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) } if (r.selection == 1) { return }
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs but this still does not fix my issue using double @@
clear @s ${id} 0 ${slider}.button(`Sell`) .button(`Cancel`).show(player).then(async r => {if (r.selection == 0) {try {await player.runCommandAsync(`clear @s[hasitem={item=bedrock,quantity=64..}] bedrock 0 64`)//await player.runCommandAsync(`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`);// Everything below get's executed??? regardless of above player.runCommandAsync(`scoreboard players add @s Money ${finalPrice}`); player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${WHITE}You sold ${slider} ${item} for ${GREEN}£${finalPrice}"}]}`) } catch (e) { player.runCommandAsync(`tellraw @s {"rawtext":[{"text":"${RED}You do not have enough ${item} to sell!"}]}`) }if(r.selection == 1) {return}
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs but this still does not fix my issue using double @@
clear @s ${id} 0 ${slider}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 (e) { world.sendMessage("You have no more brick_block to remove from your inventory") }
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[Update]
runCommandAsync ignores anything after @ so instead of minecraft reading the full command as I'd expect
`clear @s[hasitem={item=${id},quantity=${slider}..}] ${id} 0 ${slider}`instead runs but this still does not fix my issue using double @@
clear @s ${id} 0 ${slider}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 (e) { world.sendMessage("You have no more brick_block to remove from your inventory") }
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 hereform.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 (e) { world.sendMessage("You have no more brick_block to remove from your inventory") }
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 hereform.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") }