Inheritance: extends EntityEvent, implements pocketmine\event\Cancellable
Example #1
0
 public function onCombust(EntityCombustEvent $event)
 {
     if ($event instanceof EntityCombustByBlockEvent) {
         if ($this->purgeStarted) {
             return;
         }
         if ($event->getEntity() instanceof Player and $event->getCombuster() instanceof Fire) {
             $event->setCancelled();
         }
     }
 }
 /**
  * @param Entity $combuster
  * @param Entity $combustee
  * @param int    $duration
  */
 public function __construct(Entity $combuster, Entity $combustee, $duration)
 {
     parent::__construct($combustee, $duration);
     $this->combuster = $combuster;
 }
Example #3
0
 public function onCombust(EntityCombustEvent $event)
 {
     if ($event instanceof EntityCombustByBlockEvent) {
         if ($event->getEntity() instanceof Player and $event->getCombuster() instanceof Fire) {
             $area = $this->db[$event->getEntity()->getLevel()->getFolderName()]->getArea($event->getEntity()->x, $event->getEntity()->z);
             if ($area != null) {
                 if (!$this->db[$event->getEntity()->getLevel()->getFolderName()]->isPvpAllow($area["ID"])) {
                     $event->setCancelled();
                 }
             }
         }
     }
 }
 /**
  * @param EntityCombustEvent $event
  * @priority HIGHEST
  * @ignoreCancelled true
  */
 public function onEntityCombust(EntityCombustEvent $event)
 {
     if (($player = $event->getEntity()) instanceof Player) {
         if (!$this->plugin->getStorage()->getShield($player->getLevel())->isAllowed(Shield::BURNING)) {
             $event->setCancelled(true);
         }
     }
 }
 /**
  * @param Block  $combuster
  * @param Entity $combustee
  * @param int    $duration
  * @param int    $ProtectLevel
  */
 public function __construct(Block $combuster, Entity $combustee, $duration, $ProtectLevel = 0)
 {
     parent::__construct($combustee, $duration, $ProtectLevel);
     $this->combuster = $combuster;
 }