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

ItemMiningLaser

Item functions

Hierarchy

Implements

Index

Constructors

constructor

Properties

canProvideEnergy

canProvideEnergy: boolean

If true, energy can be extracted from item

energy

energy: string

Type of energy stored in item

icon

icon: { meta: number; name: string }

Item texture data


Type declaration

  • meta: number
  • name: string

readonlyid

id: number

Item numeric id

inCreative

inCreative: boolean

item

item: NativeItem

Native class used to set item properties

maxCharge

maxCharge: number

Energy capacity of item

maxDamage

maxDamage: number

Maximum data value of the item

maxStack

maxStack: number

Maximum stack size of the item

modes

modes: { 0: { energy: number; name: string; power: number }; 1: { blockBreaks: number; dropChance: number; energy: number; name: string; power: number; range: number; sound: string }; 2: { energy: number; name: string; power: number; sound: string }; 3: { energy: number; name: string; power: number }; 4: { energy: number; name: string; power: number; smelt: boolean }; 5: { blockBreaks: number; energy: number; name: string; power: number; sound: string }; 6: { energy: number; name: string; power: number } }

Type declaration

  • 0: { energy: number; name: string; power: number }
    • energy: number
    • name: string
    • power: number
  • 1: { blockBreaks: number; dropChance: number; energy: number; name: string; power: number; range: number; sound: string }
    • blockBreaks: number
    • dropChance: number
    • energy: number
    • name: string
    • power: number
    • range: number
    • sound: string
  • 2: { energy: number; name: string; power: number; sound: string }
    • energy: number
    • name: string
    • power: number
    • sound: string
  • 3: { energy: number; name: string; power: number }
    • energy: number
    • name: string
    • power: number
  • 4: { energy: number; name: string; power: number; smelt: boolean }
    • energy: number
    • name: string
    • power: number
    • smelt: boolean
  • 5: { blockBreaks: number; energy: number; name: string; power: number; sound: string }
    • blockBreaks: number
    • energy: number
    • name: string
    • power: number
    • sound: string
  • 6: { energy: number; name: string; power: number }
    • energy: number
    • name: string
    • power: number

name

name: string

Item name

readonlystringID

stringID: string

Item string id

tier

tier: number

Tier of item. Specifies where item can be charged or discharged.

transferLimit

transferLimit: number

Defines limit for transfering energy in item per 1 time

Methods

addDefaultToCreative

  • addDefaultToCreative(): void
  • Returns void

addRepairItem

  • addRepairItem(itemID: number): void
  • Adds material that can be used to repair the item in the anvil


    Parameters

    • itemID: number

      item id to be used as repair material

    Returns void

allowInOffHand

  • allowInOffHand(): void
  • Allows item to be put in off hand


    Returns void

getModeName

  • getModeName(mode: number): string
  • Parameters

    • mode: number

    Returns string

getModeProperties

  • getModeProperties(mode: number): any
  • Parameters

    • mode: number

    Returns any

makeShot

  • makeShot(item: ItemInstance, player: number): void
  • Parameters

    • item: ItemInstance
    • player: number

    Returns void

onItemUse

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

    • coords: ItemUseCoordinates
    • item: ItemStack
    • block: Tile
    • player: number

    Returns void

onModeSwitch

  • onModeSwitch(item: ItemInstance, player: number): void
  • Parameters

    • item: ItemInstance
    • player: number

    Returns void

onNameOverride

  • onNameOverride(item: ItemInstance, name: string): string
  • Method to get displayed item name.


    Parameters

    • item: ItemInstance

      item stack information

    • name: string

      translated item name

    Returns string

    new name that will be displayed

onNoTargetUse

  • onNoTargetUse(item: ItemStack, player: number): void
  • Parameters

    Returns void

readMode

  • readMode(extra: ItemExtraData): number
  • Parameters

    • extra: ItemExtraData

    Returns number

setCategory

  • setCategory(category: number): void
  • Sets item creative category


    Parameters

    • category: number

      item category, should be integer from 1 to 4.

    Returns void

setEnchantType

  • setEnchantType(type: number, enchantability: number): void
  • Specifies how the item can be enchanted


    Parameters

    • type: number

      enchant type defining whan enchants can or cannot be applied to this item, one of the Native.EnchantType

    • enchantability: number

      quality of the enchants that are applied, the higher this value is, the better enchants you get with the same level

    Returns void

setGlint

  • setGlint(enabled: boolean): void
  • Sets item as glint (like enchanted tools or golden apple)


    Parameters

    • enabled: boolean

      if true, the item will be displayed as glint item

    Returns void

setHandEquipped

  • setHandEquipped(enabled: boolean): void
  • Specifies how the player should hold the item


    Parameters

    • enabled: boolean

      if true, player holds the item as a tool, not as a simple item

    Returns void

protectedsetIcon

  • setIcon(texture: string, index?: number): void
  • Method that can be overrided to modify item textures before item creation.


    Parameters

    • texture: string

      texture name

    • optionalindex: number

      texture index

    Returns void

setLiquidClip

  • setLiquidClip(): void
  • Allows item to click on liquid blocks


    Returns void

setMaxDamage

  • setMaxDamage(maxDamage: number): void
  • Sets item maximum data value


    Parameters

    • maxDamage: number

      maximum data value for the item

    Returns void

setMaxStack

  • setMaxStack(maxStack: number): void
  • Sets item maximum stack size


    Parameters

    • maxStack: number

      maximum stack size for the item

    Returns void

protectedsetName

  • setName(name: string): void
  • Method that can be overrided to modify item name before item creation.


    Parameters

    • name: string

      item name passed to the constructor

    Returns void

setProperties

  • setProperties(props: object): void
  • Sets properties for the item from JSON-like object. Uses vanilla mechanics.


    Parameters

    • props: object

      object containing properties

    Returns void

setRarity

  • setRarity(rarity: number): void
  • Sets item rarity.


    Parameters

    • rarity: number

      one of EnumRarity values

    Returns void