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; } }