Cardinal Components API

Description

Cardinal Components API is a Quilt and Fabric library that allows Minecraft mods to attach custom data to game objects in the form of components. Its goals are to offer an accessible API that is just as fast as direct mixins attachments, as well as to promote interoperability between mods using it.

For a short description and associated examples, see the repository’s README.

Wiki structure

Setup

This section contains instructions for getting Cardinal Components API running in your instance, either as a developer or as a user.

Basics

This section contains explanations and examples for the library’s basic concepts.

Advanced

This section contains documentation for advanced features, which may not be needed by most mods.

Modules

This section regroups detailed information on each module. Note that more information is available for API classes in the form of Javadoc.

Generic Modules

These modules are not specific to a type of provider, and contain interfaces and helpers that can be used with any other module.

Base (core module)

The core of Cardinal Components, required by every other module to function. It needs to be added to any development environment that makes use of the library.

module ref: cardinal-components-base

Utilities

A collection of utilities for interacting with components as well as making your own component providers.

module ref: cardinal-components-util

Provider Modules

Those modules hook into existing Minecraft classes so that you can use them as component providers. They also contain some helpers for common use cases with those specific providers.

Entities

Allows attaching components to any Entity, with filtering based on entity class and helpers for player data.

module ref: cardinal-components-entity

Items

Allows attaching components to any ItemStack, with filtering based on the Item.

module ref: cardinal-components-item

Worlds

Allows attaching components to both server and client Worlds.

module ref: cardinal-components-world

Saves (levels)

Allows attaching components to WorldProperties, effectively used for global data storage.

module ref: cardinal-components-level

Scoreboard and teams

Allows attaching components to Scoreboards and Teams. Can be used for global data storage.

module ref: cardinal-components-scoreboard

Chunks

Allows attaching components to Chunks.

module ref: cardinal-components-chunk

Blocks

Provides helpers and interfaces for attaching components to custom blocks and block entities.

module ref: cardinal-components-block