Mineuniverse
Mods
AnvilLib

AnvilLib

MOD
AnvilLib is a NeoForge mod library developed by Anvil-Dev, providing Minecraft mod developers with a series of practical tools and frameworks.
by Gugle
Download Claim this project
6,045 downloads
0 likes
0 followers
Updated Oct 14, 2026
0 hypes
Follow0
API and Library
Advertisement Remove ads with Premium →

AnvilLib

Minecraft Maven Central NeoForge ![License](https://img.shields.io/badge/License-MIT License-blue.svg)

AnvilLib is a NeoForge mod library developed by Anvil Dev, providing Minecraft mod developers with a series of practical tools and frameworks.

Features

AnvilLib adopts a modular design and includes the following functional modules:

Module Description
Config Annotation-based configuration system
Integration Mod compatibility integration framework
Network Networking API with automatic packet registration
Recipe In-world recipe system
Moveable Entity Block Support for block entities movable by pistons
Registrum Simplified registration system
Main Aggregated module that bundles all submodules

Module Introduction

Config Module

Provides an annotation-based configuration management system to simplify the definition and management of mod configurations.

Key Features:

  • Define configuration classes using @Config annotation
  • Add configuration comments with @Comment
  • Define numerical ranges with @BoundedDiscrete
  • Create nested configurations with @CollapsibleObject
  • Automatically generate client configuration GUI

Usage Example:

@Config(name = "my_mod", type = ModConfig.Type.COMMON)
public class MyModConfig {
    @Comment("Enable debug mode")
    public boolean debugMode = false;

    @Comment("Maximum count")
    @BoundedDiscrete(min = 1, max = 100)
    public int maxCount = 10;
}

// Register configuration
MyModConfig config = ConfigManager.register("my_mod", MyModConfig::new);

Integration Module

Provides a framework for mod integrations, supporting automatic loading of integration code based on the presence of other mods.

Key Features:

  • Declare integration classes with @Integration annotation
  • Support for version range matching
  • Support for different runtime environments (CLIENT / DEDICATED_SERVER / DATA)

Usage Example:

@Integration(value = "jei", version = "[19.0,)")
public class JEIIntegration {
    public void init() {
        // JEI integration logic
    }
}

Network Module

Provides a NeoForge networking abstraction with package-based packet auto-registration.

Key Features:

  • Define packet direction using IClientboundPacket / IServerboundPacket / IInsensitiveBiPacket
  • Automatically register packet classes in a package via NetworkRegistrar.register(...)
  • Supports PLAY, CONFIGURATION, and COMMON protocols

Usage Example:

@SubscribeEvent
public static void onRegisterPayload(RegisterPayloadHandlersEvent event) {
    PayloadRegistrar registrar = event.registrar("1");
    NetworkRegistrar.register(registrar, "my_mod");
}

Recipe Module

Provides an in-world recipe system, allowing recipes to be executed in the world (rather than in crafting tables).

Key Features:

  • Supports custom recipe triggers (Trigger)
  • Supports recipe predicates (Predicate) for conditional checks
  • Supports multiple recipe outcomes (Outcome)
  • Built-in priority system
  • Full datapack support

Recipe Components:

  • Trigger: Conditions to trigger the recipe (e.g., item dropping, explosions)
  • Predicate: Recipe matching conditions
  • Outcome: Recipe execution results (e.g., spawning items, setting blocks)

Moveable Entity Block Module

Allows blocks with block entities to be pushed by pistons while preserving their data.

Usage Example:

public class MyBlock extends Block implements IMoveableEntityBlock {
    @Override
    public CompoundTag clearData(Level level, BlockPos pos) {
        // Return block entity data to preserve
        BlockEntity be = level.getBlockEntity(pos);
        return be != null ? be.saveWithoutMetadata(level.registryAccess()) : new CompoundTag();
    }

    @Override
    public void setData(Level level, BlockPos pos, CompoundTag nbt) {
        // Restore block entity data at new position
        BlockEntity be = level.getBlockEntity(pos);
        if (be != null) {
            be.loadAdditional(nbt, level.registryAccess());
        }
    }
}

Registrum Module

A registration system based on Registrate, simplifying the registration process for items, blocks, entities, etc.

Key Features:

  • Chain-style API design
  • Automatic language file generation
  • Automatic datapack generation
  • Support for various builders

Usage Example:

public static final Registrum REGISTRUM = Registrum.create("my_mod");

public static final RegistryEntry<Item> MY_ITEM = REGISTRUM
    .item("my_item", Item::new)
    .properties(p -> p.stacksTo(16))
    .register();

Main Module

anvillib-neoforge-1.21.1 is the aggregate artifact. It bundles and re-exports:

  • config
  • integration
  • network
  • recipe
  • moveable-entity-block
  • registrum

Dependency Integration

Gradle (Groovy DSL)

repositories {
    mavenCentral() // This project is already uploaded to Maven Central
}

dependencies {
    // Full library
    implementation "dev.anvilcraft.lib:anvillib-neoforge-1.21.1:2.0.0"

    // Or import individual modules as needed
    implementation "dev.anvilcraft.lib:anvillib-config-neoforge-1.21.1:2.0.0"
    implementation "dev.anvilcraft.lib:anvillib-integration-neoforge-1.21.1:2.0.0"
    implementation "dev.anvilcraft.lib:anvillib-network-neoforge-1.21.1:2.0.0"
    implementation "dev.anvilcraft.lib:anvillib-recipe-neoforge-1.21.1:2.0.0"
    implementation "dev.anvilcraft.lib:anvillib-moveable-entity-block-neoforge-1.21.1:2.0.0"
    implementation "dev.anvilcraft.lib:anvillib-registrum-neoforge-1.21.1:2.0.0"
}

Gradle (Kotlin DSL)

repositories {
    mavenCentral() // This project is already uploaded to Maven Central
}

dependencies {
    implementation("dev.anvilcraft.lib:anvillib-neoforge-1.21.1:2.0.0")

    // Optional single-module example
    implementation("dev.anvilcraft.lib:anvillib-network-neoforge-1.21.1:2.0.0")
}

Keep the dependency version aligned with release tags (current project property is mod_version=2.0.0).

Building the Project

# Clone repository
git clone https://github.com/Anvil-Dev/AnvilLib.git
cd AnvilLib

# Build on macOS / Linux
./gradlew build

# Build on Windows (PowerShell / CMD)
gradlew.bat build

Requirements

  • Java 21+
  • Minecraft 1.21.1
  • NeoForge 21.1.x

License

This project is licensed under the MIT License.

Part of the Registrum module code is based on Registrate and follows the Mozilla Public License 2.0.

Author

  • Gugle - Main developer

Links

anvillib-neoforge-26.1 2.0.0+snapshot.549
MC Client, NeoForge, Server, 26.1.2
Beta 2026-10-10 Get
anvillib-neoforge-1.21.4 2.0.0+snapshot.551
MC Client, 1.21.4, NeoForge, Server
Beta 2026-10-10 Get
anvillib-neoforge-1.21.11 2.0.0+snapshot.552
MC Client, NeoForge, Server, 1.21.11
Beta 2026-10-10 Get
anvillib-neoforge-1.21.8 2.0.0+snapshot.554
MC Client, 1.21.8, NeoForge, Server
Beta 2026-10-10 Get
anvillib-neoforge-26.1 2.0.0+snapshot.553
MC Client, NeoForge, Server, 26.1.2
Beta 2026-10-10 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.550
MC Client, 1.21.1, NeoForge, Server
Beta 2026-10-10 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.543
MC Client, 1.21.1, NeoForge, Server
Beta 2026-10-03 Get
anvillib-neoforge-1.21.4 2.0.0+snapshot.544
MC Client, 1.21.4, NeoForge, Server
Beta 2026-10-03 Get
anvillib-neoforge-1.21.8 2.0.0+snapshot.545
MC Client, 1.21.8, NeoForge, Server
Beta 2026-10-03 Get
anvillib-neoforge-26.1 2.0.0+snapshot.548
MC Client, NeoForge, Server, 26.1.2
Beta 2026-10-03 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.546
MC Client, 1.21.1, NeoForge, Server
Beta 2026-10-03 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.542
MC Client, 1.21.1, NeoForge, Server
Beta 2026-10-01 Get
anvillib-neoforge-26.1 2.0.0+snapshot.541
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-30 Get
anvillib-neoforge-1.21.11 2.0.0+snapshot.537
MC Client, NeoForge, Server, 1.21.11
Beta 2026-09-28 Get
anvillib-neoforge-26.1 2.0.0+snapshot.536
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-28 Get
anvillib-neoforge-1.21.8 2.0.0+snapshot.540
MC Client, 1.21.8, NeoForge, Server
Beta 2026-09-28 Get
anvillib-neoforge-1.21.4 2.0.0+snapshot.538
MC Client, 1.21.4, NeoForge, Server
Beta 2026-09-28 Get
anvillib-neoforge-26.1 2.0.0+snapshot.539
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-28 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.535
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-25 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.534
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-22 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.532
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-21 Get
anvillib-neoforge-26.1 2.0.0+snapshot.533
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-21 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.530
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-16 Get
anvillib-neoforge-26.1 2.0.0+snapshot.531
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-16 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.523
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-12 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.524
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-12 Get
anvillib-neoforge-1.21.8 2.0.0+snapshot.527
MC Client, 1.21.8, NeoForge, Server
Beta 2026-09-12 Get
anvillib-neoforge-1.21.4 2.0.0+snapshot.528
MC Client, 1.21.4, NeoForge, Server
Beta 2026-09-12 Get
anvillib-neoforge-1.21.11 2.0.0+snapshot.526
MC Client, NeoForge, Server, 1.21.11
Beta 2026-09-12 Get
anvillib-neoforge-26.1 2.0.0+snapshot.525
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-12 Get
anvillib-neoforge-26.1 2.0.0+snapshot.529
MC Client, NeoForge, Server, 26.1.2
Beta 2026-09-12 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.522
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-11 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.521
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-09 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.520
MC Client, 1.21.1, NeoForge, Server
Beta 2026-09-07 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.518
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-31 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.516
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-25 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.517
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-25 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.515
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-23 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.514
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-22 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.513
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-21 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.512
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-19 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.510
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-17 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.511
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-17 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.509
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-14 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.506
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-13 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.507
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-13 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.508
MC Client, 1.21.1, NeoForge, Server
Beta 2026-08-13 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.499
MC Client, 1.21.1, NeoForge, Server
Beta 2026-07-24 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.500
MC Client, 1.21.1, NeoForge, Server
Beta 2026-07-24 Get
anvillib-neoforge-1.21.1 2.0.0+snapshot.497
MC Client, 1.21.1, NeoForge, Server
Beta 2026-07-22 Get

More from Gugle

Advertisement Remove ads with Premium →

You Might Also Like