• Stars
    star
    2,224
  • Rank 20,738 (Top 0.5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Essential hooks for modding with Fabric.

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

More Repositories

1

fabric-example-mod

Example Fabric mod
Java
1,592
star
2

yarn

Libre Minecraft mappings, free to use for everyone. No exceptions.
Java
877
star
3

fabric-loader

Fabric's mostly-version-independent mod loader.
Java
599
star
4

Enigma

This is a fork of cuchaz's Enigma, a deobfuscation/remapping tool for Java software.
Java
445
star
5

fabric-language-kotlin

Fabric language module for Kotlin.
Kotlin
286
star
6

fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
Java
226
star
7

tiny-remapper

Tiny JAR remapping tool.
Java
108
star
8

fabric-installer

An Installer for Fabric. For the vanilla launcher
Java
102
star
9

intermediary

Match and mapping information between different versions of Minecraft
98
star
10

fabricmc.net

The source code and content for https://fabricmc.net/
TypeScript
47
star
11

fabric-docs

[WIP] Official curated documentation for Fabric, a modding toolchain for Minecraft.
Java
47
star
12

fabric-language-scala

Fabric language module for Scala.
Scala
43
star
13

mapping-io

Mapping-IO is a small and efficient library for working with deobfuscation mapping files.
Java
41
star
14

fabric-sandbox

Highly experimental sandbox for Fabric mods.
Swift
37
star
15

fabric-meta

Fabric Meta is a JSON-based HTTP api that can be used to query metadata about key Fabric projects.
Java
29
star
16

stitch

Stitch is a set of tools for working with and updating Tiny-format mappings. Potentially a future replacement for Weave.
Java
25
star
17

access-widener

Access wideners provide a way to loosen the access limits of classes.
Java
15
star
18

tiny-mappings-parser

Library for parsing .tiny mapping files
Java
13
star
19

weave

Fabric auxillary tools
Java
10
star
20

community

Docs, tags and orchestration.
10
star
21

fabric-language-groovy

Groovy
9
star
22

MappingPoet

A skeleton java code generator used to generate javadoc for yarn
Java
8
star
23

fabric-mixin-compile-extensions

Extensions for Mixin's annotation processor.
Java
8
star
24

lorenz-tiny

Lorenz tiny mappings reader
Java
8
star
25

fabric-network

Packet hooks for Fabric.
Java
7
star
26

discord-bot

Bot for the official Discord server
Java
7
star
27

fabric-docs-old

Code formatters, guidelines, and design documentation for Fabric.
JavaScript
7
star
28

kotlin-fabric-discord-bot

The discord bot previously used in the fabric discord server.
Kotlin
5
star
29

fabric-registry

Registry hooks for Fabric.
Java
5
star
30

outdated-fabric-mod-template

Template for Fabric mod workspaces
Java
5
star
31

fabric-commands

A module for fabric to allow custom commands
Java
5
star
32

class-tweaker

Java
5
star
33

fabric-installer-native-bootstrap

A native bootstrap for fabric-installer that utlises the JRE included with minecraft.
C++
5
star
34

name-proposal

Enigma Plugin and standalone CLI application used to automatically name obfuscated members based on data contained in a jar file.
Java
5
star
35

procyon

A fork of https://bitbucket.org/mstrobel/procyon/
Java
4
star
36

fabric-event-entity

Fabric player events module
Java
4
star
37

fabric-filament

A ingredient of yarn - A gradle plugin designed for minecraft mapping projects (such as yarn) to handle complex build logic. Requires Java 16
Java
4
star
38

fabric-loom-native-support

A small mod to improve support for architectures and libraries officially unsupported by Minecraft. Mainly targeting Apple Macs using arm processors.
Java
4
star
39

fabric-resources

Fabric module that adds mod resource packs
Java
3
star
40

fabric-loom-native

C++
3
star
41

fabric-action-scripts

A collection of custom scripts used by Fabric's Github action workflows
TypeScript
3
star
42

mercury-tiny-cli

CLI for the Mercury source code, operating on Tiny-mappings.
Java
3
star
43

fabric-loader-sat4j

sat4j, forked, trimmed and repackaged for Fabric Loader usage
Java
2
star
44

dev-launch-injector

Injects version dependent args and properties to avoid having to rewrite IDE run configs
Java
2
star
45

fabric-installer-native-lib

A native library used by fabric-installer
CMake
1
star