mojira.dev
MC-117661

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

(See also these two Reddit comments by @unknown)

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.

Linked issues

Comments 1

violine1101

Nathan Adams

Confirmed

command, condition, function, selector

Minecraft 1.12 Pre-Release 4, Minecraft 1.12 Pre-Release 5

Minecraft 1.12 Pre-Release 6

Retrieved