Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-237396

When matching with @e[predicate] in commands, distance is always 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.17.1, 1.19.3
    • None
    • Ubuntu, openjdk 11.0.11 2021-04-20
    • Confirmed
    • Creative
    • (Unassigned)

      I'm trying to find all entities that have a player near them. I'm using the following command:

      /execute as @e[type=!player] at @s if entity @a[predicate=mypack:mypredicate] run say "near player"

      This is the predicate:

      {
         "condition": "minecraft:entity_properties",
         "entity": "this",
         "predicate": {
            "distance": {
               "absolute": {
                  "min": 0
                  "max": 10
               }
            }
         }
      }
      

            
       
      If the minimum distance is set to 0, all entities will always match. If it is set to anything larger than 0, no entity will ever match. The same is true if I try searching for players that are near other entities, or if using if predicate instead of @e[predicate=].

      It looks like the distance is measured from the entity itself, and not from the current entity in the command, so it is always 0.

       

            Unassigned Unassigned
            yockz Zoran Obradović
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: