Skip to content

@minecraft/server


@minecraft/server / PlayerInteractWithBlockAfterEvent

Class: PlayerInteractWithBlockAfterEvent ​

Defined in: @minecraft/server/index.d.ts:17607

Contains information regarding an event after a player successfully interacts with a block.

Properties ​

beforeItemStack? ​

readonly optional beforeItemStack?: ItemStack

Defined in: @minecraft/server/index.d.ts:17615

Remarks ​

The ItemStack before the interaction succeeded, or undefined if hand is empty.


block ​

readonly block: Block

Defined in: @minecraft/server/index.d.ts:17621

Remarks ​

The block that will be interacted with.


blockFace ​

readonly blockFace: Direction

Defined in: @minecraft/server/index.d.ts:17627

Remarks ​

The face of the block that is being interacted with.


faceLocation ​

readonly faceLocation: Vector3

Defined in: @minecraft/server/index.d.ts:17634

Remarks ​

Location relative to the bottom north-west corner of the block where the item is placed.


isFirstEvent ​

readonly isFirstEvent: boolean

Defined in: @minecraft/server/index.d.ts:17642

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? ​

readonly optional itemStack?: ItemStack

Defined in: @minecraft/server/index.d.ts:17649

Remarks ​

The ItemStack after the interaction succeeded, or undefined if hand is empty.


player ​

readonly player: Player

Defined in: @minecraft/server/index.d.ts:17655

Remarks ​

Source Player for this event.