Skip to content

Getting Started

Minecraft Version
1.21.1
Mod Loaders
External Links

Matthiesen Lib is a lightweight Architectury-style library that enables mod developers to write shared code that works seamlessly across both Fabric and NeoForge mod loaders for Minecraft 1.21.1. Instead of maintaining separate implementations for each platform, you can write your mod logic once in common code and let Matthiesen Lib handle the platform-specific details.

Matthiesen Lib provides a unified API for:

  • Content Registration - Register blocks, items, block entities, sounds, creative tabs, and more from common code
  • Command System - Create cross-platform commands with a simple abstraction layer
  • Permission System - Unified permission validation across both platforms
  • Client-Side Features - Register screens, entity renderers, HUD layers, and custom block outlines
  • Embers Text API Integration - Send immersive messages using Ember’s Text API with a cross-platform compatibility layer
  • Utility Classes - ItemBuilder, screen abstractions, and other helpful utilities

Instead of maintaining separate Fabric and NeoForge implementations:

// With Matthiesen Lib - Write once in common code
public static final RegistryBuilder REGISTRY = new MatthiesenLib.RegistryBuilder("mymod");
public static final Supplier<Item> MY_ITEM = REGISTRY.registerItem(
"my_item",
() -> new Item(new Item.Properties())
);
  • Automatic Namespace Prefixing - The RegistryBuilder automatically adds your mod ID to all registered content
  • Platform Abstraction - Access platform-specific features through a common API
  • Unified Initialization - One initialization flow that works on both loaders

To start using Matthiesen Lib in your mod:

  1. Add the dependency - See Installation
  2. Create registry classes - Extend the appropriate abstract registry classes
  3. Register your content - Use the registry instances to register items, blocks, etc.
  4. Initialize registries - Call the init() methods during mod startup
package dev.matthiesen.common.mymod.registry;
import dev.matthiesen.common.matthiesen_lib.registry.AbstractItemRegistry;
import net.minecraft.world.item.Item;
import java.util.function.Supplier;
public class ItemRegistry extends AbstractItemRegistry {
private static final ItemRegistry INSTANCE = new ItemRegistry();
protected ItemRegistry() {
super("mymod");
}
public static void init() {}
public static final Supplier<Item> EXAMPLE_ITEM;
static {
EXAMPLE_ITEM = INSTANCE.register("example_item",
() -> new Item(new Item.Properties()));
}
}
// In your mod initializer
public class MyMod {
public void initialize() {
ItemRegistry.init();
}
}
Learn how to set up Matthiesen Lib in your development environment with the Installation Guide.
Explore the Registry Builder API to see how to register content from common code.
Check out the Commands page to learn how to create cross-platform commands.
Find out how to implement permissions with the Permissions system.
Discover how to register client-side features like screens and renderers in the Client-Side Features section.
Integrate with the Embers Text API for immersive messaging with the Embers Integration guide.
Utilize helpful utilities like the ItemBuilder in the Utilities section.