Skip to content

Latest commit

 

History

History
147 lines (107 loc) · 5.59 KB

README.md

File metadata and controls

147 lines (107 loc) · 5.59 KB

Minecraft-Client-Module-API

Author: Crestoushovel

A lightweight, extensible API that lets you craft, configure, and plug‑in client‑side gameplay modules for Minecraft – all from pure Java.


📦 What Is This?

The Minecraft‑Client‑Module‑API (MCM‑API) is a developer‑friendly framework that abstracts the boilerplate of creating client‑side modules.

  • Configurable – declarative JSON/YAML configuration files for every module.
  • Plug‑and‑Play – drop‑in JARs are discovered automatically at runtime.
  • Extensible – hook into rendering, input, networking, or any game event with a clean, type‑safe API.

Think of it as the “Spring Boot” for Minecraft client utility – but without the server overhead.


🎯 Who Should Use It?

✅ Use‑Case 📚 Ideal For
Rapid prototyping of new client features Modders who want to iterate quickly
Building a suite of reusable gameplay utility Teams maintaining a shared utility library
Adding custom UI panels, HUD elements, or keybinds Developers familiar with Java and the Minecraft client
Centralising configuration across many modules Anyone who hates scattered config.yml files

🚀 Quick Start (30‑Second Release)

  1. Create a new Maven/Gradle project and add the API as a dependency.

    <!-- Maven -->
    <dependency>
        <groupId>io.crestof</groupId>
        <artifactId>minecraft-client-module-api</artifactId>
        <version>1.0.0</version>
    </dependency>
    // Gradle (Kotlin DSL)
    implementation("io.crestof:minecraft-client-module-api:1.0.0")
  2. Implement a module by extending ClientModule and annotating it with @ModuleInfo.

    @ModuleInfo(
        id = "example.fps_counter",
        name = "FPS Counter",
        version = "1.0.0",
        description = "Shows current FPS on the HUD."
    )
    public final class FpsCounterModule extends ClientModule {
        @Override
        public void onRenderHud(RenderEvent e) {
            e.drawString(String.format("FPS: %d", Minecraft.getFPS()), 10, 10, 0xFFFFFF);
        }
    }
  3. Drop the compiled JAR into the utility/ folder of your client and launch Minecraft.
    The API will auto‑register the module and load its configuration from config/modules/example.fps_counter.json.

  4. Tweak the config (optional).

    {
        "enabled": true,
        "position": { "x": 10, "y": 10 },
        "color": "#00FF00"
    }

That’s it – you now have a live, hot‑reloadable module!


📚 Core Concepts

Concept Description
ClientModule Base class; override event callbacks (onTick, onRenderWorld, onChatMessage, …).
@ModuleInfo Annotation that supplies metadata used for registration and config generation.
ModuleRegistry Central hub that loads, enables, disables, and queries modules at runtime.
ConfigManager Handles per‑module JSON/YAML files, supports live reload on file change.
EventBus Publish‑subscribe system for custom or built‑in Minecraft events.
DependencyResolver Allows one module to declare required other modules (@RequiresModules).

🔧 Advanced Features

  • Dynamic Hot‑Swap – Edit a module’s source, re‑compile, and the API hot‑reloads it without a full client restart.
  • Custom UI Builder – Fluent API to create dialogs, sliders, and checkboxes that automatically sync with config.
  • Network Hooking – Intercept and modify outgoing/incoming packets in a type‑safe way.
  • Keybind Manager – Register global or context‑aware keybinds with auto‑persistence.
  • Permission Layers – Define module access levels (e.g., PUBLIC, PRIVATE, EXPERIMENTAL).

📦 Download & Installation

Tip: The Release Wizard walks you through dependency addition, sample module generation, and config scaffolding.


🛠️ Contributing

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feat/your‑feature).
  3. Follow the code style defined in CONTRIBUTING.md (Google Java Format, Javadoc on all public APIs).
  4. Run the full test suite: ./gradlew test.
  5. Open a Pull Request with a clear description of the change.

All contributions are welcomed – from documentation improvements to new event types.


📜 License

Minecraft-Client-Module-API is released under the MIT License – see the LICENSE file for full terms.


📬 Get in Touch

Happy modding! 🚀