CountryFlags
2025-08-15Display player country flags anywhere using placeholders – chat, tab, scoreboards, and more.
FlagPrefix – Country Flags Anywhere with PlaceholderAPI
Automatically show a player’s country flag **anywhere** — in chat, tab lists, scoreboards, holograms, GUIs, and more — using GeoIP detection, a customizable resource pack, and full PlaceholderAPI support. Works for both Java and Bedrock players.
Features
- Automatic GeoIP Detection — Instantly determines player country from IP (with proxy support)
- Universal Placement — Works anywhere PlaceholderAPI is supported: chat, tab list, scoreboards, holograms, GUIs
- Custom Resource Pack Flags — Crisp PNG-based flag icons, or Unicode emoji fallback
- Dynamic Switching — Show custom bitmap flags if the resource pack is accepted, otherwise use emoji flags
- Full Config Control — Toggle per-player, customize defaults, change fallback emoji, tweak Bedrock behavior
- Bedrock/Geyser Support — Includes special Bedrock pack registration for Floodgate servers
- Proxy & Bungee/Velocity Compatible — Full IP-forwarding support for accurate lookups
- Translatable — Edit all messages in messages.yml with MiniMessage formatting
Configuration Overview
config.yml — Core Behavior
prefixes-enabled-by-default: true # Show flags automatically for new players
use-proxy-ip: true # Use proxy IP instead of direct connection
default-fallback-emoji: "" # Emoji to use if no flag found
bedrock-fallback-format: "<gray>[<flag>]</gray>" # MiniMessage for Bedrock without RP
messages.yml — Player Interaction
- All messages fully editable with MiniMessage formatting (<red>, <gradient>, <hover>, etc.)
- Includes toggle feedback, permission errors, resource pack prompts
Commands
- /flagprefix toggle — Enable/disable your flag display
- /flagprefix override <code> — Set a custom country code manually
- /flagprefix reload — Reload config and messages
- /flagprefix debug — Output detailed lookup & prefix debug info
Permissions
countryflags.toggle # Use the toggle command
countryflags.override # Override your country code
countryflags.reload # Reload the plugin
countryflags.debug # Debug lookups & placeholders
You can also apply LuckPerms prefixes using %countryflags_flag%.
Placeholders (PlaceholderAPI)
- %countryflags_flag% — Returns the player’s flag (bitmap or emoji)
Installation
- Drop the .jar into /plugins
- Start or reload the server
- (Optional) Edit config.yml & messages.yml
- Assign permissions as needed
- Profit — flags everywhere
Compatibility
- Paper / Spigot 1.21+
- PlaceholderAPI
- Geyser / Floodgate (Bedrock support)
- Velocity & BungeeCord (proxy IP forwarding)
Bedrock Proxy Support
If you want the custom resource pack to work for **Bedrock players across a Velocity or BungeeCord proxy**, you must also install the free companion plugin:
Without it, Bedrock players will only see the fallback emoji instead of the custom PNG flags.
config.yml
[/COLOR][/URL]
# ==============================================================================
# CountryFlags Configuration
#
# This file controls the behavior of the CountryFlags plugin, which displays
# country flag emojis as chat and tab prefixes based on player IP.
#
# Features:
# • Uses MaxMind GeoLite2 Country database for IP-to-country lookups.
# • Supports proxy IP forwarding (BungeeCord/Velocity).
# • Players can toggle flag prefix visibility.
# • Configurable default prefix visibility (opt-in vs opt-out).
# • Integrates with PlaceholderAPI to dynamically insert flag emojis into
# chat and tab formats.
#
# Placeholder Usage:
# To show flag prefixes, server owners must configure their chat and tab list
# plugins to include the following PlaceholderAPI placeholder:
#
# %countryflags_flag%
#
# ❗ IMPORTANT ❗
# THIS PLUGIN WILL NOT DISPLAY ANY FLAGS UNLESS YOU ADD THE PLACEHOLDER TO YOUR CHAT/TAB FORMATTING
#
# This plugin does **not** modify chat or tab names directly — it only provides
# placeholder output. You must add %countryflags_flag% in your chat/tab plugin’s format string
# via compatible plugins like VentureChat, TAB, DeluxeChat, etc.
#
# ⚠️ Important:
# • Server owners must manually download the GeoLite2 database.
# • Bedrock clients cannot receive custom resource packs with bitmap fonts.
# Their fallback format can be customized in this config.
# ==============================================================================
# === ️ GeoIP Database Settings ===
# Path to the MaxMind GeoLite2 Country database file (relative to the server root folder).
# The database file is NOT included with the plugin due to licensing restrictions.
#
# To download the database:
# 1. Register a free account at https://www.maxmind.com/en/geolite2/signup
# 2. Log in and click "Download Databases" on your account's main page.
# 3. Scroll to "GeoLite2 Country" and click "Download GZIP".
# 4. Extract the archive to obtain GeoLite2-Country.mmdb.
# 5. Place the GeoLite2-Country.mmdb file at the path specified below.
#
# Without this file, IP-to-country lookups will fail and the plugin will use the default emoji.
geoip-db-path: plugins/CountryFlags/GeoLite2-Country.mmdb
# === ️ Default Fallback ===
# Emoji to show when a player's country cannot be determined.
default-fallback-emoji: ""
# === First-Join Seeding ===
# For brand-new players (no saved prefs yet), set their initial preferences:
force-broadcast-on-first-join: true # Java + Bedrock
force-pack-on-first-join: true # Java + Bedrock; Java gets a prompt from Bukkit, Bedrock receives the pack via Geyser
# Whether to add a space after the country flag placeholder in chat/tab.
add-space-after-placeholder: false
# === Resource Pack Delivery ===
# Whether to automatically send the included resource pack on login or first toggle.
# true → Players will be prompted to download the resource pack
# false → Players must install the pack manually; link provided below
use-resource-pack: true
# URL to your Java Edition resource pack (direct download; no trailing slash)
java-pack-url: "https://countryflags-pack.netlify.app/countryflagspack.zip"
# Optional SHA-1 hash (40 hex chars). Leave blank "" if you don't use it.
# If set, Minecraft shows a trusted hash and behaves more reliably.
java-pack-sha1: ""
# If Geyser is installed on THIS server (single-server setup), we will auto-register
# this Bedrock pack URL with Geyser at startup so Bedrock players get it on join.
bedrock-pack-url: "https://countryflags-pack-bedrock.netlify.app/countryflagspack-bedrock.zip"
# === Bedrock Fallback Formatting ===
# Defines how the %countryflags_flag% placeholder appears for Bedrock players
# **ONLY** when they do not have the CountryFlags Bedrock resource pack active
# (for example, if they declined it, or if Geyser is not set up to send it).
#
# The Bedrock resource pack contains PNG flag glyphs, so if it is active, players
# will see the same bitmap flags as Java players.
#
# This fallback format is used as a textual representation instead of a flag emoji
# or bitmap image.
#
# <code> → replaced with the two-letter country code (e.g., US, FR, DE)
# Example: "<dark_gray>[<white><code></white>]</dark_gray>&r" → produces [US] in dark-gray/white
bedrock-fallback-format: "<dark_gray>[<white><code></white>]</dark_gray>&r"
# === Debugging ===
# Enable debug mode to print detailed logs for troubleshooting.
debug-mode: false
# Show whether each connection was via PROXY or DIRECT in debug logs.
# This does NOT affect how IPs are resolved — informational only.
debug-show-proxy-mode: falsemessages.yml
# === MiniMessage Formatting ===
# Most plugin messages (including GUI labels and action bars) support MiniMessage.
# MiniMessage uses tags like <red>, <bold>, <hover:...> to style your text.
#
# ✅ Basic Examples:
# - <red>Red Text</red>
# - <bold><yellow>Bold Yellow</yellow></bold>
# - <#ff0000>Hex Color Example</#ff0000>
# - <gradient:#fbbf24:#9b5de5>Gradient Text</gradient>
#
# ️ Interactive Tags:
# - <hover:show_text:'Extra info'><green>Hover Me</green></hover>
# - <click:run_command:'/help'><aqua>Click Me</aqua></click>
#
# ⚠️ CLOSING TAGS REQUIRED:
# Every tag must be properly closed, or your message will break.
# ❌ Incorrect: <bold><yellow>Missing closing tag
# ✅ Correct: <bold><yellow>Styled</yellow></bold>
#
# Built-in Placeholders (used in some messages):
# - <player> : Player’s username
# - <country> : ISO country code or country name
# - <flag> : Country flag emoji
# - <prefix> : Full flag prefix string (emoji + space)
#
# These placeholders are replaced automatically by the plugin when messages are sent.
# Not all messages use placeholders — only those that require dynamic data.
# Only use placeholders in messages that support them, or they will appear as raw text.
#
# Tips:
# - To disable a message entirely, set its value to an empty string: ""
# Example: reload-complete: ""
# - For advanced formatting, check the official MiniMessage docs:
# https://docs.advntr.dev/minimessage/format.html
messages:
# === Command Usage & Help ===
help-root: "<gradient:#60a5fa:#3b82f6><bold> CountryFlags — Commands</bold></gradient>\n<gray><commands></gray>"
help-line-toggle: "<#93c5fd>/countryflags toggle <broadcast|pack></#93c5fd> <#9ca3af>– Toggle your flag or resource pack</#9ca3af>"
help-line-override: "<#93c5fd>/countryflags override <player> <country-code|clear></#93c5fd> <#9ca3af>– Set/clear a player's country</#9ca3af>"
help-line-reload: "<#93c5fd>/countryflags reload</#93c5fd> <#9ca3af>– Reload config & messages</#9ca3af>"
help-line-debug: "<#93c5fd>/countryflags debug <on|off></#93c5fd> <#9ca3af>– Toggle debug logging</#9ca3af>"
usage-flagtoggle: "<gradient:#f87171:#ef4444>❓ Usage:</gradient> <#93c5fd>/countryflags toggle <broadcast|pack></#93c5fd> <#9ca3af>— Toggle your country flag broadcast or the custom resource pack on/off.</#9ca3af>"
usage-flagoverride: "<gradient:#f87171:#ef4444>❓ Usage:</gradient> <#93c5fd>/countryflags override <player> <country-code|clear></#93c5fd> <#9ca3af>— Manually override a player's flag.</#9ca3af>"
usage-reload: "<gradient:#f87171:#ef4444>❓ Usage:</gradient> <#93c5fd>/countryflags reload</#93c5fd> <#9ca3af>— Reload configuration and messages.</#9ca3af>"
usage-debug: "<gradient:#f87171:#ef4444>❓ Usage:</gradient> <#93c5fd>/countryflags debug <on|off></#93c5fd> <#9ca3af>— Enable or disable debug logging.</#9ca3af>"
no-player: "<gradient:#f87171:#ef4444>⛔ This command can only be run by a player.</gradient>"
player-not-found: "<gradient:#f87171:#ef4444>❌ Player <white><player></white> not found or offline.</gradient>"
no-permission: "<gradient:#f87171:#ef4444>⛔ You do not have permission to use this command.</gradient>"
# === ✅ Success & Feedback ===
broadcast-toggle-on: "<gradient:#34d399:#10b981>✅ Your flag will now be shown to others.</gradient>"
broadcast-toggle-off: "<gradient:#fbbf24:#f59e0b>⚠ Your flag will be hidden from others.</gradient>"
pack-toggle-on: "<gradient:#34d399:#10b981>✅ Resource pack enabled. It will be applied automatically where supported.</gradient>"
pack-toggle-off: "<gradient:#fbbf24:#f59e0b>⚠ Resource pack disabled. You'll see Unicode/text fallback.</gradient>"
pack-globally-disabled: "<gradient:#fbbf24:#f59e0b>⚠ Resource packs have been disabled by the server. You'll see Unicode/text fallback.</gradient>"
# === Admin Notifications ===
admin-override-set: "<gradient:#a78bfa:#6366f1>⚙ You set a flag override for <white><player></white>: <flag> <bold><country></bold></gradient>"
admin-override-cleared: "<gradient:#a78bfa:#6366f1>⚙ You cleared the flag override for <white><player></white>.</gradient>"
reload-complete: "<gradient:#34d399:#10b981>✅ CountryFlags configuration and messages reloaded successfully.</gradient>"
# === ❌ Errors & Validation ===
error-invalid-country: "<gradient:#f87171:#ef4444>❌ Invalid country code. Use a valid 2‑letter ISO code (e.g., US, GB).</gradient>"
error-geoip-fail: "<gradient:#fbbf24:#f59e0b>⚠ Could not determine your country; using default flag <flag>.</gradient>"
resource-pack-declined: "<gradient:#f87171:#ef4444>⚠ You declined the CountryFlags resource pack! You'll only see raw country codes like 'U S' instead of actual flag emojis.</gradient>"
resource-pack-failed: "<gradient:#f87171:#ef4444>⚠ Resource pack failed to download. Please try again later.</gradient>"
# === ️ Info & Debug ===
debug-enabled: "<gradient:#60a5fa:#3b82f6> Debug mode enabled. Detailed logs will be shown.</gradient>"
debug-disabled: "<gradient:#fbbf24:#f59e0b> Debug mode disabled.</gradient>"Enjoying CountryFlags?
If you find it useful, please leave a ⭐⭐⭐⭐⭐ review!
Got feedback or feature requests? Post them in the Discussion tab — I’d love to hear from you.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta