Lightining Sword

Started by NaviBlu on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Lightining Sword

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.

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try this: add a procedure to…
Wed, 09/30/2020 - 08:35

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

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Screenshot would be very…
Wed, 09/30/2020 - 19:30

Screenshot would be very helpful because i am still getting used to making procedures so you could that would be amazing

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
for now, i don't have access…
Wed, 09/30/2020 - 19:43

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.

 

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
totally fine with that,…
Wed, 09/30/2020 - 20:00

totally fine with that, thank you so much

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
alright, here it is: you…
Thu, 10/01/2020 - 01:49

alright, here it is:

Strike lightning at: [look pos X of entity, raytrace dist. 6] [look pos Y of entity, raytrace dist. 6] [look pos Z of entity, raytrace dist. 6]

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'.

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you, I just have one…
Fri, 10/02/2020 - 22:20

Thank you, I just have one more question, how did you do the dark blue blocks? I cannot find them

 

Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nevermind, i found it
Fri, 10/02/2020 - 22:27

nevermind, i found it

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you're welcome :)
Fri, 10/02/2020 - 22:52

you're welcome :)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've been trying to do the…
Wed, 01/13/2021 - 07:01

I've been trying to do the same think, thanks so much for posting this.

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait where are the dark…
Sun, 07/11/2021 - 15:28

Wait where are the dark blocks?

 

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
look em up!
Wed, 03/09/2022 - 00:44

look em up!

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi I know this post is kinda…
Sun, 04/03/2022 - 17:33

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

Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nvm I figured out how to…
Sun, 04/03/2022 - 17:39

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 !

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hello i dont know if someone…
Thu, 03/23/2023 - 12:51

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