BlockInWorldPredicate
A predicate that tests whether a block in the world matches certain conditions.
Implementations of this interface are used as the result type for block predicate arguments. The predicate can optionally load the chunk containing the block before testing.
Example usage in a command:
blockInWorldPredicate("filter") {
executes { context ->
val predicate = context.getArgument("filter", BlockInWorldPredicate::class.java)
val block = player.location.block
val result = predicate.testBlock(block)
if (result.asBoolean()) player.sendMessage("Block matches!")
1
}
}Content copied to clipboard
Types
Link copied to clipboard
The predicate result is yielded by the BlockInWorldPredicate when applied to a block.