MCPcopy Index your code
hub / github.com/FabricMC/fabric-api

github.com/FabricMC/fabric-api @0.154.1+26.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.154.1+26.2 ↗ · + Follow
8,801 symbols 29,045 edges 1,628 files 2,054 documented · 23%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Fabric API

Essential hooks for modding with Fabric.

Fabric API is the library for essential hooks and interoperability mechanisms for Fabric mods. Examples include:

  • Exposing functionality that is useful but difficult to access for many mods such as particles, biomes and dimensions
  • Adding events, hooks and APIs to improve interoperability between mods.
  • Essential features such as registry synchronization and adding information to crash reports.
  • An advanced rendering API designed for compatibility with optimization mods and graphics overhaul mods.

Also check out Fabric Loader, the (mostly) version-independent mod loader that powers Fabric. Fabric API is a mod like any other Fabric mod which requires Fabric Loader to be installed.

For support and discussion for both developers and users, visit the Fabric Discord server.

Using Fabric API to play with mods

Make sure you have installed fabric loader first. More information about installing Fabric Loader can be found here.

To use Fabric API, download it from CurseForge, GitHub Releases or Modrinth.

The downloaded jar file should be placed in your mods folder.

Using Fabric API to develop mods

To set up a Fabric development environment, check out the Fabric example mod and follow the instructions there. The example mod already depends on Fabric API.

To include the full Fabric API with all modules in the development environment, add the following to your dependencies block in the gradle buildscript:

Groovy DSL

modImplementation "net.fabricmc.fabric-api:fabric-api:FABRIC_API_VERSION"

Kotlin DSL

modImplementation("net.fabricmc.fabric-api:fabric-api:FABRIC_API_VERSION")

Alternatively, modules from Fabric API can be specified individually as shown below (including module jar to your mod jar):

Groovy DSL

// Make a collection of all api modules we wish to use
Set<String> apiModules = [
    "fabric-api-base",
    "fabric-command-api-v1",
    "fabric-lifecycle-events-v1",
    "fabric-networking-api-v1"
]

// Add each module as a dependency
apiModules.forEach {
    include(modImplementation(fabricApi.module(it, FABRIC_API_VERSION)))
}

Kotlin DSL

// Make a set of all api modules we wish to use
setOf(
    "fabric-api-base",
    "fabric-command-api-v1",
    "fabric-lifecycle-events-v1",
    "fabric-networking-api-v1"
).forEach {
    // Add each module as a dependency
    modImplementation(fabricApi.module(it, FABRIC_API_VERSION))
}

Instead of hardcoding version constants all over the build script, Gradle properties may be used to replace these constants. Properties are defined in the gradle.properties file at the root of a project. More information is available here.

Contributing

See something Fabric API doesn't support, a bug or something that may be useful? We welcome contributions to improve Fabric API. Make sure to read the development guidelines.

Modules

Fabric API is designed to be modular for ease of updating. This also has the advantage of splitting up the codebase into smaller chunks.

Each module contains its own README.md* explaining the module's purpose and additional info on using the module.

* The README for each module is being worked on; not every module has a README at the moment

Extension points exported contracts — how you extend this code

PlayPayloadHandler (Interface)
A thread-safe payload handler utilizing CustomPacketPayload. @param the type of the payload [6 implementers]
fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java
SpecialLogicContainer (Interface)
Internal class that allows inventory instances to defer special logic until ContainerSlotWrapper#onFinalCommit() [7 implementers]
fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/SpecialLogicContainer.java
ResourceCondition (Interface)
A resource condition. To create a custom condition type, implement this interface, call {@link ResourceConditionType#cre [20 …
fabric-resource-conditions-api-v1/src/main/java/net/fabricmc/fabric/api/resource/conditions/v1/ResourceCondition.java
FabricBlockStateModelPart (Interface)
Note: This interface is automatically implemented on BlockStateModelPart via Mixin and interface injection. [11 implementers]
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/model/FabricBlockStateModelPart.java
UnbakedExtraModel (Interface)
An unbaked extra model. Similar to ItemModel.Unbaked and other ResolvableModel, this model can {@lin [11 implementers]
fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/api/client/model/loading/v1/UnbakedExtraModel.java
FabricClientGameTest (Interface)
The fabric-client-gametest entrypoint interface. See the package documentation. [18 implementers]
fabric-client-gametest-api-v1/src/client/java/net/fabricmc/fabric/api/client/gametest/v1/FabricClientGameTest.java
SoundExporter (Interface)
A consumer used by FabricSoundsProvider#configure. [15 implementers]
fabric-data-generation-api-v1/src/client/java/net/fabricmc/fabric/api/client/datagen/v1/provider/FabricSoundsProvider.java
HudElement (Interface)
Represents a mod added net.minecraft.client.gui.Gui element that can be rendered on the screen. HUD element [6 implementers]
fabric-rendering-v1/src/client/java/net/fabricmc/fabric/api/client/rendering/v1/hud/HudElement.java

Core symbols most depended-on inside this repo

add
called by 1924
fabric-content-registries-v0/src/main/java/net/fabricmc/fabric/api/util/Item2ObjectMap.java
builder
called by 416
fabric-creative-tab-api-v1/src/main/java/net/fabricmc/fabric/api/creativetab/v1/FabricCreativeModeTab.java
register
called by 349
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/Renderer.java
invoker
called by 278
fabric-api-base/src/main/java/net/fabricmc/fabric/api/event/Event.java
get
called by 268
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/Renderer.java
register
called by 265
fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag/convention/v2/ConventionalItemTags.java
literal
called by 231
fabric-command-api-v2/src/client/java/net/fabricmc/fabric/api/client/command/v2/ClientCommands.java
size
called by 225
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/mesh/MeshView.java

Shape

Method 6,665
Class 1,425
Interface 679
Enum 32

Languages

Java100%

Modules by API surface

fabric-data-generation-api-v1/src/testmod/java/net/fabricmc/fabric/test/datagen/DataGeneratorTestEntrypoint.java57 symbols
fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/api/gamerule/v1/GameRuleBuilder.java54 symbols
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/impl/biome/modification/BiomeModificationContextImpl.java53 symbols
fabric-biome-api-v1/src/main/java/net/fabricmc/fabric/api/biome/v1/BiomeModificationContext.java42 symbols
fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/QuadViewImpl.java40 symbols
fabric-screen-api-v1/src/client/java/net/fabricmc/fabric/api/client/screen/v1/ScreenMouseEvents.java38 symbols
fabric-screen-api-v1/src/client/java/net/fabricmc/fabric/mixin/screen/ScreenMixin.java37 symbols
fabric-model-loading-api-v1/src/client/java/net/fabricmc/fabric/impl/client/model/loading/ModelLoadingEventDispatcher.java34 symbols
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/mesh/QuadView.java33 symbols
fabric-renderer-api-v1/src/client/java/net/fabricmc/fabric/api/client/renderer/v1/mesh/QuadEmitter.java32 symbols
fabric-screen-api-v1/src/client/java/net/fabricmc/fabric/impl/client/screen/ScreenExtensions.java30 symbols
fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl.java30 symbols

For agents

$ claude mcp add fabric-api \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact