Logger
MagicUtils logger builds on Adventure components and provides a consistent API for console and chat output, with optional localisation, internal placeholders, and external placeholder engines.
Why a logger built on Adventure
Every platform speaks a different dialect of "styled text": Bukkit has legacy
&/§ colour codes and ChatColor, Fabric/NeoForge use Minecraft's own Text,
Velocity and BungeeCord have their own component types. Writing colourful output
that works everywhere normally means branching per platform.
MagicUtils logs in Kyori Adventure components. You
can author them with MiniMessage,
the modern tag syntax (<green>, <gradient>, <hover>), or with familiar
legacy colour codes (&a, &l, &#ff8800) — both are accepted and legacy
codes are converted to MiniMessage automatically, so you can mix styles or paste
existing coloured strings:
One string renders correctly on every platform, in chat and in the console, and the same call can localise, resolve placeholders, and honour per-logger prefixes.
Before (raw Bukkit, colour codes, console vs player split):
After (MagicUtils, one call, MiniMessage, any platform):
Setup
The recommended path is to obtain the logger from a bootstrap result or
MagicRuntime.
Bukkit/Paper
Fabric
Velocity
Velocity bootstrap returns LoggerCore directly:
NeoForge / Custom Platforms
NeoForge and custom platforms typically wire LoggerCore manually:
Basic Usage
Each level also has form-string overloads (info(format, args...)) and variants
that target the console (infoConsole(...)) or every audience (infoAll(...)).
The logger accepts MiniMessage markup and can target console, chat, or both.
Send a plain broadcast to every online player and the console:
Log Builder
Start a builder with log(), noPrefix(), or any level (info(), success(),
...), chain the targeting/formatting calls, then send(...):
Builder methods:
target(LogTarget.CHAT | CONSOLE | BOTH),toConsole(),toAll()to(audience),toAudiences(collection),recipient(audience)noPrefix(),prefixMode(PrefixMode.FULL | SHORT | CUSTOM | NONE)args(Object...)for{0},{1}, ... substitutionplaceholders(Map)for named{key}tokenswithResolvers(TagResolver...)for custom MiniMessage tagssend(message, placeholders...)to render and dispatch
Prefixed Loggers
Each prefixed logger gets its own entry under sub-loggers in logger.{ext}
for enable or disable toggles.
Prefix Modes
Prefix rendering is controlled by PrefixMode:
FULL-> full plugin/mod nameSHORT-> short name from configCUSTOM->setCustomPrefix(...)NONE-> no prefix
Logger delegates these controls to the underlying LoggerCore.
Runtime Integration
When you already have MagicRuntime, the logger is a shared typed component:
That makes it easy to pass the logger into reloadable services or register named runtime resources that log through the same config and placeholder setup.
Logger Configuration
LoggerConfig is stored as logger.{ext}.
- Bukkit: plugin config directory
- Fabric:
config/<modid>/by default - Velocity / custom platforms: resolved through the active
Platform
See Logger Config for a full key reference.
Key sections:
prefixdefaultschat/consolehelpsub-loggers
Localisation
Attach a LanguageManager to enable @key lookups:
The logger resolves the key through the attached LanguageManager and then
renders the result as MiniMessage.
Bootstrap helpers bind the language manager automatically when language support is enabled.
Internal And External Placeholders
Logger messages pass through both:
MagicPlaceholdersfor{key}and{namespace:key}tokens.- Platform-specific external placeholder engines.
Examples:
Platform integrations:
- Bukkit logger installs the PlaceholderAPI bridge and a Bukkit external placeholder engine.
- Fabric logger installs Text Placeholder API / MiniPlaceholders / PB4 support when those mods are present.
LoggerCorealso supports a customExternalPlaceholderEnginefor custom platforms.