if_

Creates one or more execute commands following the given condition

This can be nested with if_, as_, align, anchored, at, in_, facing, on, positioned, positionedAs, positionedOver, rotated, rotatedAs and summon to create more complex conditions

This also returns an else builder that can be used to form an else statement.

Example:

if_(myPressurePlate.isOn() and con("B")) {
cmd("say Hello World!")
as_("@a") {
cmd("say Hi!")
}
if_(con("C")) {
cmd("say C was true too!")
}
}.else {
cmd("say Goodbye")
}

See also