Arrow that changes block that it hit

Help | Java 1.16

So I am trying to make arrow that changes red wool to orange wool. I tried:
/execute at @e[type=arrow,nbt={inBlockState:{Name:"minecraft:red_wool"}}] run setblock ~ ~ ~ orange_wool

and then to destroy

kill @e[type=arrow,nbt={inBlockState:{Name:"minecraft:orange_wool"}}]

as now it should be in orange wool.
But it makes this

https://preview.redd.it/8qm83u0d02751.png?width=2560&format=png&auto=webp&s=c91f34f529b8f02b958ea152a7970aa19b14cdd0

I don't know what to do now. Please help. I am doing this in minecraft 1.16.1

Posted Jun 25, 2020, 12:57 PM UTC

22
thinker227Datapacks killed the command block star•

Easiest and most efficient way to do would probably be to execute at every arrow that's in red wool, check what direction the block is in and then replace the block in that direction.

So that would be /execute at @e[type=arrow,nbt={inBlockState:{Name:"minecraft:red_wool"}}] if block ~1 ~ ~ minecraft:red_wool run setblock ~1 ~ ~ orange_wool, repeated 5 more times except with ~-1 ~ ~, ~ ~1 ~, ~ ~-1 ~, ~ ~ ~1 and ~ ~ ~ ~-1.

1
thinkcraftplOP•

I did that but then when you shoot it in a hole it changes all of the adjacent red wool blocks. I overcame that using x_rotation=-45..45 etc. but then it's also not perfect as you can still hit one block and othethe r one will change. Then I mixed both methods but it's still not perfect. I am still looking for a better way.

2