is it possible to kill armorstands that are inside another armorstand?
Solution 1:
Whenever you summon an armor_stand, have it check if there is already an armor stand:
summon armor_stand ~ ~ ~ {Tags:["new_stand"]}
execute as @e[type=armor_stand,tag=new_stand] at @s as @e[type=armor_stand,distance=..0.1] run scoreboard players add #count count 1
execute if score #count count matches 2.. run kill @e[type=armor_stand,tag=new_stand]
scoreboard players reset #check_count check_count
tag @e[type=armor_stand,tag=new_stand] remove new_stand
This works by having all armor stands within a 0.1 block radius (so basically the exact same spot) add 1 score to a fake player, #count
.
If there is only 1 armor_stand, #count
will only have a score of 1.
If there are multiple armor_stands, #count
will have a score of 2 or greater. If it does, kill the new armor stand.
Finally, reset #count
's score and remove the new_stand
tag.
Old answer
execute as @e[type=minecraft:armor_stand,name=land] at @s run execute as @e[type=minecraft:armor_stand,distance=..0.1,name=land,limit=1] run kill @s
You might have issues with armor stands detecting themselves and killing themselves.