Package io.papermc.paper.block

# Interface MovingPiston

All Superinterfaces:
  `BlockState`, `Metadatable`, `PersistentDataHolder`, `TileState`

public interface MovingPiston extends TileState

## Method Summary

Modifier and Type
Method
Description
`@NotNull BlockFace`
`getDirection()`
The direction that the current moving piston is pushing/pulling a block in.
`@NotNull BlockData`
`getMovingBlock()`
Gets the block that is being pushed
`boolean`
`isExtending()`
Gets if the piston is extending or not.
`boolean`
`isPistonHead()`
Returns if this moving piston represents the main piston head from the original piston.

### Methods inherited from interface org.bukkit.block.BlockState

`getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, update`

### Methods inherited from interface org.bukkit.metadata.Metadatable

`getMetadata, hasMetadata, removeMetadata, setMetadata`

### Methods inherited from interface org.bukkit.block.TileState

`getPersistentDataContainer, isSnapshot`

## Method Details

### getMovingBlock

@NotNull @NotNull BlockData getMovingBlock()
Gets the block that is being pushed

Returns:
  the pushed block

### getDirection

@NotNull @NotNull BlockFace getDirection()
The direction that the current moving piston is pushing/pulling a block in.

Returns:
  the direction

### isExtending

boolean isExtending()
Gets if the piston is extending or not. Returns false if the piston is retracting.

Returns:
  is extending or not

### isPistonHead

boolean isPistonHead()
Returns if this moving piston represents the main piston head from the original piston.

Returns:
  is the piston head or not