I’m trying to make a bow that when shot it can summon lightning and tnt. What I’m currently using is
/execute @e[type=arrow] ~~~ summon lightning_bolt ~~~
substituting tnt in for the other command. I need to fix 2 things with this:
1) I need to make it be able to distinguish between arrow types, for example, arrow of slow falling summons a lightning bolt while an arrow of strength summons tnt
2) I need it to activate only when it hits the ground
If anyone know how to do either of these that would be great.
activating when it hits the ground can be tricky but it is doable depending on how you want to do it. The reliable way is using the detect ~~-1~ grass option.
However you could setup something that could be reliable with more blocks but it might have its glitches.
/setblock redstone block
execute @e[type=arrow] ~~~ testforblock ~~-1~ air
You then tie these to a lightning block.
So when the arrow is in the air the redstone block gets deleted. But as soon as it hits the ground it gets reactivated
There are a few more things you might want to add that I can help with but first I'd like to know if this is a viable approach for you before continuing
What you could do is give the players different items that activates different arrows. Then make the effects change based upon which item the player activated last. Not perfect but maybe it will help brainstorm something
I’m trying to make a bow that when shot it can summon lightning and tnt. What I’m currently using is
/execute @e[type=arrow] ~~~ summon lightning_bolt ~~~
substituting tnt in for the other command. I need to fix 2 things with this:
1) I need to make it be able to distinguish between arrow types, for example, arrow of slow falling summons a lightning bolt while an arrow of strength summons tnt
2) I need it to activate only when it hits the ground
If anyone know how to do either of these that would be great.
activating when it hits the ground can be tricky but it is doable depending on how you want to do it. The reliable way is using the detect ~~-1~ grass option.
However you could setup something that could be reliable with more blocks but it might have its glitches.
/setblock redstone block
execute @e[type=arrow] ~~~ testforblock ~~-1~ air
You then tie these to a lightning block.
So when the arrow is in the air the redstone block gets deleted. But as soon as it hits the ground it gets reactivated
There are a few more things you might want to add that I can help with but first I'd like to know if this is a viable approach for you before continuing
Thanks for your help! Now I just need it to be able to tell different arrow types apart if it’s possible
Not with vanilla, maybe with addons.
What you could do is give the players different items that activates different arrows. Then make the effects change based upon which item the player activated last. Not perfect but maybe it will help brainstorm something
I think that /execute @e[type=what ever effect_arrow] will work