The Swooper will always try to position itself vertically above the player to drop a boulder on them.
Swoopers can fly and drop a boulder on the player this boulder will make 40 damage.
After few seconds the boulder will disappear and the Swooper will have another one.
The usual 40 damage of the boulder can be reduced to 1 damage by wearing a helmet with the boulder protection attribute.
You should try to bait out their boulder and attack/freeze them while they are close to the ground.
Alternatively, you can always use ranged attacks to get rid of them.