HomeJavaModsMebahel's API
Mebahel's API
ModsJava

Mebahel's API

by Mebahel · on CurseForge

Mebahel’s API is a core dependency mod that provides shared systems, utilities, and gameplay frameworks used across the Mebahel mod ecosystem.

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21–1.21.1 · Fabric⬇ Download for 1.20–1.20.1 · Fabric⬇ Download for 1.21–1.21.1 · Forge⬇ Download for 1.20–1.20.1 · Forge⬇ Download for 1.21–1.21.1 · NeoForge⬇ Download for 1.20–1.20.1 · NeoForge⬇ Download for 1.21–1.21.1 · Quilt⬇ Download for 1.20–1.20.1 · Quilt
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

Mebahel's API

Shared systems and utilities used by Mebahel mods.

Mebahel's API is a Fabric library that provides common systems used across several Mebahel projects. It contains reusable code for structure processing, custom containers, multiplayer loot handling, entity movement, and other features that would otherwise need to be implemented separately in each mod.

The mod is primarily a technical dependency and does not add standalone gameplay content by itself.


Dependencies

Forge / NeoForge

Fabric


For Players and Modpack Users

Mebahel's API is installed as a dependency for mods that use its shared systems. In most cases, players do not interact with it directly.

Depending on the mod using the API, it can provide features such as dry structure generation, animated custom chests, personal loot, synchronized container behavior, and improved movement for custom entities.

Structure Water Removal

Structures can use the API to remove water and waterlogged states after generation. This is useful for dungeons, ruins, and other structures that may intersect oceans, rivers, caves, or aquifers.

Custom Chests

Mods using the chest framework can provide custom containers with features such as:

When personal loot is enabled, each player receives their own generated inventory from the configured loot table instead of sharing the same chest contents.

Entity Movement

Custom entities can use shared movement utilities for combat positioning, including strafing, retreating when a target is too close, target-facing rotation, jump assistance, and anti-stuck handling.

Installation

Install Mebahel's API when another mod lists it as a required dependency.

It must be present in the appropriate environment for the mod that depends on it. Removing the API while dependent mods are installed can prevent them from loading or functioning correctly.


For Mod Developers

Mebahel's API provides reusable foundations for systems shared between Fabric mods. The goal is to keep common behavior in one library instead of maintaining separate implementations in every project.

The main systems currently exposed by the API include:


Developer Installation

Add the API repository and dependency to your Fabric project.

Maven Repository

repositories {
    maven {
        name = "GitLab-Mebahel"
        url = uri("https://gitlab.com/api/v4/projects/77311613/packages/maven")
    }
}

Dependency

dependencies {
    modImplementation "net.mebahelsapi:mebahels-api:<version>"
}

fabric.mod.json

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

Structure Water Removal Processor

The water removal processor is intended for structures that should remain dry after generation.

It can:

Usage

Add the processor to the relevant structure processor configuration:

"processors": "mebahelsapi:water_removal_processor"

The cleanup is handled automatically after structure placement and runs on the server side.


Custom Chest Framework

The chest framework provides a base implementation for custom containers that need animation, synchronization, custom sounds, or multiplayer-specific inventory behavior.

It includes support for:

Personal Loot

When a loot table is configured, the chest can generate a separate inventory for each player. Loot is generated once for that player and stored independently from the inventories seen by other players.

This is useful for dungeon rewards, boss chests, or multiplayer structures where every player should be able to claim their own loot.

Shared Inventory

When no personal loot table is used, the chest behaves as a shared container and all players access the same inventory.

Example Block Entity

public class DwemerChestBlockEntity extends BaseChestBlockEntity {
    public DwemerChestBlockEntity(BlockPos pos, BlockState state) {
        super(ModBlockEntities.DWEMER_CHEST_ENTITY, pos, state, 36);
    }

    @Override
    protected Text getChestTitle() {
        return Text.translatable("block.mebahelcreaturesdwarven.dwemer_chest");
    }

    @Override
    protected String getLogPrefix() {
        return "[DwemerChest]";
    }

    @Override
    @Environment(EnvType.CLIENT)
    public void playOpenSound() {
        playChestSound(ModSounds.DWARVEN_CHEST_OPEN);
    }

    @Override
    @Environment(EnvType.CLIENT)
    public void playCloseSound() {
        playChestSound(ModSounds.DWARVEN_CHEST_CLOSE);
    }

    @Override
    protected boolean isMultiplayerEnabled() {
        return ModMultiplayerChest.turnOnMultiplayerDraugrChest;
    }
}

Example Block

public class DwemerChestBlock extends BaseChestBlock {
    public DwemerChestBlock(AbstractBlock.Settings settings) {
        super(
                settings,
                () -> ModBlockEntities.DWEMER_CHEST_ENTITY,
                DwemerChestBlockEntity::new
        );
    }

    @Override
    protected boolean isMultiplayerEnabled() {
        return ModMultiplayerChest.turnOnMultiplayerDraugrChest;
    }
}

MovementUtil

MovementUtil contains reusable helpers for custom entity movement and combat positioning. It is mainly intended for ranged mobs, bosses, constructs, and other entities that need more control than a basic navigation goal provides.

Typical uses include:

Movement and attack timing can be handled separately so animations and attacks remain independent from positioning logic.

Example Shooting Goal

public class DraugrArcherShootingGoal extends Goal {
    private final DraugrArcherEntity actor;
    private final MovementUtil movementUtil;
    private final double STRAFE_DISTANCE = 8;

    public DraugrArcherShootingGoal(DraugrArcherEntity actor) {
        this.actor = actor;
        this.movementUtil = new MovementUtil(this.actor);
    }

    @Override
    public void tick() {
        if (actor.isUsingPotion() || actor.getHealTicks() > 0) {
            actor.setShooting(false);
            actor.getNavigation().stop();
            return;
        }

        LivingEntity target = this.actor.getTarget();
        if (target == null || !target.isAlive()) {
            this.stop();
            return;
        }

        double distanceToTarget = this.actor.distanceTo(target);

        movementUtil.lookAtTarget(target, actor);
        movementUtil.checkIfStuck(target, actor);

        if (distanceToTarget <= STRAFE_DISTANCE) {
            movementUtil.moveBackward(target, actor);
        } else {
            movementUtil.strafeAroundTarget(target, actor);
        }

        // Shooting logic handled separately
    }
}

A typical goal can validate the target, update rotation, run anti-stuck handling, choose movement based on distance, and then handle attack timing separately.


Used By

Mebahel's API is used as the shared library for Mebahel mods that rely on these systems.

Keeping this functionality in a common dependency makes it possible to reuse fixes and improvements across multiple projects without maintaining duplicate implementations.


Current Status

Mebahel's API is actively maintained alongside the mods that depend on it. Additional shared systems may be moved into the API when they are useful across more than one project.

Join the community and follow development on Discord: https://discord.com/invite/y8uC2NepkB

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more