Started by
alduin370
on
Topic category: Help with MCreator software
Hello I would like to know how to make a lightning spawn where I look by right clicking with a sword
Topic category: Help with MCreator software
Hello I would like to know how to make a lightning spawn where I look by right clicking with a sword
I can do if you want it to strike specifically right click on entity, not on block or in air. Sorry if that isn't good.
What you need to do for right click on entity is this:
1. Make procedure. You can name it anything.
2. In the green script starter block, change "No additional trigger" to "Player right clicks on entity".
3. Make a block that says "if: [item in main hand of [source entity] ] = [<put your sword here>], do: strike lightning at [x] [y] [z] effect only: false"
Sorry I couldn't send an image. Hope this helped
Go to your sword's trigger "on right click" and then make a procedure using ray tracing.
Should look something like this:
event {
strike lightning at [look X pos of (event entity) with raytrace distance (100) fluid none] [look Y pos of (event entity) with raytrace distance (100) fluid none] [look Z pos of (event entity) with raytrace distance (100) fluid none]
}
Changing the 100 to your desired RT distance
Go to "triggers" in your sword and then add a procedure for "On right clicked block".
After that, add the block: STRIKE LIGHTNING AT X: x Y: y Z:z.
Then you should be good!
I havent actually tried this but it should work