Перейти к основному содержанию

ToolParams

Object containing tool parameters and functions.

Hierarchy

  • ToolParams
    • ToolParams

Implemented by

Index

Properties

optionalblockTypes

blockTypes?: string[]

Array of block types which the tool can break.

optionalenchantType

enchantType?: number

Enchantment type of the tool.

optionalhandEquipped

handEquipped?: boolean

Specifies how the player should hold the item.

optionalonItemUse

onItemUse?: (coords: ItemUseCoordinates, item: ItemStack, block: Tile, player: number) => void

Function that is called when player touches a block with the tool.


Type declaration

    • (coords: ItemUseCoordinates, item: ItemStack, block: Tile, player: number): void
    • Parameters

      • coords: ItemUseCoordinates

        object of touch coordinates with side information and relative coordinates set.

      • item: ItemStack

        item in the player's hand

      • block: Tile

        block that was touched

      • player: number

        player entity id

      Returns void