Interface FallingBlock

All Superinterfaces:
Audience, CommandSender, Entity, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, Pointered, ServerOperator, Sound.Emitter

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

    • getMaterial

      Deprecated.
      Get the Material of the falling block
      Returns:
      Material of the block
    • getBlockData

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

      boolean getDropItem()
      Get if the falling block will break into an item if it cannot be placed
      Returns:
      true if the block will break into an item when obstructed
    • setDropItem

      void setDropItem(boolean drop)
      Set if the falling block will break into an item if it cannot be placed
      Parameters:
      drop - true to break into an item when obstructed
    • canHurtEntities

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

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

      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

      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

      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

      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
    • getSourceLoc

      @Deprecated default Location getSourceLoc()
      Deprecated.
      replaced by Entity.getOrigin()
      Gets the source block location of the FallingBlock
      Returns:
      the source block location the FallingBlock was spawned from
    • doesAutoExpire

      boolean doesAutoExpire()
      Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the world
      Returns:
      if this behavior occurs
    • shouldAutoExpire

      void shouldAutoExpire(boolean autoExpires)
      Sets if this falling block should expire after: - 30 seconds - 5 seconds and is outside of the world
      Parameters:
      autoExpires - if this behavior should occur