ItemBehavior
Hierarchy
- BlockItemBehavior
- ItemBehavior
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
optionalonIconOverride
Method to override texture for the item icon.
Parameters
item: ItemInstance
item stack information.
isModUi: boolean
whether icon override is working in mod ui or in vanilla one
Returns TextureData
texture data which will be used for the item icon.
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
optionalonNoTargetUse
Method called when player uses item in the air.
Parameters
item: ItemStack
item that was in the player's hand when the event occurred
player: number
entity uid of the player that used item
Returns void
optionalonUsingComplete
Method called when player completes using item that has maximum use time.
Parameters
item: ItemStack
item that was in the player's hand when the event occurred
player: number
entity uid of the player that used item
Returns void
optionalonUsingReleased
Method called when player doesn't complete using item that has maximum use time.
Parameters
item: ItemStack
item that was in the player's hand when the event occurred
ticks: number
amount of ticks left to the specified max use duration value
player: number
entity uid of the player that used item
Returns void
Item functions