Enchanted bow crashes game

Published by mrem on
Status
Resolved
Issue description

Hi. Thank you for making MCreator for the 1.14.4 version of Minecraft! 

I've created a bow that makes regular arrows explosive.  At first it fired only flaming arrows (as selected) but no explosions.  I set up the logic (probably incorrectly) and now it no longer fires and breaking a block with the item causes the game to crash.  I've been using MCreator for about 51 minutes so I apologize in advance for any noob-ness in this help request.

Thank you 

Marc

Issue comments

Explosion power 5 is quite big, you should not be setting cooldown on each tick too as this might overload the game and crash it too.

I lowered the explosion to 2 and removed the cool down altogether.  Now the game crashes when I attempt to fire an arrow.

THIS ISSUE IS NOT RESOLVED.

The issue still exists.

Attach your workspace and tell me which mod elements to check. And don't bump topics like this, give us time to reply, you are not even close to entitled to get free support here.

I think I have an idea.

Did you told the game to launch the explosion procedure with the "hit ground", "hit mob" or "hit player" trigger?

if you used the third one "hit player", remember what you are.

yep, a player.

Since the arrow is fired from your hitbox, the arrow hitbox encounters yours for a brief second.

This short amount of time is enough for the game to understand the arrow has hit a player (you). Thus explodes as soon as you fire it. Since the function will repeat each game tick (1/20 second) and that the arrow might be trapped by the explosion, the game will try to explode twenty times a second.
If you ask for an explosion power of 5, the explosion will be as strong as a bed exploding in the Nether. Twenty bed explosions per second, that's enough to crash a not-so-powerful computer.

My apologies if I came across too brashly.  I'm pretty new to all of this.

 

I solved the problem by deleting the "random < 1" block and replacing it with a "true" block in the "if-do" under the event trigger.

Works great now.

Thanks for your time,

M

You can just set a small delay.

You create a variable that increments every tick, and you ask for the "hit player" trigger to only activate when timer is above 10, per example.

But idk how to do this, probably by code ;-;