mojira.dev
MCPE-162964

Game crashed when using new execute command test failed in script

When using script to run new execute command and when itself condition is failed, game will be crashed

Step to reproduce:

  1. Create an addon that contains feature for script working

  2. Paste below code to main.js

  3. Create world and turn on GameTest Framework, Upcoming Creator Features

  4. Broken one block with Bedrock on hand ( It's Working )

  5. Do same action with no item or other item in hand

  6. 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.

Comments 1

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

NguyenDuck

(Unassigned)

Plausible

Multiple

Windows 11

command, scripting-api, watchdog

1.19.31 Hotfix

Retrieved