I'm creating an item that when used adds a selected tag to the nearest entity, but when I use it again near another entity it adds another target tag. The select entity is attracted by the target entity, I'm getting close to it using 2 commands (of course there are more things but they are not commands), But I'm having an error.
For this command to work it needs a small delay between them, I tried to make this small delay using triggers, when the item is used the test:select event is triggered
"test:select": {
"run_command": {
"command": [
"execute if entity @e[r=15, tag=!target, tag=!select] run tag @e[r=2, c=2] add select"
]
},
"trigger": {
"event": "test:select_second"
}
},
"test:select_second": {
"run_command": {
"command": [
"execute if entity @e[r=15, tag=select] run execute at @e[r=2, tag=!select, tag=!target] run tag @e[r=2, c=2] add target"
]
Commands
execute if entity @e[r=15, tag=!target, tag=!select] run tag @e[r=2, c=2] add select
Adds the *target* tag to an entity if the entity does not have the *select and target* tag and if one already exists with the *select* tag.
execute if entity @e[r=15, tag=select] run execute at @e[r=2, tag=!select, tag=!target] run tag @e[r=2, c=2] add target```
This is the problem I'm having:
[Json][error]-Syntax error: Unexpected "entity": at "xecute if >>entity<< @e[r=15, "
[Commands][error]-Command response could not compile commands