Shared backpack detection
Other mods can call one API to check if an ItemStack should count as a backpack.
Backpack Gear is a small shared dependency for modders. It gives other Fabric mods one common way to mark items as backpacks, detect them in code, and prepare them for a dedicated backpack slot.
Use this mod when your own mod has backpack items and you want them to be recognized by a shared backpack system instead of every mod inventing a separate slot rule.
Other mods can call one API to check if an ItemStack should count as a backpack.
Register with Java code for full control, or use the item tag when data-driven setup is enough.
The dependency creates the base for a backpack equipment slot while keeping armor slots free for armor.
Add Backpack Gear as a dependency, then declare it in your mod metadata. If the jar is only local, use the file dependency until you publish it to a Maven repository.
Use this when Backpack Gear jar is beside your mod project.
dependencies {
modImplementation files("../backpack-gear-26.2/build/libs/backpack_gear-1.0.0-fabric-26.2.jar")
}
This makes Minecraft load Backpack Gear before your mod.
{
"depends": {
"fabricloader": ">=0.19.3",
"minecraft": "~26.2",
"fabric-api": "*",
"backpack_gear": ">=1.0.0"
}
}
Best option when your mod already registers items in Java. Call the API during your mod initializer after your backpack item exists.
import net.arthurorsi.backpackgear.api.BackpackGearApi;
import net.fabricmc.api.ModInitializer;
public final class YourMod implements ModInitializer {
@Override
public void onInitialize() {
BackpackGearApi.registerBackpackItem(MyModItems.MY_BACKPACK);
}
}
if (BackpackGearApi.isBackpack(stack)) {
// Your item is registered as a backpack.
}
Best option when you want a simple data-driven integration. Put your backpack item id in the Backpack Gear tag.
src/main/resources/data/backpack_gear/tags/item/backpacks.json
{
"replace": false,
"values": [
"your_mod:your_backpack"
]
}
Backpack Gear is built as a shared base dependency. Keep your own backpack storage, screen, tooltip, and recipes inside your mod, then use Backpack Gear to make the item recognizable as backpack gear.
Backpack item registration, item tag support, and common backpack detection.
Inventory rows, screen layout, item model, textures, recipes, and storage logic.
Depend on Backpack Gear, register each backpack item, then check isBackpack where your equip logic needs it.