PHP Class pocketmine\item\Item

Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$count
$list SplFixedArray

Protected Properties

Свойство Type Description
$block
$durability
$id
$meta
$name

Méthodes publiques

Méthode 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

Méthode Description
initCreativeItems ( $readFromJson = false )
parseCompoundTag ( string $tag ) : CompoundTag
writeCompoundTag ( CompoundTag $tag ) : string

Method Details

__construct() public méthode

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

__toString() final public méthode

final public __toString ( )

addCreativeItem() public static méthode

public static addCreativeItem ( Item $item )
$item Item

addEnchantment() public méthode

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

canBeActivated() public méthode

public canBeActivated ( ) : boolean
Résultat boolean

canBeConsumed() public méthode

public canBeConsumed ( ) : boolean
Résultat boolean

canBeConsumedBy() public méthode

public canBeConsumedBy ( Entity $entity ) : boolean
$entity pocketmine\entity\Entity
Résultat boolean

canBePlaced() final public méthode

final public canBePlaced ( ) : boolean
Résultat boolean

clearCreativeItems() public static méthode

public static clearCreativeItems ( )

clearCustomBlockData() public méthode

clearCustomName() public méthode

public clearCustomName ( )

clearNamedTag() public méthode

public clearNamedTag ( )

clearRepairCost() public méthode

public clearRepairCost ( )

deepEquals() final public méthode

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

equals() final public méthode

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

fromString() public static méthode

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

get() public static méthode

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

getArmorValue() public méthode

public getArmorValue ( )

getAttackDamage() public méthode

public getAttackDamage ( )

getBlock() public méthode

public getBlock ( ) : Block
Résultat pocketmine\block\Block

getCompoundTag() public méthode

public getCompoundTag ( ) : string
Résultat string

getCount() public méthode

public getCount ( ) : integer
Résultat integer

getCreativeItem() public static méthode

public static getCreativeItem ( integer $index ) : Item
$index integer
Résultat Item

getCreativeItemIndex() public static méthode

public static getCreativeItemIndex ( Item $item ) : integer
$item Item
Résultat integer

getCreativeItems() public static méthode

public static getCreativeItems ( ) : array
Résultat array

getCustomBlockData() public méthode

public getCustomBlockData ( )

getCustomName() public méthode

public getCustomName ( ) : string
Résultat string

getDamage() final public méthode

final public getDamage ( )

getDestroySpeed() public méthode

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

getEnchantment() public méthode

public getEnchantment ( integer $id ) : Enchantment | null
$id integer
Résultat pocketmine\item\enchantment\Enchantment | null

getEnchantmentLevel() public méthode

public getEnchantmentLevel ( integer $id ) : Int
$id integer
Résultat Int level|0(for null)

getEnchantments() public méthode

public getEnchantments ( ) : array
Résultat array

getFuelTime() final public méthode

final public getFuelTime ( )

getId() final public méthode

final public getId ( ) : integer
Résultat integer

getMaxDurability() public méthode

public getMaxDurability ( ) : integer | boolean
Résultat integer | boolean

getMaxStackSize() public méthode

public getMaxStackSize ( ) : integer
Résultat integer

getModifyAttackDamage() public méthode

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

getName() final public méthode

final public getName ( ) : string
Résultat string

getNamedTag() public méthode

public getNamedTag ( )

getNamedTagEntry() public méthode

public getNamedTagEntry ( $name )

getRepairCost() public méthode

public getRepairCost ( ) : integer
Résultat integer

hasCompoundTag() public méthode

public hasCompoundTag ( ) : boolean
Résultat boolean

hasCustomBlockData() public méthode

public hasCustomBlockData ( ) : boolean
Résultat boolean

hasCustomName() public méthode

public hasCustomName ( ) : boolean
Résultat boolean

hasEnchantment() public méthode

public hasEnchantment ( integer $id, integer $level = 1, boolean $compareLevel = false ) : boolean
$id integer
$level integer
$compareLevel boolean
Résultat boolean

hasEnchantments() public méthode

public hasEnchantments ( ) : boolean
Résultat boolean

hasRepairCost() public méthode

public hasRepairCost ( ) : boolean
Résultat boolean

init() public static méthode

public static init ( $readFromJson = false )

isArmor() public méthode

public isArmor ( )

isAxe() public méthode

public isAxe ( )

isBoots() public méthode

public isBoots ( )

isChestplate() public méthode

public isChestplate ( )

isCreativeItem() public static méthode

public static isCreativeItem ( Item $item ) : boolean
$item Item
Résultat boolean

isHelmet() public méthode

public isHelmet ( )

isHoe() public méthode

public isHoe ( )

isLeggings() public méthode

public isLeggings ( )

isPickaxe() public méthode

public isPickaxe ( )

isPlaceable() final public méthode

final public isPlaceable ( ) : boolean
Résultat boolean

isShears() public méthode

public isShears ( )

isShovel() public méthode

public isShovel ( )

isSword() public méthode

public isSword ( )

isTool() public méthode

public isTool ( ) : boolean
Résultat boolean

onActivate() public méthode

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 méthode

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

removeCreativeItem() public static méthode

public static removeCreativeItem ( Item $item )
$item Item

setCompoundTag() public méthode

public setCompoundTag ( $tags )

setCount() public méthode

public setCount ( integer $count )
$count integer

setCustomBlockData() public méthode

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

setCustomName() public méthode

public setCustomName ( string $name )
$name string

setDamage() public méthode

public setDamage ( $meta )

setNamedTag() public méthode

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

setRepairCost() public méthode

public setRepairCost ( integer $cost )
$cost integer

useOn() public méthode

public useOn ( Entity | Block $object ) : boolean
$object pocketmine\entity\Entity | pocketmine\block\Block
Résultat boolean

Property Details

$block protected_oe property

protected $block

$count public_oe property

public $count

$durability protected_oe property

protected $durability

$id protected_oe property

protected $id

$list public_oe static_oe property

public static SplFixedArray $list
Résultat SplFixedArray

$meta protected_oe property

protected $meta

$name protected_oe property

protected $name