typeOfHit = self::TYPE_BLOCK_COLLISION; $ob->blockX = $x; $ob->blockY = $y; $ob->blockZ = $z; $ob->sideHit = $side; $ob->hitVector = new Vector3($hitVector->x, $hitVector->y, $hitVector->z); return $ob; } /** * @param Entity $entity * * @return MovingObjectPosition */ public static function fromEntity(Entity $entity) : MovingObjectPosition{ $ob = new MovingObjectPosition; $ob->typeOfHit = self::TYPE_ENTITY_COLLISION; $ob->entityHit = $entity; $ob->hitVector = new Vector3($entity->x, $entity->y, $entity->z); return $ob; } }