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

Conditional function command only runs the function if the selection matches exactly one entity

XMLWordPrintable

    • Confirmed

      (See also these two Reddit comments by brianmcn)

      If you run a function using this command:

      /function foo:bar if @e[tag=test]
      

      the function foo:bar will only be run if @e[tag=test] matches exactly one entity.

      Correspondingly, this command:

      /function foo:bar unless @e[tag=test]
      

      will run the function only if @e[tag=test] matches no entities or more than two entities.

            dinnerbone [Mojang] Nathan Adams
            violine1101 [Mod] violine1101
            Votes:
            15 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: