Skip to content
These docs are a work in progress and may be incomplete or contain inaccuracies. (Or be for a newer unreleased version of the mod)

Block Registry

Matthiesen Core provides a convenience base class for registering blocks in a platform-agnostic way. This allows mod developers to define and register blocks without worrying about the underlying platform-specific implementation details.

ModBlockRegistry.java
package com.example.mymod.registry;
import dev.matthiesen.matthiesen_core.common.registry.AbstractBlockRegistry;
import net.minecraft.world.level.block.Block;
public final class ModBlockRegistry extends AbstractBlockRegistry {
private static final ModBlockRegistry INSTANCE = new ModBlockRegistry();
private ModBlockRegistry() {
super("example_mod"); // Replace with your mod's ID
}
/**
* Initializes the block registry. This method should be called during the mod's initialization phase.
*/
public static void init() {}
public static final Supplier<Block> EXAMPLE_BLOCK = INSTANCE.register("example_block", () -> new Block(Block.Settings.of(Material.METAL).strength(4.0f).requiresTool()));
}