When using script to run new execute command and when itself condition is failed, game will be crashed
Step to reproduce:
Create an addon that contains feature for script working
Paste below code to main.js
Create world and turn on GameTest Framework, Upcoming Creator Features
Broken one block with Bedrock on hand ( It's Working )
Do same action with no item or other item in hand
Game Crashed
import { world } from 'mojang-minecraft';
world.events.blockBreak.subscribe(e => {
let playerBroken = e.player;
let blockDimension = e.dimension;
let playerSelectedHotbarSlot = playerBroken.selectedSlot;
try {
blockDimension.runCommand(
`execute positioned ~~~ run execute as ${playerBroken.name} if entity @s[hasitem={item=bedrock,location=slot.hotbar,slot=${playerSelectedHotbarSlot}}] run say passed`
);
} catch { }
});
Update test on Android:
Game not crash, world will closed and show a message
The server was shut down due to an unhandled scripting watchdog exception.
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
Is this still an issue in the latest version? If yes, can you please add it to the affected versions (or mention it if you are not the reporter)?
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki