@minecraft/server / BlockPistonComponent
Class: BlockPistonComponent ​
Defined in: @minecraft/server/index.d.ts:5302
When present, this block has piston-like behavior. Contains additional properties for discovering block piston state.
Extends ​
Properties ​
block ​
readonlyblock:Block
Defined in: @minecraft/server/index.d.ts:4377
Remarks ​
Block instance that this component pertains to.
Inherited from ​
isMoving ​
readonlyisMoving:boolean
Defined in: @minecraft/server/index.d.ts:5311
Remarks ​
Whether the piston is in the process of expanding or retracting.
Throws ​
This property can throw when used.
isValid ​
readonlyisValid:boolean
Defined in: @minecraft/server/index.d.ts:6234
Remarks ​
Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.
Inherited from ​
state ​
readonlystate:BlockPistonState
Defined in: @minecraft/server/index.d.ts:5318
Remarks ​
The current state of the piston.
Throws ​
This property can throw when used.
typeId ​
readonlytypeId:string
Defined in: @minecraft/server/index.d.ts:6240
Remarks ​
Identifier of the component.
Inherited from ​
componentId ​
readonlystaticcomponentId:"minecraft:piston"='minecraft:piston'
Defined in: @minecraft/server/index.d.ts:5319
Methods ​
getAttachedBlocks() ​
getAttachedBlocks():
Block[]
Defined in: @minecraft/server/index.d.ts:5327
Returns ​
Block[]
Remarks ​
Retrieves a set of blocks that this piston is connected with.
Throws ​
This function can throw errors.
getAttachedBlocksLocations() ​
getAttachedBlocksLocations():
Vector3[]
Defined in: @minecraft/server/index.d.ts:5335
Returns ​
Vector3[]
Remarks ​
Retrieves a set of block locations that this piston is connected with.
Throws ​
This function can throw errors.