Matthiesen Core - Mod Setup
The following sections will guide you through setting up your mod to work with Matthiesen Core. This includes extending the necessary base classes provided by Matthiesen Core to ensure your mod integrates seamlessly with the core functionalities.
AbstractCommonMod
Section titled “AbstractCommonMod”Extend the AbstractCommonMod class in your common mod codebase to leverage Matthiesen Core’s core functionalities. This class provides a foundation for your mod, allowing you to focus on implementing your mod’s unique features while Matthiesen Core handles the platform-specific details.
package com.example.mymod;
import dev.matthiesen.matthiesen_core.common.AbstractCommonMod;import dev.matthiesen.libs.faststats.Token;
public final class ExampleModCommon extends AbstractCommonMod { public static final String MOD_ID = "examplemod"; public static final String MOD_NAME = "Example Mod"; public static @Token final String METRICS_TOKEN = ""; // Provided by FastStats.dev (Optional, can be null to disable metrics for your mod)
public static final ExampleModCommon INSTANCE = new ExampleModCommon();
private ExampleModCommon() { super(MOD_ID, MOD_NAME); }
@Override public @Nullable @Token String getMetricsToken() { return METRICS_TOKEN; }
@Override public void initialize() { super.initialize(); createInfoLog("Initializing Example Mod Common..."); }}Available Methods in AbstractCommonMod
Section titled “Available Methods in AbstractCommonMod”initialize(): Called during the mod’s initialization phase. Override this method while calling super to set up your mod’s common logic.trackError(Throwable error): Tracks an error that occurs within your mod. This can be used to report errors to FastStats or other error tracking systems.getMetricContext(): Returns the metric context for your mod, which can be used to send custom metrics to FastStats.getModId(): Returns the mod ID of your mod.getModName(): Returns the mod name of your mod.getLogger(): Returns the logger instance for your mod, which can be used to log messages to the console or log files.createInfoLog(String message): Creates an info log message for your mod.createWarnLog(String message): Creates a warning log message for your mod.createErrorLog(String message): Creates an error log message for your mod.createErrorLog(String message, Throwable error): Creates an error log message with an associated throwable for your mod.getRegistryBuilder(): Returns the registry builder for your mod, which can be used to register blocks, items, entities, and other game content in a platform-agnostic way.getPermissionsManager(): Returns the permissions manager for your mod, which can be used to manage access to certain features or commands.getCommandsRegistryManager(): Returns the commands registry manager for your mod, which can be used to register commands in a platform-agnostic way.getWebhookService(): Returns the webhook service for your mod, which can be used to send webhooks to external services in a platform-agnostic way. (Requires Matthiesen Core Webhooks to be installed)getCommonUtils(): Returns the common utilities for your mod, which can be used to access a variety of utility functions for common tasks.getCommonRegistry(): Returns the common registry for your mod, which can be used to register blocks, items, entities, and other game content in a platform-agnostic way.getTextParserManager(): Returns the text parser manager for your mod, which can be used to parse and format text in a platform-agnostic way. (See Text Parsers for more information)getCoreMetrics(): Returns the core metrics for your mod, which can be used to send custom metrics to FastStats.getNetworkingManager(): Returns the networking manager for your mod, which can be used to send and receive network packets between the client and server in a platform-agnostic way.getCreativeModeAugmentsManager(): Returns the creative mode augments manager for your mod, which can be used to append to the creative mode tabs custom items.
At this point, your mod is set up to use Matthiesen Core’s core functionalities. You can now proceed to implement your mod’s unique features in the common codebase, while Matthiesen Core handles the platform-specific details.
See the sections on the sidebar for more information on how to implement specific features and functionalities in your mod using Matthiesen Core.
AbstractCommonClientMod
Section titled “AbstractCommonClientMod”Extend the AbstractCommonClientMod class in your client mod codebase to leverage Matthiesen Core’s client-specific features. This class provides a foundation for your client-side mod, allowing you to focus on implementing your mod’s unique client-side features while Matthiesen Core handles the platform-specific details.
package com.example.mymod.client;
import dev.matthiesen.matthiesen_core.common.AbstractCommonClientMod;import com.example.mymod.ExampleModCommon;
public final class ExampleModCommonClient extends AbstractCommonClientMod { public static final ExampleModCommonClient INSTANCE = new ExampleModCommonClient();
private ExampleModCommonClient() { super(ExampleModCommon.INSTANCE); }
@Override public void initialize() { createInfoLog("Initializing Example Mod Common Client logic..."); }}Available Methods in AbstractCommonClientMod
Section titled “Available Methods in AbstractCommonClientMod”initialize(): Called during the client mod’s initialization phase. Override this method while calling super to set up your mod’s client-side logic.getModId(): Returns the mod ID of your mod.getModName(): Returns the mod name of your mod.getLogger(): Returns the logger instance for your mod, which can be used to log messages to the console or log files.createInfoLog(String message): Creates an info log message for your mod.createWarnLog(String message): Creates a warning log message for your mod.createErrorLog(String message): Creates an error log message for your mod.createErrorLog(String message, Throwable error): Creates an error log message with an associated throwable for your mod.getScreenManager(): Returns the screen manager for your mod, which can be used to manage screens and GUIs in a platform-agnostic way.getEntityRendererManager(): Returns the entity renderer manager for your mod, which can be used to manage entity renderers in a platform-agnostic way.getKeybindingsManager(): Returns the keybindings manager for your mod, which can be used to manage keybindings in a platform-agnostic way.
At this point, your client mod is set up to use Matthiesen Core’s client-specific features. You can now proceed to implement your mod’s unique client-side features in the client codebase, while Matthiesen Core handles the platform-specific details.
See the sections on the sidebar for more information on how to implement specific client-side features and functionalities in your mod using Matthiesen Core.
Matthiesen Core Webhooks
Section titled “Matthiesen Core Webhooks”Matthiesen Core Webhooks is an optional mod that provides a Discord webhook service for Matthiesen Core. Without it, Matthiesen Core falls back to using a NoOp webhook service that does nothing. If you want to use the webhook service, you need to include the Matthiesen Core Webhooks mod in your modpack.
You can find Matthiesen Core Webhooks on Modrinth: Matthiesen Core Webhooks
You can find Matthiesen Core Webhooks docs here: Matthiesen Core Webhooks Docs
Text Parsers
Section titled “Text Parsers”Matthiesen Core provides a text parser system that allows you to parse and format text in a platform-agnostic way. This is useful for creating immersive messages, tooltips, and other text-based content in your mod.
Built in text parsers include:
vanilla: The default Minecraft text parser that supports standard Minecraft formatting codes allowing the usage of&and§for formatting text.emberstextapi: A text parser that integrates with Ember’s Text API for immersive text features with cross-platform compatibility. This parser allows you to create rich text messages with advanced formatting options. (Requires Ember’s Text API to be installed)