Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/VazkiiMods/Quark/llms.txt

Use this file to discover all available pages before exploring further.

Quark exposes a stable public Java API at org.violetmoon.quark.api.* that lets your mod integrate with Quark features — inventory sorting, piston callbacks, magnet behavior, Matrix Enchanting, the Trowel, the Usage Ticker, and more — without requiring Quark to be installed. This page explains how to declare the dependency and points you to each area of the API.

Adding Quark as a Soft Dependency

Declare Quark as an optional dependency in your neoforge.mods.toml. Using mandatory = false means your mod loads even when Quark is absent; you are responsible for guarding any Quark calls with a runtime presence check.
neoforge.mods.toml
[[dependencies.yourmod]]
    modId        = "quark"
    type         = "optional"
    mandatory    = false
    versionRange = "[4.0,)"
    ordering     = "NONE"
    side         = "BOTH"
Replace yourmod with your own mod ID.

Runtime Presence Check

Because Quark is optional, wrap any direct Quark logic in a mod-presence check to avoid ClassNotFoundException on servers or clients without Quark:
import net.neoforged.fml.ModList;

if (ModList.get().isLoaded("quark")) {
    // safe to call Quark API here
}
For heavier integration, keep all Quark-specific code in a separate class and load it lazily or via a service-provider pattern, to prevent class-loading errors.

Importing the API Package

All public types live in org.violetmoon.quark.api and its event sub-package:
import org.violetmoon.quark.api.*;
import org.violetmoon.quark.api.event.*;
The Quark team recommends bundling the API classes with your mod rather than assuming Quark is present. When you copy the sources, include package-info.java from the API package. The canonical source is src/main/java/org/violetmoon/quark/api/ on GitHub.

What the API Provides

API Interfaces

Implement on your Block, Item, Entity, Screen, or BlockEntity to hook into Quark features like sorting, magnet behavior, enchanting, and more.

Events

NeoForge bus events fired by Quark — module lifecycle, simple harvest, usage ticker, and tool class gathering.

Capabilities

NeoForge ItemCapability constants for providing custom sorting logic from your Item implementations.

Tags

Data-driven item and block tags consumed by Quark features that you can populate from your mod’s data pack.

Source Location

The entire public API lives in a single package in the Quark repository:
src/main/java/org/violetmoon/quark/api/
Browse it on GitHub: VazkiiMods/Quark — api/

Build docs developers (and LLMs) love