Started by
Joe Swansawn
on
Topic category: Advanced modding
My goal is to make it so every time lightning strikes in minecraft, it spawns a block at the place it struck. A natural lightning strike. Also, if it's only possible with code then could i get a quick tutorial on how to do that cuz i'm not big on coding. Thank you in advance.
i dont think that is possible, an alternative though could be, during a thunderstorm a mob will have a chance to spawn and it instantly dies and on mob death strike lighting in that location and place block
Hmm hood idea, thanks!
Simple make a never ending procedure that runs off world tick or etc
That would execute the following command as the Console itself..
Execute @e[type=lightning_bolt] ~ ~ ~ /setblock ~ ~ ~ stone
replace stone with Whatever you want.
For instance, amod:blockthing
1.13 and above would be different,
I'm a 1.12.2 pleb ;P
For an effect Around an entity, block or etc
You would do the same but with the following little variation And running off Their tick instead of the world,
NOTE - you must maintain this running via the Console not the player - entity or etc! Otherwise you may have Permission conflicts.
Execute @e[type=lightning_bolt,r=10] ~ ~ ~ /setblock ~ ~ ~ stone
replace stone with Whatever you want.
For instance, amod:blockthing
Replace the "10" after the r= with whatever Block Range you want.
hope this helped.
Interesting... I will look into it and also how to make it in 1.14.2, because it would be helpful in another mod i have in progress. Thank you!
lightning is an entity, so you can create a procedure element, and in the first green block there's an event trigger pulldown, choose "Entity joins the world". and then use IF/DO blocks to check if the current entity is subtype of EntityLightningBolt
just make a procedure that runs this command every tick
/execute at @e[type=lightning_bolt] run setblock ~ ~ ~ <mods namespace>:<block you want to place>
Thanks for all the cool solutions guys. I didn't try all of them obviously but i got it working :)
Oh, what finally got it to work?