abstractArmorElectric
Hierarchy
Implements
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
stringID: string
name: string
params: ArmorParams
maxCharge: number
transferLimit: number
tier: number
optionalinCreative: boolean
Returns ArmorElectric
Properties
armorMaterial
armorType
String type of armor.
canProvideEnergy
If true, energy can be extracted from item
defence
Defence value for armor piece.
energy
Type of energy stored in item
icon
Item texture data
Type declaration
meta: number
name: string
readonlyid
Item numeric id
inCreative
item
Native class used to set item properties
maxCharge
Energy capacity of item
maxDamage
Maximum data value of the item
maxStack
Maximum stack size of the item
name
Item name
readonlystringID
Item string id
texture
Armor texture.
tier
Tier of item. Specifies where item can be charged or discharged.
transferLimit
Defines limit for transfering energy in item per 1 time
Methods
addDefaultToCreative
Returns void
addRepairItem
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
Allows item to be put in off hand
Returns void
onHurt
This event is called when the damage is dealt to the player that has this armor put on.
Parameters
params: { attacker: number; damage: number; type: number }
additional data about damage
attacker: number
damage: number
type: number
item: ItemInstance
armor item instance
index: number
armor slot index (from 0 to 3).
playerUid: number
player entity uid
Returns ItemInstance
the item instance to change armor item, if nothing is returned, armor will be damaged by default.
onNameOverride
Parameters
item: ItemInstance
name: string
Returns string
onTick
This event is called when the damage is dealt to the player that has this armor put on.
Parameters
item: ItemInstance
armor item instance
index: number
armor slot index (from 0 to 3).
playerUid: number
player entity uid
Returns ItemInstance
the item instance to change armor item, if nothing is returned, armor will not be changed.
preventDamaging
Prevents armor from being damaged.
Returns void
setArmorTexture
Method that can be overrided to modify armor texture before item creation.
Parameters
name: string
armor texture path
Returns void
setCategory
Sets item creative category
Parameters
category: number
item category, should be integer from 1 to 4.
Returns void
setEnchantType
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
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
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
Method that can be overrided to modify item textures before item creation.
Parameters
texture: string
texture name
optionalindex: number
texture index
Returns void
setLiquidClip
Allows item to click on liquid blocks
Returns void
setMaterial
Sets armor properties from armor material.
Parameters
armorMaterial: string | ArmorMaterial
material name or object.
Returns void
setMaxDamage
Sets item maximum data value
Parameters
maxDamage: number
maximum data value for the item
Returns void
setMaxStack
Sets item maximum stack size
Parameters
maxStack: number
maximum stack size for the item
Returns void
protectedsetName
Method that can be overrided to modify item name before item creation.
Parameters
name: string
item name passed to the constructor
Returns void
setProperties
Sets properties for the item from JSON-like object. Uses vanilla mechanics.
Parameters
props: object
object containing properties
Returns void
setRarity
Sets item rarity.
Parameters
rarity: number
one of
EnumRarity
values
Returns void
staticregisterListeners
Registers all armor functions from given object.
Parameters
id: number
armor item id
armorFuncs: ArmorListeners | ItemArmor
object that implements
ArmorListener
interface
Returns void
Object containing armor properties specified by its material.