Mod Management
The Feather Server API allows you to manage which mods players can use on your server. This includes blocking mods entirely, enabling or disabling specific mods for individual players, and retrieving information about which mods are blocked or enabled.
Overview
Mod management is handled through the FeatherPlayer interface, which provides methods for:
Blocking mods (preventing players from using them)
Unblocking mods (allowing players to use previously blocked mods)
Getting a list of blocked mods
Enabling specific mods for players
Disabling specific mods for players
Getting a list of enabled mods
These operations allow server owners to create a consistent gameplay experience by controlling which client-side mods can be used on their server.
Basic Usage
Accessing the API
To manage mods, you'll first need to get a reference to a FeatherPlayer object:
// Get a player by UUID
FeatherPlayer player = FeatherAPI.getPlayerService().getPlayer(playerUUID);
// Or get all Feather players
Collection allPlayers = FeatherAPI.getPlayerService().getPlayers();
Working with FeatherMod Objects
Most mod management operations use FeatherMod objects. A FeatherMod represents a built-in mod in Feather and is identified by its name:
// Create a FeatherMod object
FeatherMod perspectiveMod = new FeatherMod("perspective");
Blocking and Unblocking Mods
Blocking Mods
Blocking mods prevents players from enabling them, even manually. When a mod is blocked:
If it was enabled, it will be automatically disabled
The player cannot re-enable it until it is unblocked
// Block a single mod
Collection modsToBlock = Collections.singletonList(new FeatherMod("perspective"));
player.blockMods(modsToBlock);
// Block multiple mods
List multipleModsToBlock = Arrays.asList(
new FeatherMod("motion_blur"),
new FeatherMod("zoom"),
new FeatherMod("timer")
);
player.blockMods(multipleModsToBlock);
info
Blocking a mod is more restrictive than disabling it. Blocked mods cannot be enabled by the player at all, while disabled mods can still be enabled through the client's mod menu.
Unblocking Mods
Unblocking mods allows players to enable the mods again through their client mod menu:
// Unblock a single mod
Collection modsToUnblock = Collections.singletonList(new FeatherMod("perspective"));
player.unblockMods(modsToUnblock);
// Unblock multiple mods
List multipleModsToUnblock = Arrays.asList(
new FeatherMod("motion_blur"),
new FeatherMod("zoom"),
new FeatherMod("timer")
);
player.unblockMods(multipleModsToUnblock);
Getting Blocked Mods
You can retrieve a list of all mods that are currently blocked for a player:
CompletableFuture> blockedModsFuture = player.getBlockedMods();
blockedModsFuture.thenAccept(blockedMods -> {
for (FeatherMod mod : blockedMods) {
// Process each blocked mod
System.out.println("Blocked mod: " + mod.getName());
}
});
Enabling and Disabling Mods
Enabling Mods
Enabling a mod activates it for the player. Note that this only works if the mod is not blocked:
// Enable a single mod
Collection modsToEnable = Collections.singletonList(new FeatherMod("coordinates"));
player.enableMods(modsToEnable);
// Enable multiple mods
List multipleModsToEnable = Arrays.asList(
new FeatherMod("item_physics"),
new FeatherMod("saturation"),
new FeatherMod("fps")
);
player.enableMods(multipleModsToEnable);
Disabling Mods
Disabling a mod deactivates it for the player:
// Disable a single mod
Collection modsToDisable = Collections.singletonList(new FeatherMod("perspective"));
player.disableMods(modsToDisable);
// Disable multiple mods
List multipleModsToDisable = Arrays.asList(
new FeatherMod("motion_blur"),
new FeatherMod("zoom"),
new FeatherMod("timer")
);
player.disableMods(multipleModsToDisable);
Getting Enabled Mods
You can retrieve a list of all mods that are currently enabled for a player:
CompletableFuture> enabledModsFuture = player.getEnabledMods();
enabledModsFuture.thenAccept(enabledMods -> {
for (FeatherMod mod : enabledMods) {
// Process each enabled mod
System.out.println("Enabled mod: " + mod.getName());
}
});
Reference
Common Feather Mods
Here are some common Feather mods you might want to manage:
Name Slug Description
Team Tracker teamtracker Add indicator to see teammate location
Animations animations Modify player animations
Armor Bar armorBar Extra armor bar features (Credits: RedLime)
Armor Status armorStatus Display your armor durability
Attack Indicator attackIndicator Add extra actions to your attack indicator
Autohide HUD autohidehud Automatically hide parts of the HUD
Auto Perspective autoperspective Automatically switch perspectives on events
Auto Text autoText Keybind macros for commands and text
Backups backups Backups for your singleplayer world
Block Indicator blockIndicator Show info about the block you're looking at
Block Overlay blockOverlay Add overlay and outline to blocks
Boss Bar bossBar Customize your bossbar
Brightness brightness Adjust your Brightness Settings & Night Vision on demand
Camera camera Adds useful camera utilities
Color Saturation colorSaturation Adjust your display color saturation settings
Combo Display comboDisplay Display number of consecutive hits
Coordinates coordinates Display your location and world info
CPS cps Show your clicks per second
Custom Crosshair crosshair Customize your crosshair
Cull Logs culllogs Automatically remove old log files
Custom Advancements Screen customadvancementsscreen Show more information about advancement requirements
Custom Chat customChat Tweak your chat display
Custom F3 customf3 Customize your debug screen
Custom Fog customfog Custom fog settings and clear water
Damage Indicator damageIndicator Show mob health information
Dark Mode darkmode Dark mode for Minecraft INVENTORY GUI
Death Info deathInfo Show information on death
Direction direction Display your cardinal direction
Discord discordRP Share your current status on Discord
Drop Prevention dropprevention Lock items in your hotbar
Elytras elytras Extra elytra features and chestplate swapping
FOV Changer fovChanger Customize field of view
FPS fps Display your frames per second
Glint glint Customize color of enchants and other settings
Hearts hearts Replaces multiple vanilla heart rows with a single row
Hitbox hitbox Adds hitboxes around entities
Hit Indicator hitindicator Add indicators where you receive damage
Horses horses Add extra features and stats to horses
Hypixel hypixel Useful mods for Hypixel
Inventory inventory Useful mods for inventory management
Item Counter itemCounter Count items in your inventory
Item Despawn itemdespawn Make items flash when they're about to despawn
Item Info itemInfo1 Display enchants when picking up an item
Item Physic itemPhysic Cool item dropping physics
Jump Reset jumpreset Notifies the player about how close they were to achieving a successful jump reset
Keystrokes keystrokes Display your key presses
Light Level Overlay lightleveloverlay Displays overlay indicating light levels
Loot Beams lootBeams Add beam to dropped items
Mob Overlay mobOverlay Add overlay and outline to mobs
Motion Blur motionBlur Blur your vision, make sure it's not too high
Mousestrokes mousestrokes Displays mouse movement
Nametags nametags Modify nametag mechanics
Nick Hider nickHider Hide your nick and skin
Pack Display packdisplay Displays your current texture pack
Pack Organizer packOrganizer Improved resource pack page w/ folder support and extra features
Perspective perspective Freelook
Ping ping Display your ping to the server
Player Model playerModel Render your player model in HUD
Playtime playtime Show time game open or in-game
Potion Effects potionEffects Display potion effects
Reach Display reachDisplay Shows the distance when hitting a player
Reconnect reconnect Automatically reconnect to servers
Saturation saturation Adds saturation visualization food tooltips
Scoreboard scoreboard Customize scoreboard
Screenshot screenshot Extra screenshot features
Keybind Search searchkeybind Adds a keybind search popup overlay
Server Address serverAddress Shows the server address
Shulker Tooltips shulkertooltips See the contents of shulker boxes and other containers
Snaplook snaplook Snap to a particular perspective
Sound Filters soundfilters Adds sound enhancing features / reverb
Speed Meter speedMeter Show your current velocity
Stopwatch stopwatch1 Start and stop a stopwatch with a keybind
Subtitles subtitles Add color and other features to subtitles
System Resources systemresources Show system resources
Tablist tablist Tweak tablist settings
Tier Tagger tiertagger Displays tier from Vanilla PvP Tierlist
Time time Display the current time
Time Changer timeChanger Change the time locally
Title Tweaker titletweaker Make adjustments to the Title Display
TNT Timer tnttimer Adds a timer to your TNT explosions
Toast Control toastcontrol Modify notification toast mechanics
Toggle Sprint toggleSprint Toggle your sprint and sneak key
Tooltips tooltips Tooltip Enhancements
Totem totem Extra totem features
TPS tps Estimate server TPS
UHC Overlay uhcoverlay Resize popular UHC items to make them easier to find
UI Scaling uiScaling Can potentially affect other mods, USE WITH CAUTION!
ViewModel viewModel Adjust player viewmodel
Voice voice Speak with other Feather players
Waypoints waypoints Render waypoints on a map
Weather Changer weatherchanger Change the weather locally
Zoom zoom Zoom in and out of objects
Discord Rich Presence
Overview
Discord Rich Presence allows your Minecraft server to customize how players appear in Discord while playing on your server. With the Feather Server API, you can dynamically update a player's Discord status to show:
Custom server icons
Activity descriptions
Player counts and party sizes
Timestamps for activities
And more!
This feature helps promote your server through players' Discord profiles, enhances the social experience, and provides useful information to friends viewing a player's status.
A Discord profile with custom game status showing server name, activity details, player count, and server icon
Image shows a Discord profile with custom game status showing server name, activity details, player count, and server icon
Basic Usage
Setting Discord Activity
To set a player's Discord activity, use the MetaService through FeatherAPI:
DiscordActivity activity = DiscordActivity.builder()
.withImage("https://example.com/server-icon.png")
.withImageText("Epic Survival Server")
.withState("Mining diamonds")
.withDetails("Join us at play.example.com")
.build();
FeatherAPI.getMetaService().updateDiscordActivity(player, activity);
Clearing Discord Activity
To clear a player's Discord activity when appropriate:
FeatherAPI.getMetaService().clearDiscordActivity(player);
Creating Discord Activities
The core component is the DiscordActivity class which uses a builder pattern for easy configuration. All properties are optional, allowing you to use just what you need.
Essential Properties
DiscordActivity.builder()
// Image shown in Discord (URL to your image)
.withImage("https://example.com/server-icon.png")
// Text shown when hovering over the image
.withImageText("My Amazing Server")
// The player's current activity (shown as smaller text)
.withState("Fighting the Ender Dragon")
// Main description line (shown as larger text)
.withDetails("Join us at play.example.com")
.build();
Advanced Features
Party Size
Show how many players are in a party or team:
DiscordActivity.builder()
// Other properties...
.withPartySize(4, 6) // Current: 4, Maximum: 6
.build();
Timestamps
Show how long an activity has been in progress or when it will end:
long now = System.currentTimeMillis();
long endTime = now + (30 * 60 * 1000); // 30 minutes from now
DiscordActivity.builder()
// Other properties...
.withStartTimestamp(now)
.withEndTimestamp(endTime)
.build();
Common Use Cases
Player Joins Server
Update the player's Discord status when they join your server:
FeatherAPI.getEventService().subscribe(PlayerHelloEvent.class, event -> {
FeatherPlayer player = event.getPlayer();
DiscordActivity activity = DiscordActivity.builder()
.withImage("https://example.com/server-icon.png")
.withImageText("Epic Survival Server")
.withState("Just joined the server")
.withDetails("Playing on Epic Survival")
.withStartTimestamp(System.currentTimeMillis())
.build();
FeatherAPI.getMetaService().updateDiscordActivity(player, activity);
});
Player Enters a Minigame
Update the activity when a player enters a specific game or area:
// When player joins a minigame
public void onPlayerJoinMinigame(FeatherPlayer player, String gameName, int playerCount, int maxPlayers) {
DiscordActivity activity = DiscordActivity.builder()
.withImage("https://example.com/minigames/" + gameName.toLowerCase() + ".png")
.withImageText(gameName)
.withState("Playing " + gameName)
.withDetails("Round starting soon")
.withPartySize(playerCount, maxPlayers)
.withStartTimestamp(System.currentTimeMillis())
.build();
FeatherAPI.getMetaService().updateDiscordActivity(player, activity);
}
Player Completes an Achievement
Update the status to showcase a player's accomplishment:
public void onPlayerAchievement(FeatherPlayer player, String achievementName) {
DiscordActivity activity = DiscordActivity.builder()
.withImage("https://example.com/achievements/trophy.png")
.withImageText("Achievement Unlocked!")
.withState("Earned: " + achievementName)
.withDetails("Playing on Epic Survival")
.build();
FeatherAPI.getMetaService().updateDiscordActivity(player, activity);
// Reset to normal status after 5 minutes
Bukkit.getScheduler().runTaskLater(plugin, () -> {
updateDefaultActivity(player);
}, 6000); // 5 minutes in ticks
}
Overview
The Server List Background feature allows server owners to customize how their server appears in Feather's server list by setting a custom background image. This enhances server branding and creates a more visually appealing entry in the server list for players using Feather.
A custom background image displayed behind a server entry in Feather's server list.
A custom background image displayed behind a server entry in Feather's server list.
Basic Usage
Here's a simple example of setting a server list background:
try {
// Get the MetaService from the FeatherAPI
MetaService metaService = FeatherAPI.getMetaService();
// Create a background from an image file
ServerListBackground background = metaService.getServerListBackgroundFactory()
.byPath(plugin.getDataFolder().toPath().resolve("server-background.png"));
// Set the background
metaService.setServerListBackground(background);
} catch (ServerListBackgroundException | IOException e) {
// Handle errors
e.printStackTrace();
}
Image Requirements
Feather has specific requirements for server list background images:
Format: Only PNG format is currently supported
Recomended dimensions: 909x102 pixels
Maximum dimensions: 1009×202 pixels
Maximum file size: 512 KB
Attempting to use images that don't meet these requirements will result in exceptions being thrown when setting the background.
Detailed Usage
Creating a Background from a File
The most common way to create a server background is from an image file:
Path imagePath = plugin.getDataFolder().toPath().resolve("backgrounds/my-background.png");
ServerListBackground background = metaService.getServerListBackgroundFactory().byPath(imagePath);
Creating a Background from Bytes
If you have image data as a byte array, you can create a background from it:
// With explicit format
ServerListBackground background = factory.fromBytes(imageBytes, ImageFormat.PNG);
// With automatic format detection (if supported by the implementation)
ServerListBackground background = factory.fromBytes(imageBytes);
Setting the Background
Once you have a ServerListBackground object, you can set it as the server's background:
metaService.setServerListBackground(background);
Retrieving the Current Background
You can get the currently set background with:
ServerListBackground currentBackground = metaService.getServerListBackground();
if (currentBackground != null) {
// The background is set
} else {
// No background is currently set
}
Exception Handling
When working with server list backgrounds, several exceptions may be thrown:
UnsupportedImageFormatException - When the image format is not supported (currently only PNG is supported)
ImageSizeExceededException - When the image dimensions or file size exceed the maximum limits
InvalidImageException - When the image data is corrupted or otherwise invalid
It's important to handle these exceptions appropriately:
try {
ServerListBackgroundFactory factory = metaService.getServerListBackgroundFactory();
ServerListBackground background = factory.byPath(imagePath);
metaService.setServerListBackground(background);
} catch (UnsupportedImageFormatException e) {
logger.error("Image format not supported. Only PNG is supported.", e);
} catch (ImageSizeExceededException e) {
logger.error("Image is too large. Maximum dimensions: 1009×202, Maximum size: 512KB", e);
} catch (InvalidImageException e) {
logger.error("Image file is corrupted or invalid.", e);
} catch (IOException e) {
logger.error("Error reading image file.", e);
}
Best Practices
Optimizing Image Size
Server list backgrounds are sent to players when they connect, so it's important to optimize your images to minimize the impact on connection times:
Compress PNG files to reduce their size while maintaining quality
Use the smallest dimensions that still look good (staying under the 1009×202 limit)
Consider using fewer colors to reduce file size
Background Loading on Startup
Load your server background when your plugin starts:
@Override
public void onEnable() {
// Create the backgrounds directory if it doesn't exist
Path backgroundsDir = getDataFolder().toPath().resolve("backgrounds");
try {
Files.createDirectories(backgroundsDir);
} catch (IOException e) {
getLogger().severe("Failed to create backgrounds directory");
e.printStackTrace();
}
// Load the configured background
String backgroundFile = getConfig().getString("background", "default.png");
loadBackground(backgroundFile);
}
private void loadBackground(String filename) {
try {
Path imagePath = getDataFolder().toPath().resolve("backgrounds").resolve(filename);
if (Files.exists(imagePath)) {
ServerListBackground background = FeatherAPI.getMetaService()
.getServerListBackgroundFactory()
.byPath(imagePath);
FeatherAPI.getMetaService().setServerListBackground(background);
getLogger().info("Server background loaded: " + filename);
} else {
getLogger().warning("Background file not found: " + filename);
}
} catch (Exception e) {
getLogger().severe("Error loading server background");
e.printStackTrace();
}
}
Common Pitfalls
Image Loading Thread Safety
The image loading process involves file I/O operations and should be performed off the main server thread to avoid blocking:
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
try {
ServerListBackground background = FeatherAPI.getMetaService()
.getServerListBackgroundFactory()
.byPath(imagePath);
try {
FeatherAPI.getMetaService().setServerListBackground(background);
logger.info("Server background updated successfully");
} catch (Exception e) {
logger.error("Error setting server background", e);
}
} catch (Exception e) {
logger.error("Error loading server background", e);
}
});
Limitations
The server background is only sent once when a player connects and has not already received the background
The background cannot be updated dynamically for connected players
Only PNG format is currently supported
The image dimensions are limited to 1009×202 pixels
The image file size is limited to 512 KB