mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Implemented basic tool durability
This commit is contained in:
@@ -1473,6 +1473,9 @@ class Player{
|
||||
$target->harm($damage, $this->eid);
|
||||
if($slot->isTool() === true and ($this->gamemode & 0x01) === 0){
|
||||
$slot->useOn($target);
|
||||
if($slot->getMetadata() >= $slot->getMaxDurability()){
|
||||
$this->setSlot($this->slot, new Item(AIR, 0, 0), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user