diff --git a/src/pocketmine/item/Durable.php b/src/pocketmine/item/Durable.php index 788fab76b..76e6927b3 100644 --- a/src/pocketmine/item/Durable.php +++ b/src/pocketmine/item/Durable.php @@ -59,7 +59,7 @@ abstract class Durable extends Item{ $this->meta = min($this->meta + $amount, $this->getMaxDurability()); if($this->isBroken()){ - $this->pop(); + $this->onBroken(); } return true; @@ -82,6 +82,12 @@ abstract class Durable extends Item{ return 0; } + /** + * Called when the item's damage exceeds its maximum durability. + */ + protected function onBroken() : void{ + $this->pop(); + } /** * Returns the maximum amount of damage this item can take before it breaks.