Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Run these once:
- /scoreboard objectives add abilities minecraft.used:minecraft.carrot_on_a_stick
- /scoreboard objectives add general dummy
- #All the rest in a repeating command block chain
- #For the distance reporting
- tag @e[nbt={HurtTime:10s}] add target
- execute if entity @e[tag=target] unless entity @e[tag=distance] at @p run summon minecraft:armor_stand ~ ~ ~ {Marker:1,Tags:['distance'],Invisible:1}
- #Copy the next three like 10 times or something
- execute as @e[tag=distance] at @s facing entity @e[tag=target,limit=1] feet run tp @s ^ ^ ^1
- execute if entity @e[tag=distance] run scoreboard players add distance general 1
- execute as @e[tag=distance] at @s if entity @e[tag=target,distance=..1.5] run kill @s
- #Next ones just once again
- execute if entity @e[tag=target] unless entity @e[tag=distance] run tellraw @a [{"text":"Target hit from ","color":"aqua"},{"score":{"name":"distance","objective":"general"},"color":"gold","bold":true},{"text":" blocks away!","bold":false}]
- execute if entity @e[tag=target] unless entity @e[tag=distance] run scoreboard players set distance general 0
- execute if entity @e[tag=target] unless entity @e[tag=distance] run tag @e remove target
- #No Gravity arrow
- execute as @e[type=arrow,tag=!bonus] run data modify entity @s NoGravity set value 1
- #Autoaim
- execute at @e[type=minecraft:arrow] if entity @e[type=!player,distance=..10,type=!arrow] facing entity @e[sort=nearest,limit=1,type=!minecraft:player,type=!#minecraft:arrows] eyes positioned as @e[tag=homing] run tp @e[tag=homing] ^ ^ ^1
- execute as @e[type=minecraft:arrow] at @s if entity @e[type=!player,distance=..10,type=!arrow] run data modify entity @s Motion set from entity @e[tag=homing,limit=1] Pos
- tp @e[tag=homing] 0.0 0 0.0
- #Abilities
- execute at @e[type=arrow,nbt=!{inGround:1b}] if entity @a[scores={abilities=1},nbt={SelectedItem:{tag:{display:{Name:'"Explode"'}}}}] run summon tnt
- tp @a[scores={abilities=1},nbt={SelectedItem:{tag:{display:{Name:'"Teleport"'}}}}] @e[type=arrow,nbt=!{inGround:1b},limit=1]
- execute at @e[type=arrow,nbt=!{inGround:1b},tag=!bonus] if entity @a[scores={abilities=1},nbt={SelectedItem:{tag:{display:{Name:'"Arrow"'}}}}] run summon minecraft:arrow ~ ~ ~ {Tags:['bonus']}
- scoreboard players set @a abilities 0
Advertisement
Add Comment
Please, Sign In to add comment