diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index b3fe7bb326..da9f91d0a1 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -9652,6 +9652,36 @@ public enum Material implements Keyed { } } + /** + * Returns a value that represents how 'slippery' the block is. + * + * Blocks with higher slipperiness, like {@link Material#ICE} can be slid on + * further by the player and other entities. + * + * Most blocks have a default slipperiness of {@code 0.6f}. + * + * Only available when {@link #isBlock()} is true. + * + * @return the slipperiness of this block + */ + public float getSlipperiness() { + Validate.isTrue(isBlock(), "The Material is not a block!"); + switch (this) { + // + default: + return 0.6F; + case SLIME_BLOCK: + return 0.8F; + case FROSTED_ICE: + case ICE: + case PACKED_ICE: + return 0.98F; + case BLUE_ICE: + return 0.989F; + // + } + } + /** * Determines the remaining item in a crafting grid after crafting with this * ingredient. diff --git a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java index b64e1f5e5a..db4ba67618 100644 --- a/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/HumanEntity.java @@ -293,6 +293,16 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public boolean isHandRaised(); + /** + * Gets the item that the player is using (eating food, drawing back a bow, + * blocking, etc.) + * + * @return the item being used by the player, or null if they are not using + * an item + */ + @Nullable + public ItemStack getItemInUse(); + /** * Get the total amount of experience required for the player to level *