@minecraft/server / PlayerInteractWithBlockBeforeEvent
Class: PlayerInteractWithBlockBeforeEvent ​
Defined in: @minecraft/server/index.d.ts:17694
Contains information regarding an event before a player interacts with a block.
Properties ​
block ​
readonlyblock:Block
Defined in: @minecraft/server/index.d.ts:17701
Remarks ​
The block that will be interacted with.
blockFace ​
readonlyblockFace:Direction
Defined in: @minecraft/server/index.d.ts:17707
Remarks ​
The face of the block that is being interacted with.
cancel ​
cancel:
boolean
Defined in: @minecraft/server/index.d.ts:17713
Remarks ​
If set to true the interaction will be cancelled.
faceLocation ​
readonlyfaceLocation:Vector3
Defined in: @minecraft/server/index.d.ts:17720
Remarks ​
Location relative to the bottom north-west corner of the block where the item is placed.
isFirstEvent ​
readonlyisFirstEvent:boolean
Defined in: @minecraft/server/index.d.ts:17728
Remarks ​
This value will be true if the event was triggered on players initial interaction button press and false on events triggered from holding the interaction button.
itemStack? ​
readonlyoptionalitemStack?:ItemStack
Defined in: @minecraft/server/index.d.ts:17735
Remarks ​
The item stack that is being used in the interaction, or undefined if empty hand.
player ​
readonlyplayer:Player
Defined in: @minecraft/server/index.d.ts:17741
Remarks ​
Source Player for this event.