PHP Class pocketmine\item\Item

Show file Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$count
$list SplFixedArray

Protected Properties

Property Type Description
$block
$durability
$id
$meta
$name

Public Methods

Method Description
__construct ( $id, $meta, integer $count = 1, string $name = "Unknown" )
__toString ( )
addCreativeItem ( Item $item )
addEnchantment ( Enchantment $ench )
canBeActivated ( ) : boolean
canBeConsumed ( ) : boolean
canBeConsumedBy ( Entity $entity ) : boolean
canBePlaced ( ) : boolean
clearCreativeItems ( )
clearCustomBlockData ( )
clearCustomName ( )
clearNamedTag ( )
clearRepairCost ( )
deepEquals ( Item $item, boolean $checkDamage = true, boolean $checkCompound = true, boolean $checkCount = false ) : boolean
equals ( Item $item, boolean $checkDamage = true, boolean $checkCompound = true, boolean $checkCount = false ) : boolean
fromString ( string $str, boolean $multiple = false ) : Item[] | Item
get ( $id, $meta, integer $count = 1, $tags = "" ) : Item
getArmorValue ( )
getAttackDamage ( )
getBlock ( ) : Block
getCompoundTag ( ) : string
getCount ( ) : integer
getCreativeItem ( integer $index ) : Item
getCreativeItemIndex ( Item $item ) : integer
getCreativeItems ( ) : array
getCustomBlockData ( )
getCustomName ( ) : string
getDamage ( )
getDestroySpeed ( Block $block, Player $player )
getEnchantment ( integer $id ) : Enchantment | null
getEnchantmentLevel ( integer $id ) : Int
getEnchantments ( ) : array
getFuelTime ( )
getId ( ) : integer
getMaxDurability ( ) : integer | boolean
getMaxStackSize ( ) : integer
getModifyAttackDamage ( Entity $target )
getName ( ) : string
getNamedTag ( )
getNamedTagEntry ( $name )
getRepairCost ( ) : integer
hasCompoundTag ( ) : boolean
hasCustomBlockData ( ) : boolean
hasCustomName ( ) : boolean
hasEnchantment ( integer $id, integer $level = 1, boolean $compareLevel = false ) : boolean
hasEnchantments ( ) : boolean
hasRepairCost ( ) : boolean
init ( $readFromJson = false )
isArmor ( )
isAxe ( )
isBoots ( )
isChestplate ( )
isCreativeItem ( Item $item ) : boolean
isHelmet ( )
isHoe ( )
isLeggings ( )
isPickaxe ( )
isPlaceable ( ) : boolean
isShears ( )
isShovel ( )
isSword ( )
isTool ( ) : boolean
onActivate ( Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz )
onConsume ( Entity $entity )
removeCreativeItem ( Item $item )
setCompoundTag ( $tags )
setCount ( integer $count )
setCustomBlockData ( CompoundTag $compound )
setCustomName ( string $name )
setDamage ( $meta )
setNamedTag ( CompoundTag $tag )
setRepairCost ( integer $cost )
useOn ( Entity | Block $object ) : boolean

Private Methods

Method Description
initCreativeItems ( $readFromJson = false )
parseCompoundTag ( string $tag ) : CompoundTag
writeCompoundTag ( CompoundTag $tag ) : string

Method Details

__construct() public method

public __construct ( $id, $meta, integer $count = 1, string $name = "Unknown" )
$count integer
$name string

__toString() final public method

final public __toString ( )

addCreativeItem() public static method

public static addCreativeItem ( Item $item )
$item Item

addEnchantment() public method

public addEnchantment ( Enchantment $ench )
$ench pocketmine\item\enchantment\Enchantment

canBeActivated() public method

public canBeActivated ( ) : boolean
return boolean

canBeConsumed() public method

public canBeConsumed ( ) : boolean
return boolean

canBeConsumedBy() public method

public canBeConsumedBy ( Entity $entity ) : boolean
$entity pocketmine\entity\Entity
return boolean

canBePlaced() final public method

final public canBePlaced ( ) : boolean
return boolean

clearCreativeItems() public static method

public static clearCreativeItems ( )

clearCustomBlockData() public method

clearCustomName() public method

public clearCustomName ( )

clearNamedTag() public method

public clearNamedTag ( )

clearRepairCost() public method

public clearRepairCost ( )

deepEquals() final public method

final public deepEquals ( Item $item, boolean $checkDamage = true, boolean $checkCompound = true, boolean $checkCount = false ) : boolean
$item Item
$checkDamage boolean
$checkCompound boolean
$checkCount boolean
return boolean

equals() final public method

final public equals ( Item $item, boolean $checkDamage = true, boolean $checkCompound = true, boolean $checkCount = false ) : boolean
$item Item
$checkDamage boolean
$checkCompound boolean
$checkCount boolean
return boolean

fromString() public static method

public static fromString ( string $str, boolean $multiple = false ) : Item[] | Item
$str string
$multiple boolean
return Item[] | Item

