Started by
NaviBlu
on
Topic category: Help with Minecraft modding (Java Edition)
So I made a sword and my idea for it was that when you right click it lightning will spawn where you are looking (crosshair) but haven't figured that out, if possible I also wanted to make a timer for the prompt which only allows you to do that every so often. Is this possible or is it just a waste of my time because I've looked through multiple tutorials and haven't found anything that can help me.
try this:
add a procedure to the sword's "when right-clicked in air" trigger.
now, add the "strike lightning at [x][y][z]" code block, and change the [x][y][z] variables to "block position with raytrace distance x/y/z" (or similarly named). there should be 3 variations for x, y, and z. for example, if you want the sword to strike lightning 6 blocks away from you, and at the position you're looking at, change the values of the "raytrace distance" code block arguments to 6.
the cooldown is the simplest part, actually. just go to itemstack procedures, then select "cooldown [provided itemstack] for [x] ticks" where x is the duration of cooldown in Minecraft ticks.
hope this helps. if you don't really understand, i can send screenshots as well
Screenshot would be very helpful because i am still getting used to making procedures so you could that would be amazing
for now, i don't have access to my PC yet :/
but i can confirm that procedure works as i tested it yesterday and everything went well 😌
you might have to wait 5-6 hours first (i know that's a bit long but bear with me please) until i can send u either the screenshot or the procedure template.
totally fine with that, thank you so much
alright, here it is:
you can change the numbers to any value you want. for example, this one strikes lightning about 6 blocks away from the player, so if u want it to be 9 blocks away for example, change all '6' values to '9'.
Thank you, I just have one more question, how did you do the dark blue blocks? I cannot find them
nevermind, i found it
you're welcome :)
I've been trying to do the same think, thanks so much for posting this.
Wait where are the dark blocks?
look em up!
Hi
I know this post is kinda old now but i'm tryna do almost the same thing except I want the lightning to strike where I'm looking
and not like specifically 100 blocks or like that
is that possible? Hope anyone answers
Nvm I figured out how to make it strike wherever I look but does anyone how to make it have a 20% chance of it
disabling movement for 2 seconds on the entity/player that the lightning strikes?it would help a lot if anyone
answered !
hello i dont know if someone its gona see this but it will help a lot if someone can tell me how to make the lightning strike where I look