pocketmine\entity\Entity::isSneaking PHP Method

isSneaking() public method

public isSneaking ( )
    public function isSneaking()
    {
        return $this->getDataFlag(self::DATA_FLAGS, self::DATA_FLAG_SNEAKING);
    }

Usage Example

Example #1
0
 public function onEntityCollide(Entity $entity)
 {
     if (abs($entity->motionY) < 0.1 && !$entity->isSneaking()) {
         (double) ($d0 = 0.4 + abs($entity->motionY) * 0.2);
         $entity->motionX *= $d0;
         $entity->motionZ *= $d0;
     }
 }