Mebahel's API logo

Mebahel's API

Mod

by Mebahel

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

Downloads

62,054

Type

Mod

CurseForge ID

1463166

Last Updated

Apr 9, 2026

Description

Mebahel’s API — Core Library for Mebahel Mods

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

It is designed for mod developers who want production-ready building blocks for complex mechanics without rewriting the same infrastructure in every project.

⚠️ This mod is a library. It does not add standalone gameplay content by itself.

Supported Versions

  • Minecraft 1.20.1 — Fabric
  • Minecraft 1.21.1 — Fabric

⭐ For Players & Modpack Users

This mod is a technical dependency used by other Mebahel mods.

What it does in a game

You normally won’t interact with this mod directly.
It runs in the background to make other mods work correctly and efficiently.

Depending on the mod that uses it, it may provide:

🌊 Dry Structure Generation

Structures can generate without being flooded, even underwater or inside wet terrain.

📦 Advanced Custom Chests

Some Mebahel mods use special chests powered by this API:

  • Animated opening and closing
  • Multiplayer-safe inventories
  • Optional per-player rewards (each player gets their own loot)
  • Custom sounds and GUI

⚔️ Improved Mob Behavior

Certain creatures may use advanced movement such as:

  • Strafing during combat
  • Tactical retreat when too close
  • More natural positioning
  • Reduced “stuck” behavior

Do I need this mod?

✔ Required if another mod lists it as a dependency
✔ Safe for singleplayer and multiplayer
✔ Must be installed on both client and server

❌ Removing it will break mods that depend on it

⭐ For Mod Developers

Mebahel’s API provides reusable systems intended to simplify the development of complex Fabric mods.

Main Systems Provided

🌊 Structure Water Removal System

Prevents structures from spawning flooded in oceans, rivers, or aquifers.

Capabilities

  • Removes waterlogged states after generation
  • Clears surrounding water blocks inside structure bounds
  • Works with template-based structures
  • Tick-budget safe (no lag spikes)
  • Fully automated once configured

📦 Advanced Animated Chest Framework

A complete foundation for creating custom containers with multiplayer-safe logic.

Includes

  • GeckoLib animated open/close/spawn sequences
  • Built-in sound synchronization
  • Custom GUI support
  • Server-authoritative behavior
  • Multiplayer compatibility
Personal Loot Mode

When using a loot table:

  • Each player receives individual rewards
  • Loot is generated once per player
  • Prevents duplication exploits
  • Ideal for dungeon or boss chests
Shared Inventory Mode

Without a loot table:

  • Functions as a normal container
  • Inventory shared between players

🖥️ Ready-to-Use GUI & Screen Handler

Speeds up development of container blocks:

  • Preconfigured ScreenHandler
  • Player inventory integration
  • Client GUI implementation
  • Minimal boilerplate required

⚔️ Entity Movement Utilities

Utility methods for advanced combat AI and movement behavior.

Supports:

  • Strafing around targets
  • Tactical retreat movement
  • Target-facing rotation
  • Jump assistance
  • Anti-stuck handling

Ideal for bosses, ranged mobs, constructs, or mechanical entities.

🧠 Why Use Mebahel’s API?

✔ Reduces duplicated code across multiple mods
✔ Optimized for server performance
✔ Multiplayer-safe systems
✔ Production-ready implementations
✔ Actively used in real released mods

🔧 Installation (Developers)

Add the API as a dependency in your Fabric mod 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": "*" } }

⚙️ Required Dependencies

  • Fabric Loader
  • Fabric API
  • GeckoLib (for animated blocks and entities)

Ensure versions match your Minecraft version.

📦 Used By

All Mebahel ecosystem mods depend on this API as their shared core library.

👨‍💻 Developer Guide — Integration

🌊 Water Removal Processor (Structures)

Automatically removes water and waterlogged states after structure generation.

Use cases

  • Ocean structures
  • Underground builds intersecting fluids
  • Ruins or dungeons that must remain dry

How to enable

Add the processor to your structure configuration:

"processors": "mebahelsapi:water_removal_processor"

The cleanup runs automatically after placement.
Server-side only.

📦 BaseChest Framework — Custom Animated Containers

Provides a ready-to-extend system for animated, synchronized chests.

Creating a Custom Chest

  1. Extend the base chest block
  2. Extend the base chest block entity
  3. Register them normally
  4. Configure title, sounds, and multiplayer behavior

Example — ChestBlockEntity:

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 — ChestBlock:

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 — Advanced AI Positioning

MovementUtil provides reusable helpers for combat movement, especially for ranged entities.

Typical responsibilities:

  • Keep the entity facing its target
  • Prevent pathfinding stalls
  • Maintain optimal distance
  • Control strafe and retreat behavior

Recommended usage pattern inside a Goal:

1) Validate target
2) Face the target
3) Run anti-stuck logic
4) Choose movement based on distance
5) Handle attack timing separately

Example — Shooting Goal (Draugr Archer):

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 } }

This separation keeps movement smooth while allowing precise control over attack timing and animations.

📜 Notes

  • This mod is a core library required by several Mebahel projects.
  • Removing it will cause dependent mods to fail to load or function incorrectly.
  • Safe for both singleplayer and dedicated server environments.
  • Does not add standalone gameplay content by itself.
  • Join the community on Discord: https://discord.com/invite/y8uC2NepkB

Similar Mods

Included in Modpacks

External Resources