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

Unbounded ranges not treated as valid

XMLWordPrintable

    • Confirmed

      I am not sure if this is intended or not, but there is an inconsistency when it comes to command ranges.

      1. Create a new world and create a new dummy scoreboard objective test
      2. run:

      /scoreboard players set @p test 0
      /execute as @e[scores={test=-2147483648..2147483647}] run say hi
      

      In this case, the command will execute so long as the player has a score present, since the range starts at the minimum possible value and ends at the maximum possible value.

      3. run:

      /execute as @e[scores={test=-2147483648..}] run say hi
      

      In this case, the command will execute so long as the player has a score present, since the range starts at the minimum possible value and there is no maximum.

      4. run:

      /execute as @e[scores={test=..2147483647}] run say hi
      

      In this case, the command will execute so long as the player has a score present, since the range ends at the maximum possible value and there is no minimum.

      5. Now, run:

      /execute as @e[scores={test=..}] run say hi
      

      In this case, one would expect that the command will execute so long as the player has a score present, since the range has no minimum and no maximum. However, it is not considered a valid range.

            Unassigned Unassigned
            elyg Ely G
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: