#entity counting
1 messages · Page 1 of 1 (latest)
i want to make it when the armor stand overlaps it sees how many over laps and changes the entity or the leather helmet color and deletes the rest
im trying to make minesweeper btw
You need to see how many it overlaps with, or you just need to do something to the ones it overlaps with?
Either way you're gonna use an @e target selector that uses a volume check in the target selector arguments, the only change is whether you're storing that result to a scoreboard or not
yes but i have multible entitys so the @e wont work
That's exactly what it's for?
theres multible around it https://medal.tv/games/minecraft/clips/n3A6e6iRDG9_tV1uo?invite=cr-MSxQbEEsNjA2MjY0ODI2&v=1
Watch Untitled by bumpyball and millions of other Minecraft videos on Medal. #minecraft
they all have the same tag
Right... But you specifically said you want to see how many other entities overlap with it
doesnt @e only targets all of the entitys selected
Of course
From what you are explaining up here, that is exactly what you want to do: Target all of the entities that overlap with a particular armor stand
If that isn't what you want then you need to start over and explain what you mean, because it doesn't match what you're saying
So?
elaborate im kinda of stupid. how would @e work?
When you execute as the particular armor stand you're trying to check (however you choose to do this, I don't know what step you're at in the process), then you will make it run an execute command as @e[...], in which you'll specify the volume or distance you want to check to count as "overlapping."
You can exclude the entity that is initially running this command in a few ways, but simplest would just be having the distance argument include a minimum in the range that is greater than like 0.1, since distance will only succeed if an entity's origin (usually the center of their feet) are in that range, so by making that range a start a little further away from the entity's origin, you make it so it can't find itself.
like this?: execute as @e[type=armor_stand,tag=mine] at @s if entity @e[type=armor_stand,tag=numbertemp,distance=0.1..0.5] run say touching
That is a valid command, whether it will do what you want it to depends on context I do not have
If the entities are like overlapped as in the same block you can use an execute command that select all entities within say 0.1m of the entity running the command. Store this as a scoreboard and it counts all entities within 0.1m of the armour stand that ran the command. If you want to exclude the one that ran the command just -1 from the result.
If you want to know how many armour stands are next to it you can set the distance to 1, which should select the ones to the north, south, east, west. If you want diagonal, 1.5 should do, might need to mess around with the numbers.
To check which one the command selects, run this command as an armour stand
effect give @e[distance=..1] glowing 10
The armour stands that meet the criteria @e[distance=..1] will glow for 10 seconds, allowing you to tweak the distance to what you need. Once you've found the distance, put it in this command to select and count the armour stands around it.
execute as @e[distance=..{Your Value}] run scoreboard players add result count 1
I'm fairly sure there's also a way to do a store command but as I'm on mobile I'm not certain I could write a command out for you right now
Like said before though you goal is kinda vague from what you've said so if you have more information it would be easier to help
@left blade can you please refrain from deleting your original post
yeah ok but my orginal post was realy badly spelt