Mosberg API

Quick rating

Community listing page, reviews here may not be monitored by the author.

Mosberg API

No reviews yet

A comprehensive Fabric API library for Minecraft 1.21.10+ mod development, designed to eliminate boilerplate code and accelerate mod creation with powerful utilities, enhanced registries, streamlined commands, and advanced client-side systems.

Mod Loaders
Fabric
Minecraft

Community voices

Reviews

List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Show per page
10
25
50
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
mosbergapi-1.0.0.jar

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

🏗️ Mosberg API - Minecraft Fabric Library

A comprehensive Fabric API library for Minecraft 1.21.10 that eliminates boilerplate and accelerates mod development.


⚡ What is Mosberg API?

Mosberg API is a developer library mod that provides:

16+ Registry Classes - Register blocks, items, entities, enchantments, fluids, sounds, particles, and more with minimal code
25+ Utility Helpers - Production-ready helpers for inventory, entities, NBT, particles, world manipulation, and more
8 Built-in Commands - Block, item, entity, world, debug, config, registry, and help commands out of the box
Advanced Client Systems - Entity rendering, model management, screen handlers, and 1.21+ render state support
Fluent Data Generation - Auto-generate recipes, loot tables, and models with intuitive builders
Event System - Custom events for block mining, player joining, entity spawning
JSON Configuration - Built-in config management with automatic file generation
Modern Java 21 - Records, pattern matching, sealed classes, and null safety annotations

No gameplay content is added to Minecraft. Mosberg API is purely a developer library for mod creators.


📥 Installation for Players

  1. Download Fabric Loader and install it
  2. Download Fabric API (required dependency)
  3. Download this mod from CurseForge
  4. Place all JARs in your .minecraft/mods/ folder
  5. Launch Minecraft with the Fabric profile

👨‍💻 For Mod Developers

Quick Setup

Add to gradle.properties:

# Dependencies
mosberg_api_1412900_version=7375365

Add to build.gradle:

repositories {
    maven {
        name = "CurseMaven"
        url = "https://cursemaven.com/"
        content {
            includeGroup "curse.maven"
        }
    }
}

dependencies {
    // Mosberg API
    modImplementation "curse.maven:mosberg-api-1412900:${project.mosberg_api_1412900_version}"
    // Optional: bundle with your mod
    include implementation("curse.maven:mosberg-api-1412900:${project.mosberg_api_1412900_version}")
}

Update fabric.mod.json:

{
  "depends": {
    "mosberg-api": "*"
  }
}

Create your mod initializer:

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class YourMod implements ModInitializer {
    public static final String MOD_ID = "yourmod";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        LOGGER.info("YourMod initialized with Mosberg API!");

        // Register your content
        ModBlocks.initialize();
        ModItems.initialize();
        ModEntities.initialize();

        // Register events
        ModEvents.register();

        // Load config
        ModConfig.load();
    }
}

🎯 Key Features

Registry System

Simplify registration with one-liners:

// Block registration (auto-creates item)
public static final Block RUBY_BLOCK = MosbergBlocks.register(
    "ruby_block",
    new Block(AbstractBlock.Settings.create().strength(2.0f))
);

// Entity registration
public static final EntityType<CustomMob> CUSTOM_MOB = MosbergEntities.register(
    "custom_mob",
    EntityType.Builder.create(CustomMob::new, SpawnGroup.CREATURE)
        .dimensions(0.8f, 1.8f)
);

// Enchantment registration
public static final Enchantment CUSTOM_ENCH = MosbergEnchantments.register(
    "custom_ench",
    new Enchantment(...)
);

16 Registry Classes:

  • MosbergBlocks, MosbergItems, MosbergEntities, MosbergItemGroups
  • MosbergSounds, MosbergParticles, MosbergFluids, MosbergEnchantments
  • MosbergStatusEffects, MosbergPotions, MosbergBlockEntities
  • MosbergDataComponents, MosbergDamageTypes, MosbergGameEvents
  • MosbergScreenHandlerTypes, MosbergVillagers, MosbergWorldGen
  • MosbergTags, MosbergRegistries (master registry for 60+ types)

