pocketmine\entity\Entity::getPosition PHP Method

getPosition() public method

public getPosition ( )
    public function getPosition()
    {
        return new Position($this->x, $this->y, $this->z, $this->level);
    }

Usage Example

 public function isEntityCollided(Entity $entity = null)
 {
     foreach ($this->getLevel()->getEntities() as $entity) {
         if ($entity instanceof Minecart && $entity->getPosition() === $this) {
             return true;
         }
     }
     return false;
 }