Started by NaviBlu
on Tue, 09/29/2020 - 18:30
Topic category: Help with 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.