Got a question that the wiki doesn't answer? Ask on the forum (preferred), or join us on IRC.

BeastNode

CommandHelper/Staged/API/and

From EngineHub.org Wiki
Jump to: navigation, search



Vital Info

Name and
Returns boolean
Usages var1, [var2...]
Throws CastException
Since 3.0.1
Restricted
No
Optimizations CONSTANT_OFFLINE
OPTIMIZE_DYNAMIC

Description

Returns the boolean value of a logical AND across all arguments. Uses lazy determination, so once an argument returns false, the function returns. Operator syntax is supported: @a && @b

Usages

and(var1, [var2...])

Examples (How do these work?)

Example 1

Functional usage

Given the following code:

1   and(truetrue)


The output would be:

:true

Example 2

Operator syntax, true condition

Given the following code:

1   true && true


The output would be:

:true

Example 3

Operator syntax, false condition

Given the following code:

1   true && false


The output would be:

:false

Example 4

Short circuit

Given the following code:

1   false && msg('This will not show')


The output would be:

:false


See Also

or



Navigation menu