BlockItemBehavior
Hierarchy
- BlockItemBehavior
Implemented by
Index
Methods
optionalonDispense
Method called when the item was dispensed.
Parameters
coords: ItemUseCoordinates
full coords object, where the main coords are the position of the dispenser block,
relative
ones are the position of the block to which the dispenser is pointed, andvec
are the coords for the item to be dropped atitem: ItemStack
item that was dispensed
region: WorldRegion
BlockSource object
slot: number
numeric id of the slot from which the item was dispensed
Returns void
optionalonItemUse
Method called when player clicks on block with the item.
Parameters
coords: ItemUseCoordinates
object of touch coordinates with side information and relative coordinates set.
item: ItemStack
item that was in the player's hand when he touched the block
block: Tile
block that was touched
player: number
player entity uID
Returns void
optionalonNameOverride
Method to get displayed item name.
Parameters
item: ItemInstance
item stack information
translation: string
translated item name
name: string
original item name
Returns string
new name that will be displayed
Common functions for blocks and items