Interface FallingBlock

All Superinterfaces:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, ServerOperator

public interface FallingBlock extends Entity
Represents a falling block
  • Method Details Link icon

    • getMaterial Link icon

      @Deprecated(since="1.6.2") @NotNull Material getMaterial()
      Deprecated.
      Get the Material of the falling block
      Returns:
      Material of the block
    • getBlockData Link icon

      @NotNull BlockData getBlockData()
      Get the data for the falling block
      Returns:
      data of the block
    • getDropItem Link icon

      boolean getDropItem()
      Get if the falling block will break into an item if it cannot be placed.

      Note that if getCancelDrop() is true, the falling block will not drop an item regardless of whether or not the returned value is true.

      Returns:
      true if the block will break into an item when obstructed
    • setDropItem Link icon

      void setDropItem(boolean drop)
      Set if the falling block will break into an item if it cannot be placed.

      Note that if getCancelDrop() is true, the falling block will not drop an item regardless of whether or not the value is set to true.

      Parameters:
      drop - true to break into an item when obstructed
    • getCancelDrop Link icon

      boolean getCancelDrop()
      Get if the falling block will not become a block upon landing and not drop an item.

      Unlike getDropItem(), this property will prevent the block from forming into a block when it lands, causing it to disappear. If this property is true and getDropItem() is true, an item will NOT be dropped.

      Returns:
      true if the block will disappear
    • setCancelDrop Link icon

      void setCancelDrop(boolean cancelDrop)
      Get if the falling block will not become a block upon landing and not drop an item.

      Unlike setDropItem(boolean), this property will prevent the block from forming into a block when it lands, causing it to disappear. If this property is true and getDropItem() is true, an item will NOT be dropped.

      Parameters:
      cancelDrop - true to make the block disappear when landing
    • canHurtEntities Link icon

      boolean canHurtEntities()
      Get the HurtEntities state of this block.
      Returns:
      whether entities will be damaged by this block.
    • setHurtEntities Link icon

      void setHurtEntities(boolean hurtEntities)
      Set the HurtEntities state of this block.
      Parameters:
      hurtEntities - whether entities will be damaged by this block.
    • getDamagePerBlock Link icon

      float getDamagePerBlock()
      Get the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.
      Returns:
      the damage per block
    • setDamagePerBlock Link icon

      void setDamagePerBlock(float damage)
      Set the amount of damage inflicted upon entities multiplied by the distance that the block had fallen when this falling block lands on them.

      If damage is non-zero, this method will automatically call setHurtEntities(true).

      Parameters:
      damage - the damage per block to set. Must be >= 0.0
    • getMaxDamage Link icon

      int getMaxDamage()
      Get the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.
      Returns:
      the max damage
    • setMaxDamage Link icon

      void setMaxDamage(int damage)
      Set the maximum amount of damage that can be inflicted upon entities when this falling block lands on them.

      If damage is non-zero, this method will automatically call setHurtEntities(true).

      Parameters:
      damage - the max damage to set. Must be >= 0