pocketmine\entity\Projectile::__construct PHP Method

__construct() public method

public __construct ( pocketmine\level\format\FullChunk $chunk, CompoundTag $nbt, Entity $shootingEntity = null )
$chunk pocketmine\level\format\FullChunk
$nbt pocketmine\nbt\tag\CompoundTag
$shootingEntity Entity
    public function __construct(FullChunk $chunk, CompoundTag $nbt, Entity $shootingEntity = null)
    {
        $this->shootingEntity = $shootingEntity;
        if ($shootingEntity !== null) {
            $this->setDataProperty(self::DATA_SHOOTER_ID, self::DATA_TYPE_LONG, $shootingEntity->getId());
        }
        parent::__construct($chunk, $nbt);
    }

Usage Example

Beispiel #1
0
 public function __construct(FullChunk $chunk, CompoundTag $nbt, Entity $shootingEntity = null)
 {
     if (!isset($nbt->PotionId)) {
         $nbt->PotionId = new ShortTag("PotionId", Potion::AWKWARD);
     }
     parent::__construct($chunk, $nbt, $shootingEntity);
     $this->setDataProperty(self::DATA_POTION_ID, self::DATA_TYPE_SHORT, Potion::getEffectId($this->getPotionId()));
 }
All Usage Examples Of pocketmine\entity\Projectile::__construct