public getItemInHand ( ) : |
||
Результат | Returns the item the player is currently holding |
public function getItemInHand()
{
$item = $this->getItem($this->getHeldItemSlot());
if ($item instanceof Item) {
return $item;
} else {
return Item::get(Item::AIR, 0, 0);
}
}