Skip to content

Durable ​

abstract class · pocketmine\item\Durable · source

Extends Item

Properties ​

$damage protected ​

php
protected int $damage

Methods ​

applyDamage() ​

php
public function applyDamage(int $amount) : bool

Applies damage to the item.

deserializeCompoundTag() protected ​

php
protected function deserializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

getDamage() ​

php
public function getDamage() : int

getMaxDurability() ​

php
abstract public function getMaxDurability() : int

Returns the maximum amount of damage this item can take before it breaks.

getUnbreakingDamageReduction() protected ​

php
protected function getUnbreakingDamageReduction(int $amount) : int

isBroken() ​

php
public function isBroken() : bool

Returns whether the item is broken.

isUnbreakable() ​

php
public function isUnbreakable() : bool

Returns whether this item will take damage when used.

onBroken() protected ​

php
protected function onBroken() : void

Called when the item's damage exceeds its maximum durability.

serializeCompoundTag() protected ​

php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

setDamage() ​

php
public function setDamage(int $damage) : \pocketmine\item\Item

setUnbreakable() ​

php
public function setUnbreakable(bool $value = true) : self

Sets whether the item will take damage when used.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.