This short & simple plugin for Spigot and Bukkit servers prevents Phantoms from spawning.
Download the .jar: https://github.com/3urobeat/noPhantomsPlugin/releases/latest
...and put it into the plugins
folder of your Spigot/Bukkit server. Done!
This plugin was tested on 1.16 - 1.20 but should also work on other versions.