Interface Dispenser

All Superinterfaces:
BlockState, ContainerBlock, InventoryHolder, Metadatable

public interface Dispenser
extends BlockState, ContainerBlock
Represents a dispenser.
  • Method Details

    • getBlockProjectileSource

      BlockProjectileSource getBlockProjectileSource()
      Gets the BlockProjectileSource object for this dispenser.

      If the block is no longer a dispenser, this will return null.

      Returns:
      a BlockProjectileSource if valid, otherwise null
    • dispense

      boolean dispense()
      Attempts to dispense the contents of this block.

      If the block is no longer a dispenser, this will return false.

      Returns:
      true if successful, otherwise false