ScannerLib

A cross-loader annotation scanning library for NeoForge and Fabric on Minecraft 1.21.1.

ScannerLib

A cross-loader annotation scanning library for Minecraft 1.21.1 (NeoForge + Fabric).

ScannerLib discovers annotations from all loaded mods and exposes a loader-neutral index. It does not add items, blocks, registries, or datagen content.

This is a library mod. It adds no gameplay content. Install it only if another mod requires it.

Features

  • Scan once and share the index globally
  • Declarative scanning with @ScanAnnotations
  • Identical query API on NeoForge and Fabric
  • Raw annotation values plus resolved defaults
  • Source mod id on every hit
  • TYPE, FIELD, METHOD, and CONSTRUCTOR targets
  • Optional include / exclude class-name filters

Compatibility

  • Minecraft: 1.21.1
  • NeoForge: 21.1.0+
  • Fabric Loader: 0.15.11+
  • Java: 21+

Installation

  • NeoForge: put scannerlib-neoforge-1.1.0.jar in mods/
  • Fabric: put scannerlib-fabric-1.1.0.jar in mods/
  • Do not put scannerlib-api-1.1.0.jar in mods/; it is a compile-only developer artifact.

For developers

@ScanAnnotations(MyEntry.class)
public final class MyScanConfig {
    private MyScanConfig() {
    }
}
AnnotationIndex index = AnnotationScan.index();

for (AnnotationHit hit : index.find(MyEntry.class, ElementType.FIELD)) {
    MyEntry entry = hit.readAnnotation(MyEntry.class);
}

Links

中文说明

ScannerLib 是一个跨加载器注解扫描库,面向模组开发者。它扫描所有已加载模组中的注解并提供全局索引,本身不添加物品、方块或玩法内容。

这是库模组,只有其他模组要求时才需要安装。scannerlib-api 仅用于开发编译,不要放入 mods/。

ScannerLib Team

profile avatar
  • 2
    Projects
  • 17
    Downloads

More from Vanil1a_Chocolate

  • AnnoLib project image

    AnnoLib

    AnnoLib is an annotation-driven library for NeoForge 1.21.1 that helps mod developers register content, generate assets, and add runtime features with simple annotations.

    • 2
    • December 3, 2026
  • AnnoLib project image

    AnnoLib

    AnnoLib is an annotation-driven library for NeoForge 1.21.1 that helps mod developers register content, generate assets, and add runtime features with simple annotations.

    • 2
    • December 3, 2026