Detecting FeatherMC
Most plugins never need to know. If you want to show it in a debug command or enable something only on FeatherMC, check the brand name. The brand ID is deliberately still Paper’s, and FeatherMC also reports compatibility with its own ID, so plugins that check for either one work.
import io.papermc.paper.ServerBuildInfo;
public static boolean isFeatherMC() { return "FeatherMC".equals(ServerBuildInfo.buildInfo().brandName());}
// Bukkit.getName() -> "FeatherMC"// ServerBuildInfo.buildInfo().brandId() -> papermc:paper
// buildInfo().isBrandCompatible(ServerBuildInfo.BRAND_PAPER_ID) -> true// buildInfo().isBrandCompatible(Key.key("feathermc", "feather")) -> trueDon’t use this to work around Paper behaviour. If something behaves differently on FeatherMC than on Paper in a way your plugin can see, that is a FeatherMC bug and worth reporting.
If your plugin uses the FeatherMC API, Feather.isAvailable() is the guard to use before calling any FeatherMC-specific method.
Adapted from the PaperMC docs (CC BY-SA 4.0). About these docs.