Utility Helpers

25+ helpers for common operations:

// Inventory operations
ItemStack leftovers = InventoryHelper.addItemToInventory(inv, stack);
int transferred = InventoryHelper.transferItems(source, dest, count);
boolean hasSpace = InventoryHelper.hasSpace(inv, stack);

// Entity manipulation
EntityHelper.teleportEntity(entity, world, pos);
EntityHelper.applyKnockback(entity, strength, direction);
EntityHelper.healEntity(entity, amount);

// World operations
WorldHelper.setRaining(world, duration);
WorldHelper.createExplosion(world, null, pos, power, true);
List<Entity> nearby = WorldHelper.getEntitiesInBox(world, box);

// NBT operations
NBTHelper.setString(nbt, "name", value);
NBTHelper.setInt(nbt, "level", 5);
String name = NBTHelper.getString(nbt, "name", "Default");

// Particle effects
ParticleHelper.spawnParticles(world, ParticleTypes.FLAME, pos, count, spread);

All 25 Helpers: AttributeHelper, BlockHelper, CommandHelper, DataComponentHelper, DamageTypeHelper, EnchantmentUtil, EntityHelper, FluidHelper, GameEventHelper, InventoryHelper, ItemGroupHelper, ItemHelper, MosbergEnchantmentHelper, MosbergHelper, NBTHelper, NetworkHelper, ParticleHelper, PotionHelper, RecipeHelper, SerializationHelper, SoundHelper, StatusEffectHelper, TagHelper, VillagerHelper, WorldHelper

Data Generation

Fluent builders for recipes and loot tables:

// Shaped crafting
createShaped(RecipeCategory.TOOLS, ModItems.SWORD)
    .pattern(" I ")
    .pattern(" I ")
    .pattern(" S ")
    .input('I', Items.IRON_INGOT)
    .input('S', Items.STICK)
    .criterion(hasItem(Items.IRON_INGOT), conditionsFromItem(Items.IRON_INGOT))
    .offerTo(exporter);

// Smelting
offerSmelting(exporter, List.of(ModBlocks.ORE),
    RecipeCategory.MISC, ModItems.INGOT, 1.0f, 200, "ingot");

// Stonecutting
createStonecutting(RecipeCategory.BUILDING_BLOCKS, ModBlocks.STAIRS, ModBlocks.BLOCK)
    .criterion(hasItem(ModBlocks.BLOCK), conditionsFromItem(ModBlocks.BLOCK))
    .offerTo(exporter);

// Loot tables
addBlockLootTable(ModBlocks.ORE,
    LootTable.builder()
        .pool(LootPool.builder()
            .rolls(ConstantLootNumberProvider.create(1))
            .with(ItemEntry.builder(ModItems.INGOT))));

Built-in Commands

8 production-ready commands:

  • /block - Inspect and modify block properties
  • /item - Manage items and NBT data
  • /entity - Spawn and manipulate entities
  • /world - Control weather, time, explosions
  • /debug - Performance profiling and analysis
  • /config - Manage configuration at runtime
  • /registry - Introspect registered content
  • /help - Command documentation

Client-Side Rendering

Easy entity and screen registration:

// Register entity renderer
MosbergRenderers.registerEntityRenderer(
    ModEntities.CUSTOM_MOB,
    CustomMobRenderer::new,
    ModModelLayers.CUSTOM_MOB,
    CustomMobModel::getTexturedModelData
);

// Register screen
ScreenRegistry.register(ModScreenHandlers.CUSTOM,
    CustomScreen::new);

Client utilities:

  • MosbergRenderers - Entity/block renderers
  • MosbergModels - Model layer management
  • MosbergModelLayers - Pre-defined layers
  • MosbergRenderStates - 1.21+ render state API
  • MosbergScreenHandlerTypes - Screen handler registration
  • RenderHelper, ModelHelper, TextureHelper, ScreenHelper, ScreenHandlerHelper

