getOrThrow

fun <T : Any> getOrThrow(property: BlockStateProperty<T>): T

Gets the value of the given property or throws an IllegalStateException if the property is not set.