### Velocity Platform Implementation Example Source: https://context7.com/jpenilla/minimotd/llms.txt An example implementation of the MiniMOTDPlatform interface for the Velocity platform, demonstrating how to provide the data directory, logger, and convert a BufferedImage to Velocity's Favicon type. It also shows the optional onReload() method. ```APIDOC ```java // Example: Velocity platform implementation public final class MiniMOTDVelocity implements MiniMOTDPlatform { @Override public @NonNull Path dataDirectory() { return this.dataDirectory; // injected by Velocity's DI } @Override public @NonNull Logger logger() { return this.logger; } // Convert a loaded BufferedImage into Velocity's Favicon type @Override public @NonNull Favicon loadIcon(final @NonNull BufferedImage image) { return Favicon.create(image); } // Called after reload() completes — reload extra configs on Velocity @Override public void onReload() { this.miniMOTD.configManager().loadExtraConfigs(); } } ``` ``` -------------------------------- ### MOTD Configuration Example Source: https://github.com/jpenilla/minimotd/wiki/Assigning-specific-icons-per-MOTD Define a list of MOTD messages in the configuration file. The index of each message in this list corresponds to the expected icon filename. ```yaml motd: motds: - "MOTD 0" - "MOTD 1" - "MOTD 2" - "MOTD 3" - "MOTD 4" ... ``` -------------------------------- ### Velocity Platform Implementation Source: https://context7.com/jpenilla/minimotd/llms.txt Example of implementing the MiniMOTDPlatform interface for the Velocity proxy. Requires injecting platform-specific dependencies like data directory and logger. ```java public final class MiniMOTDVelocity implements MiniMOTDPlatform { @Override public @NonNull Path dataDirectory() { return this.dataDirectory; // injected by Velocity's DI } @Override public @NonNull Logger logger() { return this.logger; } // Convert a loaded BufferedImage into Velocity's Favicon type @Override public @NonNull Favicon loadIcon(final @NonNull BufferedImage image) { return Favicon.create(image); } // Called after reload() completes — reload extra configs on Velocity @Override public void onReload() { this.miniMOTD.configManager().loadExtraConfigs(); } } ``` -------------------------------- ### Example Skyblock MOTD Configuration Source: https://context7.com/jpenilla/minimotd/llms.txt A sample configuration for a Skyblock MOTD, enabling the MOTD and icon features, and setting specific player count settings for the 'skyblock' server. ```hocon motd-enabled=true icon-enabled=true motds=[ { icon=skyblock_icon line1="Skyblock" line2="Join our Skyblock world!" } ] player-count-settings { max-players-enabled=true max-players=50 # Show only players on this backend server servers=["skyblock"] } ``` -------------------------------- ### Velocity Ping Event Handler Example Source: https://context7.com/jpenilla/minimotd/llms.txt A typical usage pattern within a platform's ping event handler, showing how to resolve configuration, create a PingResponse using MiniMOTD.createMOTD(), and apply the response details (favicon, description, player counts) to the platform's ping event builder. ```APIDOC ```java // Velocity ping event handler — typical platform usage pattern @Subscribe public EventTask onProxyPingEvent(final ProxyPingEvent event) { return EventTask.async(() -> { // Resolve config by virtual host (returns main config if no match) MOTDConfig config = miniMOTD.configManager() .resolveConfig(event.getConnection().getVirtualHost().orElse(null)); ServerPing.Builder pong = event.getPing().asBuilder(); // Build the PingResponse from the resolved config PingResponse response = miniMOTD.createMOTD( config, pong.getOnlinePlayers(), pong.getMaximumPlayers() ); // Apply favicon, description, and player counts to the ping builder response.icon(pong::favicon); response.motd(pong::description); response.playerCount().applyCount(pong::onlinePlayers, pong::maximumPlayers); if (response.disablePlayerListHover()) pong.clearSamplePlayers(); if (response.hidePlayerCount()) pong.nullPlayers(); event.setPing(pong.build()); }); } ``` ``` -------------------------------- ### MiniMessage Text Formatting Examples Source: https://context7.com/jpenilla/minimotd/llms.txt Demonstrates various MiniMessage text formatting options, including RGB hex colors, gradients, rainbows, bold, italic, underline, strikethrough, obfuscated text, and placeholders for online/max players. ```hocon motds=[ { icon=random # Full RGB hex color line1="Orange Server Name" # Gradient across two hex colors with player count placeholder line2="Players: /" }, { icon=random # Rainbow + obfuscated (matrix effect) line1="xxx Rainbow Server! xxx" # Italic gradient line2="Survival • Creative • Skyblock" }, { icon=random # Named colors, underline, bold combinations line1="Welcome to My Server" line2="IP: play.example.com" } ] ``` -------------------------------- ### Typical Call and Usage of PingResponse Source: https://context7.com/jpenilla/minimotd/llms.txt Demonstrates a typical call to `MiniMOTD.createMOTD()` from a platform ping listener and how to use the returned `PingResponse` object's consumer methods (`icon`, `motd`, `playerCount().applyCount()`) to apply the MOTD details to the platform's ping builder. It also shows how to access raw values and boolean flags from the `PingResponse`. ```APIDOC ```java // Typical call from a platform ping listener: PingResponse response = miniMOTD.createMOTD( config, // MOTDConfig resolved for this virtual host 10, // actual online players 100 // actual max players from server ); // PingResponse provides nullable-safe consumer methods: response.icon(platformPingBuilder::setFavicon); // only called if icon != null response.motd(platformPingBuilder::setDescription); // only called if motd != null // Apply both online and max player counts atomically: response.playerCount().applyCount( platformPingBuilder::setOnlinePlayers, // IntConsumer platformPingBuilder::setMaxPlayers // IntConsumer ); // Access raw values if needed: PingResponse.PlayerCount count = response.playerCount(); int displayed = count.onlinePlayers(); // e.g. 13 (10 real + 25% inflated) int max = count.maxPlayers(); // e.g. 100 boolean hidden = response.hidePlayerCount(); // true → show "???" boolean noHover = response.disablePlayerListHover(); // true → clear sample players ``` ``` -------------------------------- ### Core MOTD Response Builder Usage Source: https://context7.com/jpenilla/minimotd/llms.txt Demonstrates the central method `MiniMOTD.createMOTD()` for processing configurations and generating a `PingResponse`. Shows how to apply the response to a platform's ping event builder. ```java // Typical call from a platform ping listener: PingResponse response = miniMOTD.createMOTD( config, // MOTDConfig resolved for this virtual host 10, // actual online players 100 // actual max players from server ); // PingResponse provides nullable-safe consumer methods: response.icon(platformPingBuilder::setFavicon); // only called if icon != null response.motd(platformPingBuilder::setDescription); // only called if motd != null // Apply both online and max player counts atomically: response.playerCount().applyCount( platformPingBuilder::setOnlinePlayers, // IntConsumer platformPingBuilder::setMaxPlayers // IntConsumer ); // Access raw values if needed: PingResponse.PlayerCount count = response.playerCount(); int displayed = count.onlinePlayers(); // e.g. 13 (10 real + 25% inflated) int max = count.maxPlayers(); // e.g. 100 boolean hidden = response.hidePlayerCount(); // true → show "???" boolean noHover = response.disablePlayerListHover(); // true → clear sample players ``` -------------------------------- ### Basic MiniMOTD Configuration Source: https://github.com/jpenilla/minimotd/wiki/Home This is the default configuration for MiniMOTD's main.conf file. It enables MOTD and icon features, and defines MOTD messages with placeholders and gradients. ```ini # MiniMOTD Main Configuration # Enable server list icon related features icon-enabled=true # Enable MOTD-related features motd-enabled=true # The list of MOTDs to display # # - Supported placeholders: {onlinePlayers}, {maxPlayers} # - Putting more than one will cause one to be randomly chosen each refresh motds=[ { # Set the icon to use with this MOTD # Either use 'random' to randomly choose an icon, or use the name # of a file in the icons folder (excluding the '.png' extension) # ex: icon="myIconFile" icon=random line1="MiniMOTD Default" line2="MiniMessage Gradients" }, { # Set the icon to use with this MOTD # Either use 'random' to randomly choose an icon, or use the name # of a file in the icons folder (excluding the '.png' extension) # ex: icon="myIconFile" icon=random line1="Another MOTD" line2="much wow" } ] player-count-settings { # Setting this to true will disable the hover text showing online player usernames disable-player-list-hover=false # Settings for the fake player count feature fake-players { # Modes: static, random, percent # # - static: This many fake players will be added # ex: fakePlayers: "3" # - random: A random number of fake players in this range will be added # ex: fakePlayers: "3:6" # - percent: The player count will be inflated by this much, rounding up # ex: fakePlayers: "25%" fake-players="25%" # Enable fake player count feature fake-players-enabled=false } # Setting this to true will disable the player list hover (same as 'disable-player-list-hover'), # but will also cause the player count to appear as '???' hide-player-count=false # Changes the Max Players to be X more than the online players # ex: x=3 -> 16/19 players online. just-x-more-settings { # Enable this feature just-x-more-enabled=false x-value=3 } # Changes the Max Players value max-players=69 # Enable modification of the max player count max-players-enabled=true } ``` -------------------------------- ### Server Icon Management Structure Source: https://context7.com/jpenilla/minimotd/llms.txt Illustrates the directory structure for server icons. Icons must be 64x64 PNG files placed in the 'icons/' folder within the plugin's data directory. ```tree plugins/MiniMOTD/ └── icons/ ├── logo.png # 64x64 — referenced as icon="logo" ├── skyblock_icon.png # 64x64 — referenced as icon="skyblock_icon" └── banner.png # 64x64 — used in random rotation ``` -------------------------------- ### MiniMOTD.createMOTD() Method Source: https://context7.com/jpenilla/minimotd/llms.txt The `MiniMOTD.createMOTD(MOTDConfig config, int onlinePlayers, int maxPlayers)` method is the central function for processing a configuration entry at ping time. It handles player count modifications, MOTD entry selection, MiniMessage parsing, icon resolution, and returns a `PingResponse`. ```APIDOC ## `MiniMOTD.createMOTD()` — Core Response Builder `MiniMOTD.createMOTD(MOTDConfig config, int onlinePlayers, int maxPlayers)` is the central method that processes a config entry at ping time. It applies fake-player count modifications, randomly selects a MOTD entry from the list, parses MiniMessage formatting with player count placeholders, resolves the server icon, and returns a `PingResponse` ready to be applied to the platform's ping event. ``` -------------------------------- ### MiniMOTDPlatform Interface Source: https://context7.com/jpenilla/minimotd/llms.txt The MiniMOTDPlatform interface defines the methods that each supported server/proxy platform must implement to integrate with the MiniMOTD core. Platform authors need to provide implementations for dataDirectory(), logger(), and loadIcon(), with an optional onReload() method. ```APIDOC ## `MiniMOTDPlatform` — Platform Integration Interface `MiniMOTDPlatform` is the interface that each supported server/proxy platform implements to integrate with the common MiniMOTD core. The type parameter `I` is the platform-specific favicon/icon type. Platform authors implement `dataDirectory()`, `logger()`, `loadIcon()`, and optionally `onReload()`. ``` -------------------------------- ### MiniMOTD Admin Commands Source: https://context7.com/jpenilla/minimotd/llms.txt Lists the available in-game commands for managing MiniMOTD. The 'reload' command requires the 'minimotd.admin' permission and reloads configuration files and icons without a server restart. ```bash # Show plugin version and author info /minimotd about # Reload all config files and icons (requires minimotd.admin) /minimotd reload # Console output on success: # [MiniMOTD] Done reloading configuration. # Console output on failure: # [MiniMOTD] Failed to reload MiniMOTD. Ensure there are no errors in your config files. # Show command help /minimotd help ``` -------------------------------- ### Advanced MiniMOTD Proxy Configuration Source: https://github.com/jpenilla/minimotd/wiki/Home This configuration file (plugin_settings.conf) is for proxy servers (Velocity, Waterfall/Bungeecord). It allows assigning specific MOTD configs to virtual hosts and enables update checking. ```ini # MiniMOTD Plugin Configuration # Settings only applicable when running the plugin on a proxy (Velocity or Waterfall/Bungeecord) proxy-settings { # Here you can assign configs in the 'extra-configs' folder to specific virtual hosts # Either use the name of the config in 'extra-configs', or use "default" to use the configuration in main.conf # # Format is "hostname:port"="configName|default" virtual-host-configs { "minigames.example.com:25565"=default "skyblock.example.com:25565"=skyblock "survival.example.com:25565"=survival } # Set whether to enable virtual host testing mode. # When enabled, MiniMOTD will print virtual host debug info to the console on each server ping. virtual-host-test-mode=false } # Do you want the plugin to check for updates on GitHub at launch? # https://github.com/jpenilla/MiniMOTD update-checker=true ``` -------------------------------- ### Configure Fake Player Count Expressions Source: https://context7.com/jpenilla/minimotd/llms.txt Set up different modes for displaying a fake player count. This includes adding a fixed number, setting a constant value, enforcing a minimum, defining a random range, or applying a percentage. ```hocon player-count-settings { fake-players { fake-players-enabled=true # Add mode — add exactly 5 fake players fake-players="5" # Result: 10 real → shows 15 # Constant mode — always show exactly 42 fake-players="=42" # Result: any real count → shows 42 # Minimum mode — floor the count at 10 fake-players="10+" # Result: 3 real → shows 10; 15 real → shows 15 # Random range mode — add between 2 and 8 fake players fake-players="2:8" # Result: 10 real → shows 12–18 (random each ping) # Percent mode — inflate by 50%, rounded up fake-players="50%" # Result: 10 real → shows 15; 7 real → shows 11 } } ``` -------------------------------- ### Configure Custom MOTD with Icons Source: https://context7.com/jpenilla/minimotd/llms.txt Define custom MOTD messages and associate them with specific server icons. Icons are loaded from the 'icons/' folder by their filename without the extension. ```hocon motds=[ { icon=logo # uses plugins/MiniMOTD/icons/logo.png line1="My Server" line2="Welcome back!" }, { icon=random # randomly picks any loaded icon line1="Random Icon MOTD" line2="Hope you like it!" } ] ``` -------------------------------- ### Configure MOTDs and Player Counts (HOCON) Source: https://context7.com/jpenilla/minimotd/llms.txt Define MOTD lines, server icons, and player count settings in the main configuration file. Supports MiniMessage syntax for rich formatting and legacy placeholders. ```hocon # MiniMOTD Main Configuration # Enable server list icon related features icon-enabled=true # Enable MOTD-related features motd-enabled=true # Multiple MOTDs — one is chosen at random each ping motds=[ { # "random" picks a random .png from the icons/ folder; # use a filename (without .png) to pin a specific icon icon=random line1="Welcome to My Server!" line2="Players online: /" }, { icon=logo line1="My Minecraft Server" line2="Join us at play.example.com" } ] player-count-settings { # Override the displayed max player count max-players-enabled=true max-players=100 # Hide the player list tooltip on hover disable-player-list-hover=false # Replace player count display with "???" hide-player-count=false # "just X more" mode: max = online + x (e.g. 14/17) just-x-more-settings { just-x-more-enabled=false x-value=3 } # Fake player count inflation fake-players { fake-players-enabled=false # Modes: # "3" — add 3 (static add) # "=42" — constant value of 42 # "7+" — minimum of 7 # "3:6" — add a random number between 3 and 6 # "25%" — inflate by 25%, rounding up fake-players="25%" } # Allow online count to exceed max (false = cap online at max) allow-exceeding-maximum=false # Proxy only: restrict counts to these backend server names # (empty = use proxy total) servers=[] } ``` -------------------------------- ### Configure Proxy Virtual Host Routing (HOCON) Source: https://context7.com/jpenilla/minimotd/llms.txt Map virtual hostnames to specific configuration files for per-virtual-host MOTD routing on proxy platforms. Supports wildcard matching. ```hocon # MiniMOTD Plugin Configuration update-checker=true proxy-settings { # Enable debug logging of virtual host resolution on each ping virtual-host-test-mode=false # Format: "hostname:port" = "configName" | "default" # Wildcards: "*.mydomain.com:25565" matches any subdomain virtual-host-configs { "play.example.com:25565"=default "skyblock.example.com:25565"=skyblock "survival.example.com:25565"=survival "*.minigames.example.com:25565"=minigames } } ``` -------------------------------- ### Velocity Ping Event Handler Source: https://context7.com/jpenilla/minimotd/llms.txt A typical pattern for handling proxy ping events in Velocity. It resolves configuration, creates a MOTD response, and applies it to the ping event. ```java @Subscribe public EventTask onProxyPingEvent(final ProxyPingEvent event) { return EventTask.async(() -> { // Resolve config by virtual host (returns main config if no match) MOTDConfig config = miniMOTD.configManager() .resolveConfig(event.getConnection().getVirtualHost().orElse(null)); ServerPing.Builder pong = event.getPing().asBuilder(); // Build the PingResponse from the resolved config PingResponse response = miniMOTD.createMOTD( config, pong.getOnlinePlayers(), pong.getMaximumPlayers() ); // Apply favicon, description, and player counts to the ping builder response.icon(pong::favicon); response.motd(pong::description); response.playerCount().applyCount(pong::onlinePlayers, pong::maximumPlayers); if (response.disablePlayerListHover()) pong.clearSamplePlayers(); if (response.hidePlayerCount()) pong.nullPlayers(); event.setPing(pong.build()); }); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.