Events

Custom event callbacks:

MosbergEvents.BLOCK_MINED.register((player, world, pos, state) -> {
    if (state.isOf(Blocks.DIAMOND_ORE)) {
        player.sendMessage(Text.literal("You mined diamonds!"), false);
    }
});

MosbergEvents.PLAYER_JOINED.register((player) -> {
    LOGGER.info("Player joined: {}", player.getName().getString());
});

MosbergEvents.ENTITY_SPAWNED.register((entity, world) -> {
    LOGGER.debug("Entity spawned: {}", entity.getType());
});

Configuration

JSON-based config with defaults:

public class ModConfig {
    public static final ConfigManager CONFIG = new ConfigManager("yourmod");

    public static int SPAWN_RATE = 10;
    public static boolean ENABLE_FEATURE = true;
    public static double DAMAGE_MULTIPLIER = 1.5;

    public static void load() {
        SPAWN_RATE = CONFIG.getInt("spawn_rate", 10);
        ENABLE_FEATURE = CONFIG.getBoolean("enable_feature", true);
        DAMAGE_MULTIPLIER = CONFIG.getDouble("damage_multiplier", 1.5);
        CONFIG.save();
    }
}

📁 What's Included

Registries (16 classes)

Register blocks, items, entities, enchantments, fluids, sounds, particles, status effects, potions, block entities, data components, damage types, game events, screen handlers, villagers, world generation, and tags.

Utilities (25 classes)

Inventory, entities, NBT, particles, world state, blocks, attributes, commands, enchantments, fluids, game events, item groups, networking, potions, recipes, serialization, sounds, status effects, tags, and villagers.

Commands (8 templates)

Block, item, entity, world, debug, config, registry, and help commands ready to use or extend.

Client Systems (11 classes)

Entity renderers, model management, screen handlers, render states (1.21+), and rendering utilities.

Data Generation

Fluent builders for recipes, loot tables, and models with full Minecraft 1.21.10 support.

Events

BlockMined, PlayerJoined, EntitySpawned, and more with simple registration.

Configuration

JSON-based config system with auto-generation and reload support.


🔧 System Requirements

  • Minecraft: 1.21.10
  • Fabric Loader: 0.18.3+
  • Fabric API: 0.138.4+1.21.10
  • Java: 21+

📚 Documentation

Full documentation available at:


🚀 Getting Started

  1. Add dependency to your build.gradle
  2. Update fabric.mod.json with Mosberg API dependency
  3. Create mod class implementing ModInitializer
  4. Register content using Mosberg API registry classes
  5. Use helpers to simplify common operations
  6. Build with ./gradlew build

Full examples and tutorials available on the GitHub Wiki.


💡 Why Choose Mosberg API?

Zero Boilerplate - Register anything with one line
Type-Safe - Modern Java 21 with full null safety
Production-Ready - 25+ tested utility helpers
Fluent APIs - Intuitive builder patterns
Comprehensive - Covers 60+ Minecraft registry types
Well-Documented - Every method has clear Javadoc
Active Development - Regular updates and improvements
Community-Driven - Open to feedback and contributions


📜 License

MIT License - Use in commercial projects, modify, distribute, or use for educational purposes. Attribution appreciated but not required.


🙏 Credits

  • Author: Mosberg
  • Framework: Fabric API & Fabric Loader
  • Mappings: Yarn community mappings
  • Game: Minecraft by Mojang Studios

📞 Support

Need help?

Want to contribute?

  • Fork on GitHub
  • Submit pull requests for improvements
  • Report issues and suggest features

🎯 Perfect For

✨ Mod developers who want to spend more time on gameplay and less on boilerplate
✨ Library mods that need a solid foundation
✨ Teams building content packs with custom mechanics
✨ Anyone using Fabric API 1.21.10+


Mosberg API - Write less boilerplate. Build better mods. Faster.

Made with ❤️ by Mosberg for the Minecraft modding community

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works