get() public static method

public static get ( $id, $meta, integer $count = 1, $tags = "" ) : Item
$count integer
return Item

getArmorValue() public method

public getArmorValue ( )

getAttackDamage() public method

public getAttackDamage ( )

getBlock() public method

public getBlock ( ) : Block
return pocketmine\block\Block

getCompoundTag() public method

public getCompoundTag ( ) : string
return string

getCount() public method

public getCount ( ) : integer
return integer

getCreativeItem() public static method

public static getCreativeItem ( integer $index ) : Item
$index integer
return Item

getCreativeItemIndex() public static method

public static getCreativeItemIndex ( Item $item ) : integer
$item Item
return integer

getCreativeItems() public static method

public static getCreativeItems ( ) : array
return array

getCustomBlockData() public method

public getCustomBlockData ( )

getCustomName() public method

public getCustomName ( ) : string
return string

getDamage() final public method

final public getDamage ( )

getDestroySpeed() public method

public getDestroySpeed ( Block $block, Player $player )
$block pocketmine\block\Block
$player pocketmine\Player

getEnchantment() public method

public getEnchantment ( integer $id ) : Enchantment | null
$id integer
return pocketmine\item\enchantment\Enchantment | null

getEnchantmentLevel() public method

public getEnchantmentLevel ( integer $id ) : Int
$id integer
return Int level|0(for null)

getEnchantments() public method

public getEnchantments ( ) : array
return array

getFuelTime() final public method

final public getFuelTime ( )

getId() final public method

final public getId ( ) : integer
return integer

getMaxDurability() public method

public getMaxDurability ( ) : integer | boolean
return integer | boolean

getMaxStackSize() public method

public getMaxStackSize ( ) : integer
return integer

getModifyAttackDamage() public method

public getModifyAttackDamage ( Entity $target )
$target pocketmine\entity\Entity

getName() final public method

final public getName ( ) : string
return string

getNamedTag() public method

public getNamedTag ( )

getNamedTagEntry() public method

public getNamedTagEntry ( $name )

getRepairCost() public method

public getRepairCost ( ) : integer
return integer

hasCompoundTag() public method

public hasCompoundTag ( ) : boolean
return boolean

hasCustomBlockData() public method

public hasCustomBlockData ( ) : boolean
return boolean

hasCustomName() public method

public hasCustomName ( ) : boolean
return boolean

hasEnchantment() public method

public hasEnchantment ( integer $id, integer $level = 1, boolean $compareLevel = false ) : boolean
$id integer
$level integer
$compareLevel boolean
return boolean

hasEnchantments() public method

public hasEnchantments ( ) : boolean
return boolean

hasRepairCost() public method

public hasRepairCost ( ) : boolean
return boolean

init() public static method

public static init ( $readFromJson = false )

isArmor() public method

public isArmor ( )

isAxe() public method

public isAxe ( )

isBoots() public method

public isBoots ( )

isChestplate() public method

public isChestplate ( )

isCreativeItem() public static method

public static isCreativeItem ( Item $item ) : boolean
$item Item
return boolean

isHelmet() public method

public isHelmet ( )

isHoe() public method

public isHoe ( )

isLeggings() public method

public isLeggings ( )

isPickaxe() public method

public isPickaxe ( )

isPlaceable() final public method

final public isPlaceable ( ) : boolean
return boolean

isShears() public method

public isShears ( )

isShovel() public method

public isShovel ( )

isSword() public method

public isSword ( )

isTool() public method

public isTool ( ) : boolean
return boolean

onActivate() public method

public onActivate ( Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz )
$level pocketmine\level\Level
$player pocketmine\Player
$block pocketmine\block\Block
$target pocketmine\block\Block

onConsume() public method

public onConsume ( Entity $entity )
$entity pocketmine\entity\Entity

removeCreativeItem() public static method

public static removeCreativeItem ( Item $item )
$item Item

setCompoundTag() public method

public setCompoundTag ( $tags )

setCount() public method

public setCount ( integer $count )
$count integer

setCustomBlockData() public method

public setCustomBlockData ( CompoundTag $compound )
$compound pocketmine\nbt\tag\CompoundTag

setCustomName() public method

public setCustomName ( string $name )
$name string

setDamage() public method

public setDamage ( $meta )

setNamedTag() public method

public setNamedTag ( CompoundTag $tag )
$tag pocketmine\nbt\tag\CompoundTag

setRepairCost() public method

public setRepairCost ( integer $cost )
$cost integer

useOn() public method

public useOn ( Entity | Block $object ) : boolean
$object pocketmine\entity\Entity | pocketmine\block\Block
return boolean

Property Details

$block protected property

protected $block

$count public property

public $count

$durability protected property

protected $durability

$id protected property

protected $id

$list public static property

public static SplFixedArray $list
return SplFixedArray

$meta protected property

protected $meta

$name protected property

protected $name