mojira.dev
MC-121938

/execute detects if distance to all entities who execute the command when using distance in selector in if entity

It's hard to explain so i'll create an example here:

/execute as @e[type=!player] at @s if entity @p[distance=..1] run say Success

The command at the end will only be executed if all entities (except the player) are 1 block or less away from the player. The following also didn't work, which quite confused me:

/execute as @e[type=!player] at @s run execute if entity @p[distance=..1] run say Success

Increasing the distance so that all entities were in range of me, allowed the command at the end to run

Linked issues

Comments 2

Thank you for your report!
However, this issue is a Duplicate of MC-121934.

It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

ah thanks, didnt know it had the same reason as the other report (i searched and found that one), thanks for your help though, much appreciated

ZockerAxel

(Unassigned)

Unconfirmed

Minecraft 17w45b

Retrieved