[{"data":1,"prerenderedAt":332},["ShallowReactive",2],{"docs-\u002Fplatforms\u002Fneoforge":3},{"id":4,"title":5,"body":6,"description":322,"extension":323,"meta":324,"navTitle":325,"navigation":326,"path":327,"rawbody":328,"seo":329,"stem":330,"__hash__":331},"docs\u002Fplatforms\u002Fneoforge.md","NeoForge",{"type":7,"value":8,"toc":314},"minimark",[9,13,29,34,47,57,71,75,85,263,267,270,276,283,287,302],[10,11,5],"h1",{"id":12},"neoforge",[14,15,16,20,21,24,25,28],"p",{},[17,18,19],"code",{},"magicutils-neoforge"," provides the platform adapter; ",[17,22,23],{},"magicutils-commands-neoforge","\nadds the Brigadier command integration and the ",[17,26,27],{},"NeoForgeBootstrap"," helper.",[30,31,33],"h2",{"id":32},"recommended-bootstrap","Recommended Bootstrap",[14,35,36,38,39,42,43,46],{},[17,37,27],{}," mirrors ",[17,40,41],{},"FabricBootstrap",": give it the mod id and a supplier\nfor the running ",[17,44,45],{},"MinecraftServer",", then keep the runtime handle.",[48,49,55],"pre",{"className":50,"code":52,"language":53,"meta":54},[51],"language-java","public final class MyMod {\n    private NeoForgeBootstrap.RuntimeResult magic;\n\n    public MyMod() {\n        magic = NeoForgeBootstrap.forMod(\"mymod\", () -> currentServer())\n                .enableCommands()\n                .buildRuntime();\n\n        \u002F\u002F Register commands when NeoForge fires the event.\n        NeoForge.EVENT_BUS.addListener(this::onRegisterCommands);\n    }\n\n    private void onRegisterCommands(RegisterCommandsEvent event) {\n        if (magic.commandRegistry() != null) {\n            magic.commandRegistry().registerCommand(event.getDispatcher(), new ExampleCommand());\n        }\n    }\n}\n","java","",[17,56,52],{"__ignoreMap":54},[14,58,59,62,63,66,67,70],{},[17,60,61],{},"build()"," returns the legacy bootstrap view; ",[17,64,65],{},"buildRuntime()"," additionally gives\nyou a managed ",[17,68,69],{},"MagicRuntime",".",[30,72,74],{"id":73},"bootstrap-options","Bootstrap Options",[14,76,77,80,81,84],{},[17,78,79],{},"NeoForgeBootstrap.Builder"," supports the same core options as the other\nplatforms, plus the mod-specific ",[17,82,83],{},"opLevel",":",[86,87,88,101],"table",{},[89,90,91],"thead",{},[92,93,94,98],"tr",{},[95,96,97],"th",{},"Method",[95,99,100],{},"Description",[102,103,104,115,125,139,149,159,169,179,189,199,209,223,233,243,253],"tbody",{},[92,105,106,112],{},[107,108,109],"td",{},[17,110,111],{},"slf4j(logger)",[107,113,114],{},"Bind an SLF4J logger for console output.",[92,116,117,122],{},[107,118,119],{},[17,120,121],{},"configDir(path)",[107,123,124],{},"Override the config\u002Flang data directory.",[92,126,127,132],{},[107,128,129],{},[17,130,131],{},"enableCommands()",[107,133,134,135,138],{},"Create a ",[17,136,137],{},"CommandRegistry"," during bootstrap.",[92,140,141,146],{},[107,142,143],{},[17,144,145],{},"permissionPrefix(prefix)",[107,147,148],{},"Set the permission node prefix for commands.",[92,150,151,156],{},[107,152,153],{},[17,154,155],{},"opLevel(int)",[107,157,158],{},"Operator threshold used for permission fallbacks.",[92,160,161,166],{},[107,162,163],{},[17,164,165],{},"configureCommands(consumer)",[107,167,168],{},"Register commands during bootstrap.",[92,170,171,176],{},[107,172,173],{},[17,174,175],{},"enableDiagnostics()",[107,177,178],{},"Enable the diagnostics service.",[92,180,181,186],{},[107,182,183],{},[17,184,185],{},"configureDiagnostics(consumer)",[107,187,188],{},"Register custom diagnostic checks.",[92,190,191,196],{},[107,192,193],{},[17,194,195],{},"initLanguage(boolean)",[107,197,198],{},"Enable\u002Fdisable language manager initialization.",[92,200,201,206],{},[107,202,203],{},[17,204,205],{},"bindLoggerLanguage(boolean)",[107,207,208],{},"Bind the language manager to the logger.",[92,210,211,216],{},[107,212,213],{},[17,214,215],{},"setMessagesManager(boolean)",[107,217,218,219,222],{},"Set the global ",[17,220,221],{},"Messages"," language manager.",[92,224,225,230],{},[107,226,227],{},[17,228,229],{},"registerMessages(boolean)",[107,231,232],{},"Register the plugin's messages scope.",[92,234,235,240],{},[107,236,237],{},[17,238,239],{},"addMagicUtilsMessages(boolean)",[107,241,242],{},"Register built-in MagicUtils messages.",[92,244,245,250],{},[107,246,247],{},[17,248,249],{},"bindClientLocaleSync(boolean)",[107,251,252],{},"Follow each player's client locale.",[92,254,255,260],{},[107,256,257],{},[17,258,259],{},"translations(consumer)",[107,261,262],{},"Configure additional translations.",[30,264,266],{"id":265},"manual-wiring","Manual Wiring",[14,268,269],{},"When you want full control, wire the services yourself instead of using the\nbootstrap:",[48,271,274],{"className":272,"code":273,"language":53,"meta":54},[51],"Platform platform = new NeoForgePlatformProvider();\nConfigManager configManager = new ConfigManager(platform);\nLoggerCore logger = new LoggerCore(platform, configManager, this, \"MyMod\");\nCommandRegistry commands = CommandRegistry.create(\"mymod\", \"mymod\", logger);\n\n\u002F\u002F commands.registerCommand(dispatcher, new ExampleCommand()) on RegisterCommandsEvent\n",[17,275,273],{"__ignoreMap":54},[14,277,278,279,282],{},"The second argument to ",[17,280,281],{},"CommandRegistry.create(...)"," is the permission prefix;\nan overload accepts an explicit operator level.",[30,284,286],{"id":285},"notes","Notes",[288,289,290],"ul",{},[291,292,293,294,297,298,301],"li",{},"NeoForge uses ",[17,295,296],{},"LoggerCore"," directly instead of the Bukkit\u002FFabric ",[17,299,300],{},"Logger","\nwrapper.",[303,304,307],"callout",{"title":305,"type":306},"Platform limitations","warning",[14,308,309,310,313],{},"Player chat\u002Fcommand events (",[17,311,312],{},"subscribePlayerMessages",") are not available on\nNeoForge; player lifecycle and locale events are. There is also no NeoForge\nplaceholder bridge yet, so use MagicUtils core placeholders directly where needed.",{"title":54,"searchDepth":315,"depth":315,"links":316},3,[317,319,320,321],{"id":32,"depth":318,"text":33},2,{"id":73,"depth":318,"text":74},{"id":265,"depth":318,"text":266},{"id":285,"depth":318,"text":286},"Wire MagicUtils into a NeoForge mod with NeoForgeBootstrap, or wire the platform adapter manually. Brigadier command integration via magicutils-commands-neoforge.","md",{},null,true,"\u002Fplatforms\u002Fneoforge","---\ntitle: NeoForge\ndescription: Wire MagicUtils into a NeoForge mod with NeoForgeBootstrap, or wire the platform adapter manually. Brigadier command integration via magicutils-commands-neoforge.\n---\n\n# NeoForge\n\n`magicutils-neoforge` provides the platform adapter; `magicutils-commands-neoforge`\nadds the Brigadier command integration and the `NeoForgeBootstrap` helper.\n\n## Recommended Bootstrap\n\n`NeoForgeBootstrap` mirrors `FabricBootstrap`: give it the mod id and a supplier\nfor the running `MinecraftServer`, then keep the runtime handle.\n\n```java\npublic final class MyMod {\n    private NeoForgeBootstrap.RuntimeResult magic;\n\n    public MyMod() {\n        magic = NeoForgeBootstrap.forMod(\"mymod\", () -> currentServer())\n                .enableCommands()\n                .buildRuntime();\n\n        \u002F\u002F Register commands when NeoForge fires the event.\n        NeoForge.EVENT_BUS.addListener(this::onRegisterCommands);\n    }\n\n    private void onRegisterCommands(RegisterCommandsEvent event) {\n        if (magic.commandRegistry() != null) {\n            magic.commandRegistry().registerCommand(event.getDispatcher(), new ExampleCommand());\n        }\n    }\n}\n```\n\n`build()` returns the legacy bootstrap view; `buildRuntime()` additionally gives\nyou a managed `MagicRuntime`.\n\n## Bootstrap Options\n\n`NeoForgeBootstrap.Builder` supports the same core options as the other\nplatforms, plus the mod-specific `opLevel`:\n\n| Method | Description |\n| --- | --- |\n| `slf4j(logger)` | Bind an SLF4J logger for console output. |\n| `configDir(path)` | Override the config\u002Flang data directory. |\n| `enableCommands()` | Create a `CommandRegistry` during bootstrap. |\n| `permissionPrefix(prefix)` | Set the permission node prefix for commands. |\n| `opLevel(int)` | Operator threshold used for permission fallbacks. |\n| `configureCommands(consumer)` | Register commands during bootstrap. |\n| `enableDiagnostics()` | Enable the diagnostics service. |\n| `configureDiagnostics(consumer)` | Register custom diagnostic checks. |\n| `initLanguage(boolean)` | Enable\u002Fdisable language manager initialization. |\n| `bindLoggerLanguage(boolean)` | Bind the language manager to the logger. |\n| `setMessagesManager(boolean)` | Set the global `Messages` language manager. |\n| `registerMessages(boolean)` | Register the plugin's messages scope. |\n| `addMagicUtilsMessages(boolean)` | Register built-in MagicUtils messages. |\n| `bindClientLocaleSync(boolean)` | Follow each player's client locale. |\n| `translations(consumer)` | Configure additional translations. |\n\n## Manual Wiring\n\nWhen you want full control, wire the services yourself instead of using the\nbootstrap:\n\n```java\nPlatform platform = new NeoForgePlatformProvider();\nConfigManager configManager = new ConfigManager(platform);\nLoggerCore logger = new LoggerCore(platform, configManager, this, \"MyMod\");\nCommandRegistry commands = CommandRegistry.create(\"mymod\", \"mymod\", logger);\n\n\u002F\u002F commands.registerCommand(dispatcher, new ExampleCommand()) on RegisterCommandsEvent\n```\n\nThe second argument to `CommandRegistry.create(...)` is the permission prefix;\nan overload accepts an explicit operator level.\n\n## Notes\n\n- NeoForge uses `LoggerCore` directly instead of the Bukkit\u002FFabric `Logger`\n  wrapper.\n\n::callout{type=\"warning\" title=\"Platform limitations\"}\nPlayer chat\u002Fcommand events (`subscribePlayerMessages`) are not available on\nNeoForge; player lifecycle and locale events are. There is also no NeoForge\nplaceholder bridge yet, so use MagicUtils core placeholders directly where needed.\n::\n",{"title":5,"description":322},"platforms\u002Fneoforge","ujzPEfQWRKH_Rs7CzX_AfXtXnOh-LTQcS-V9A4-tn10",1783944485844]