Block.onInteract

Function called when a player right-click the block. Blocks like tile should use this function for handle the interaction. N.B. That this function will no be called if the player shifts while performing the right-click/screen-tap.

class Block
bool
onInteract

Parameters

player Player

the player who tapped the block

item Item

the item used, is the same as player.inventory.held

position BlockPosition
face ubyte

the face tapped

Return Value

Type: bool

false is a block should be placed, true otherwise

Meta