How to make straight flying arrows in vanilla Minecraft?
Does anyone know how to make straight flying arrows using command blocks? I'm trying to make an easier way of teleporting than ender pearls, which do damage and don't fly straight. I've made the following commands;
/scoreboard objectives add Shot stat.useItem.minecraft.bow
/scoreboard objectives add Holding dummy
/scoreboard objectives add Arrow dummy
/scoreboard objectives add InGround dummy
/scoreboard players set @a Holding 0
/scoreboard players set @a Holding 1 {SelectedItem:{tag:{display:{Name:"Enterprise"}}}}
/execute @a[score_Shot_min=1,score_Holding_min=1] ~ ~ ~ /scoreboard players set @e[type=Arrow,r=2] Arrow 1
/scoreboard players set @e[type=Arrow,score_Arrow_min=1] InGround 1 {inGround:1b}
/execute @e[type=Arrow,score_InGround_min=1] ~ ~ ~ /tp @p[score_Holding_min=1] @e[score_InGround_min=1]
/kill @e[type=Arrow,score_InGround_min=1]
/scoreboard players set @a Shot 0
There's only one problem: arrows don't fly straight either. Does anyone know how to make them fly straight?
Solution 1:
You can't make arrows fly straight with just commands.
You seem good enough with commands, so Ill just give you the basic idea.
change any arrow you shoot with the entity of a fireball. You could potentially make it an arrow riding an invisible fireball, but Im not sure how well that would work. You can't easily tell an arrow to face what direction you shot it in, so the arrow would simply be flying forward on an invisible fireball facing downward. There is no way to make an arrow fly straight without using that method. It doesn't look good, and I would recommend trying some different idea altogether than making arrows fly straight. You could tell the arrow to face a certain direction by sensing your direction and facing in that direction. There are endless possible directions you could be facing, and to even get a rough approximation of the arrow facing the direction you want you would need hundreds, if not thousands of command blocks.
Solution 2:
The Minecraft 1.10 update introduced the "No Gravity" {NoGravity:1} tag. You can use that to make hoverboats, straight arrows, snowballs, etc.