コード例 #1
0
 /**
  * @param Entity    $damager
  * @param Entity    $entity
  * @param int       $cause
  * @param int|int[] $damage
  * @param float     $knockBack
  */
 public function __construct(Entity $damager, Entity $entity, $cause, $damage, $knockBack = 0.4)
 {
     $this->damager = $damager;
     $this->knockBack = $knockBack;
     parent::__construct($entity, $cause, $damage);
     $this->addAttackerModifiers($damager);
 }
コード例 #2
0
 /**
  * @param Block     $damager
  * @param Entity    $entity
  * @param int       $cause
  * @param int|int[] $damage
  */
 public function __construct(Block $damager, Entity $entity, $cause, $damage)
 {
     $this->damager = $damager;
     parent::__construct($entity, $cause, $damage);
 }