how to know if a server is in spigot or ppaper code example
Example: How to check server version bukkit spigot paper
if (Bukkit.getVersion().contains("1.8.1")) {
//stuff
}
if (Bukkit.getVersion().contains("1.8.1")) {
//stuff
}