Mojira Archive
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.

Awaiting Response

NguyenDuck

2022-10-08, 05:23 AM

2023-08-18, 06:06 PM

2023-08-18, 06:06 PM

0

1

Plausible

command, scripting-api, watchdog

1.19.31 Hotfix

-