PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
PlayerItemHeldEvent.php
1 <?php
2 
22 namespace pocketmine\event\player;
23 
24 use pocketmine\Event;
28 
29 class PlayerItemHeldEvent extends PlayerEvent implements Cancellable{
30  public static $handlerList = null;
31  public static $eventPool = [];
32  public static $nextEvent = 0;
33 
34  private $item;
35  private $slot;
36  private $inventorySlot;
37 
38  public function __construct(Player $player, Item $item, $inventorySlot, $slot){
39  $this->player = $player;
40  $this->item = $item;
41  $this->inventorySlot = (int) $inventorySlot;
42  $this->slot = (int) $slot;
43  }
44 
45  public function getSlot(){
46  return $this->slot;
47  }
48 
49  public function getInventorySlot(){
50  return $this->inventorySlot;
51  }
52 
53  public function getItem(){
54  return $this->item;
55  }
56 
57 }