Minecraft - How to select flying arrows by NBT data given to them in item form
On my private (vanilla 1.9) Minecraft server, me and my friends are trying to make custom arrows, such as TNT, ender, high explosive etc. These arrows have NBT data such as a tag "tntarrow" for a TNT arrow. However, when an arrow gets shot, it seems to 'lose' it's NBT data for some reason, so we have no way of telling normal, TNT and ender arrows apart in the air.
Is there any way of working out what kind of arrow (normal, TNT, ender etc) an arrow is while flying, so that when arrows land I can apply my own commands to activate the custom arrow's effects? I'm happy to re-purpose tipped arrows that give buffs (strength, speed, healing etc) if that is possible.
Just to clarify, if I give a player an arrow with a tag "tntarrow", like so:
/give player arrow 1 0 {Tags:["tntarrow"]}
Then, when it's shot, this selector doesn't work:
@e[type=Arrow,tag=tntarrow]
So, I would like to have some way of having only certain arrows being selected.
If it is possible to re-purpose tipped arrows, then I would also like to know how to do that. (For me to re-purpose them, I need to remove potion effects and have a way of selecting them.)
Pictures about "Minecraft - How to select flying arrows by NBT data given to them in item form"



How do you select arrows in Minecraft?
When holding a bow pressing Shift-q or Shift-e cycles forward or backward between the types of arrows. At one side of the inventory bar there would be a circle that you could rotate through to select a new arrow.How do you make arrows fly straight in Minecraft?
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.How do you use NBT tags in Minecraft?
NBT tags are used in game commands such as: /summon, /data, /give, /fill, /setblock. The NBT tag is always surrounded in {} such as {NoAI:1}. If there is more than one NBT tag used in a command, the NBT tags are separated by a comma such as {NoAI:1, IsBaby:1}. Each entity (or mob) has its own unique set of NBT tags.What is the command to give arrows in Minecraft?
There is also an "Uncraftable Tipped Arrow" that can be obtained in Minecraft: Java Edition by performing the following commands:All About Arrow NBT - Minecraft Tutorial
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anete Lusina, brotiN biswaS, Pixabay, Nataliya Vaitkevich
