/scoreboard players set @a arrow 2 {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:bow",tag:{display:{Name:"Teleportation Bow"}}}]}
/tp @a[score_arrow_min=1] @e[type=Arrow,score_arrow_min=2]
WORKING TELEPORTATION ARROWS
1- Create scoreboard objective
/scoreboard players remove @a[score_arrow_min=1] arrow 1
/kill @e[type=Arrow,score_arrow_min=2]
/execute @a[score_arrow_min=1] ~ ~ ~ scoreboard players set @e[type=Arrow,r=3] arrow 1
/scoreboard players set @e[type=Arrow,score_arrow_min=1] arrow 2 {inGround:true}
This small command modification allows you to make special bows that will allow you to be teleported where you shoot the arrows.
Make sure to follow the steps.
STEP ONE:
▶ [To be executed only onece] This command lets you create a scoreboard objective that you will need in order to make this creation work.
STEP TWO:
▶ [Set on 'repeat' and 'always active'] The first command (the one at the bottom) Detects if a player is holding a specific bow (In our case a bow renamed "Teleportation Bow") in its first hotbar slot. If so is true, the player receives a score of 2 on the "arrow" scoreboard objective.
In case you want your special bow to be renamed differently, make sure to change the name in the command as well.
▶ [Set on 'chain' and 'always active'] The second command constantly decreases the player's score by 1 each game tick. As long as the player is holding the bow, its scoreboard will remain still to a value of "1". If the player is not holding the bow anymore, the score goes down to 0.
▶ [Set on 'chain' and 'always active'] The third command, once that the player holding the bow is detected, gives a score of "1" to all arrows in a radius of 3 blocks near that player. In case that the player is shooting arrows with a normal bow (non renamed or differently renamed bow), the arrows will not be added to the scoreboard because the player is not detected.
▶ [Set on 'chain' and 'always active'] The fourth command block detects when the special arrows fall on the ground and increases their score by 1. So, once that a special arrow falls on the ground, its score will be "2".
▶ [Set on 'chain' and 'always active'] Once that the arrow is detected on ground, the fifth command block teleports the player (which needs to have the bow in his hand) to that arrow.
▶ [Set on 'chain', 'conditional' and 'always active'] The last command block kills the arrow once that the whole process is done.
/scoreboard objectives add arrow dummy
2- Command blocks
COPYRIGHT © THEREDENGINEER. ALL RIGHTS RESERVED.
THIS WEBSITE IS NOT ENDORSED, ASSOCIATED OR AFFILIATED WITH MOJANG AB.