mojira.dev
MCPE-171710

When "on_consume" happens on custom items, the game crashes.

Specifically, this happens in the "on_consume" event of the "minecraft:food" component of the custom items, before 1.20.0, nothing happened, but now in this version, whether a mob or a player, the game crashes when executing the event. No matter what add-on or item it is, if "on_consume" is executed, the game crashes. (Also as an addiction, the custom items while doing the eating animation, its particle is not consistent with the texture of the item and puts any of the base game, this problem has been going on for versions prior to 1.20.0.). It happens on windows and mobiles, as I have tested.

I have tried several workarounds, like changing the format version, adapting the commands to a function, looking at the latest documentation and setting it up the way it is, but nothing has worked.

[EDIT]
Testing, changing things and consulting with more add-on makers, we came to two possible conclusions and "solutions" to the problem that is occurring. One of them is the use of the "target", in the "on_consume" by default the target is "self" but, testing several times, it seems that the lack of this in your code causes the crash of the game, then possibly it is advisable to leave the "target": "self" in the "on_consume", also another conclusion is that directly when "on_consume" happens, no matter what contains the event, just by calling this event, the game crashes (If it doesn't have target). Also another conclusion that puts me in the situation, I use the experimental called "API Beta" and also my "manifest.json" has the necessary modules for it, when testing again with the changes of the target, it works only in the player almost most of the time without crashing the game, but it seems that in the mob's it continues to fail.

[EDIT2]
In dedicated servers, this happens and no matter what changes you try to make it crashes the server when executing "on_consume".

Attachments

Comments 11

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach a functional addon with which the issue can be observed?

This ticket will automatically reopen when you reply.

Quick Links:
πŸ““ Issue Guidelines – πŸ’¬ Mojang Support – πŸ““ Project Summary – πŸ“§ Suggestions – πŸ“– Minecraft Wiki

All right, I've already put it.
Requires the experimentals: "Holiday Creator Features, Custom Biomes and Beta APIs".

What platform are you experiencing this issue on?

In the PC or Windows 10.

I have put a version of the add-on with the entity that appears in the test video and the textures. In case it is necessary.
For the entity to execute the eat event, you put this command: "/event entity @e[type=piglin_brute] ha:start_regenerate". You may need to put it more than once.

1 more comments

This bug is still present in version 1.20.10/1/2.

In follow up to this, the addon Strat’s Food Expansion has also caused my Bedrock Dedicated Server to crash but it appears as if it’s only foods that apply potion effects when the potion effect takes effect. There is a food that has a chance to give strength in his addon and the server only crashes randomly when eating that food. Additionally, when eating the frozen foods from the Frost and bum_crops addons, the server crashes every time due to the potion effects. The issue seems to be directly related to potion effects.

In 1.20.10/12,the game will crash when this map has a gametest script.If your map doesn't has script,the game will not crash

Is this still an issue in the latest version?
This will reopen when you reply.

No, this has already been resolved and works perfectly in the current version of the game (1.20.40/1). Although I am unaware of in which update this was already fixed.

Ha Juegos

(Unassigned)

Unconfirmed

Multiple

Windows 10 pro x64 bits

1.20.0, 1.20.10, 1.20.12 Hotfix

Retrieved