mojira.dev
MCPE-87987

Addons with javascript crash and not working well

In previous versions, the call back from the server event "minecraft: block_interacted_with" worked fine, apart from never causing a crash. But since 1.16.0 this server event no longer works and also the "destroyEntity ()" generates a crash and the same happens with the following example code:

system.listenForEvent("minecraft:entity_use_item", (datosInteract) => {
let jugador = datosInteract.data.entity;
let mano = system.getComponent(jugador, "minecraft:hand_container");
let lel = mano.data[0];
switch (lel.item){
case "minecraft:wooden_hoe":
let items = ["uhc:equipo1", "uhc:equipo2", "uhc:equipo3", "uhc:equipo4", "uhc:equipo5"];
let dar_equipo;
let borrar = system.createEventData(ejecutarComando);
borrar.data.command = "clear @a";
system.broadcastEvent(ejecutarComando, borrar);
for(let i = 0; i < 5; i++){ dar_equipo = system.createEventData(ejecutarComando); dar_equipo.data.command = "replaceitem entity @a slot.hotbar " + i + " " + items[i]; system.broadcastEvent(ejecutarComando, dar_equipo); };
break;
default:
break;
};
});

PS: The crash does not happen when I only make something show on the screen, even if I execute it within the for loop

Comments 2

Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response

To make your bug report as effective as possible, please try and include the following steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

If your ticket does not look like the example given here, then it's likely to be closed as incomplete.

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Lol lol

(Unassigned)

Unconfirmed

Windows

Windows 10

1.16.0, 1.16.1

Retrieved