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

    Details

    • Confirmation Status:
      Confirmed

      Description

      (See also these two Reddit comments by Brian McNamara)

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                CHK: