#entity counting

1 messages · Page 1 of 1 (latest)

mint jewelBOT
left blade
#

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

plush plume
#

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

left blade
#

yes but i have multible entitys so the @e wont work

plush plume
#

That's exactly what it's for?

left blade
#

they all have the same tag

plush plume
#

Right... But you specifically said you want to see how many other entities overlap with it

left blade
#

doesnt @e only targets all of the entitys selected

plush plume
#

Of course

plush plume
#

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

left blade
#

yes i do

#

but they all have the same tag

plush plume
#

So?

left blade
#

elaborate im kinda of stupid. how would @e work?

plush plume
#

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.

left blade
#

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

plush plume
#

That is a valid command, whether it will do what you want it to depends on context I do not have

daring ermine
#

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

dull mesa
#

@left blade can you please refrain from deleting your original post

left blade
#

yeah ok but my orginal post was realy badly spelt