Infinate lightning and explotion spawn

Started by BobEsBeans on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Infinate lightning and explotion spawn

Okay so I'm creating a mod that is supposed to spawn lightning and an explosion at half health once, and then another lightning strike every minute. Instead what I get it infinite lightning an explosions that look like lightning tornados, (could be a cool weather addon), but I've been trying to fix this literally all day with no luck, and I haven't found a solution in any of the forums I've found. Anyone have suggestions or know fixes?

 

Here are some images of code and results

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wait, are you using it on a…
Wed, 07/31/2024 - 21:33

wait, are you using it on a mob? I thought it was for players, did you set it to the tick update of your custom entity?

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah sorry my bad, i just…
Wed, 07/31/2024 - 22:01

Yeah sorry my bad, i just checked my post and realized i neglected to say that. Yes its for a custom mob and yes i set it to the tick update of it. that's what fixed the server issue

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
alright, then you have to…
Thu, 08/01/2024 - 00:01

alright, then you have to replace variables with NBT tags 

https://imgur.com/rKXtJVy 

I made mine work for Iron Golems as an example

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
okay so I did it but it…
Thu, 08/01/2024 - 04:17

okay so I did it but it still produces a lot of lightning bolts. Is it an issue with the tick updates or did i do something wrong and not catch it? I couldn't find the "on loaded entity tick update" in the additional triggers btw, so could it be that?

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Set once to true needs to be…
Thu, 08/01/2024 - 14:39

Set once to true needs to be outside of the wait block

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i got it working, i changed…
Fri, 08/02/2024 - 00:51

i got it working, i changed the 200 on the bottom if to 210 earlier and forgot to change it back, that was what was causing the extra lightning. Thank you so much for your help!

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ok, you're welcome
Fri, 08/02/2024 - 12:42

ok, you're welcome