Started by
BobEsBeans
on
Topic category: Help with Minecraft modding (Java Edition)
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
I've tried having the repeat at 1 and it doesn't do anything so i tried using the summon command with a a few of them to see if i got the results i wanted but it was the same as well.
heres: https://imgur.com/YOLj9Xd
set every variable to "player_lifetime"
also, it spawns lighting every 10 seconds, to make it wait 1 minute replace 200 with 1200 in the last two if's
Thank you so much I'll try this right now!
do you have a plugin for the global logic? I cant fond it anywhere and idk if its just not there or if im being dumb and missing it
I'm not using any plugin, what is exactly that you don't find? every global variable block can be found in the custom variables tab after you create them
Sorry I'm still new at this, how do you make one then? I only see local variables and when i make one theres no option to make it a global variable
click on the "variables" tab: https://imgur.com/4m6ij3x
then you'll be able to create global variables, make sure to set the type to "logic", the scope to "player_lifetime" and the initial value to false except for the variable that I called "ticks" that one needs to be set to type "number", scope "player_lifetime" and initial value 0
Okay thank you so much, I'll try that in a little bit. Thank you for being patient with me also
You're welcome
hey so I finally had time to test it and it works in single player and lan worlds, but the repeated lightning strikes don't work on a server, do you have an idea of what would cause that?
also I have just realized while testing damage that it spawns like 8 lightning bolts instead of 1
I don't know what causes the server thing, but I tested that procedure before sending the screenshot (and even before sending this message) and it only spawns one lighting bolt
what procedure did you have it on cause i tested it on right click and it spawns one, but when i have it on tick or hurt it spawns 8 more
The server thing I figure out by having it on the tick procedure but it still spawns so many lightning bolts...