PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
EntityShootBowEvent.php
1 <?php
2 
22 namespace pocketmine\event\entity;
23 
29 
30 class EntityShootBowEvent extends EntityEvent implements Cancellable{
31  public static $handlerList = null;
32  public static $eventPool = [];
33  public static $nextEvent = 0;
34 
36  private $bow;
38  private $projectile;
40  private $force;
41 
48  public function __construct(Living $shooter, Item $bow, Projectile $projectile, $force){
49  $this->entity = $shooter;
50  $this->bow = $bow;
51  $this->projectile = $projectile;
52  $this->force = $force;
53  }
54 
58  public function getEntity(){
59  return $this->entity;
60  }
61 
65  public function getBow(){
66  return $this->bow;
67  }
68 
72  public function getProjectile(){
73  return $this->projectile;
74  }
75 
79  public function setProjectile(Entity $projectile){
80  if($projectile !== $this->projectile){
81  if(count($this->projectile->getViewers()) === 0){
82  $this->projectile->kill();
83  $this->projectile->close();
84  }
85  $this->projectile = $projectile;
86  }
87  }
88 
92  public function getForce(){
93  return $this->force;
94  }
95 
99  public function setForce($force){
100  $this->force = $force;
101  }
102 
103 
104 }
__construct(Living $shooter, Item $bow, Projectile $projectile, $force)