mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Check to see if the player can start using the Releasable item. (#4532)
This commit is contained in:
@@ -123,4 +123,8 @@ class Bow extends Tool implements Releasable{
|
||||
|
||||
return ItemUseResult::SUCCESS();
|
||||
}
|
||||
|
||||
public function canStartUsingItem(Player $player) : bool{
|
||||
return !$player->hasFiniteResources() || $player->getOffHandInventory()->contains($arrow = VanillaItems::ARROW()) || $player->getInventory()->contains($arrow);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user