Added isOnMaterial(material: Material) extension
This commit is contained in:
@@ -29,6 +29,12 @@ val Entity.isFeetInWater: Boolean get() = this.location.block.type == Material.W
|
||||
*/
|
||||
val Entity.isGroundSolid: Boolean get() = this.location.add(0.0, -0.01, 0.0).block.type.isSolid
|
||||
|
||||
/**
|
||||
* Checks if the entity stands on a specific material.
|
||||
* @param material the material you are looking for
|
||||
*/
|
||||
fun Entity.isOnMaterial(material: Material): Boolean = location.block.type == material
|
||||
|
||||
/**
|
||||
* Kills the damageable.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user