Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Recipe Book Access API

Recipe Book Access API

An effortless Fabric API, enabling recipe-book crafting from customizable external inventories.

1,186
3
Game Mechanics
Library
Storage

Compatibility

Minecraft: Java Edition

1.21.x
1.20.1

Platforms

Fabric

Supported environments

Client and server

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source

Creators

Jomlom
Jomlom Member

Details

Licensed MIT
Published last month
Updated 3 weeks ago
DescriptionChangelogVersions

Recipe Book Access Banner

Recipe Book Access is a simple Fabric API designed to intuitively add support for external inventory access in any crafting screen.
It redirects the recipe book functionality to check and fill from a customisable list of inventories, instead of just the player's.

What does this mean?

See for yourself! Recipe Book Access Demonstration
This is an EXAMPLE of a modded crafting table uses a custom list of inventories via this API, in this specific case it uses all inventories from nearby chests.

This mod alone will not achieve what is shown above - If you are looking for a mod that implements this for the crafting table, you probably want the Nearby Crafting mod.

Quickstart Guide

For a more detailed how-to-use guide, including how to setup this API in your project's environment, please see the readme on Github for this project here.

This API provides a simple interface called RecipeBookInventoryProvider, located in com.jomlom.recipebookaccess.api.

This interface must be implemented to your screen handler class, only one method needs overriding (getInventoriesForAutofill()) for the API's full functionality.

You must implement this method to return a list of inventories which you want the recipe book to access and craft from, this won't include the player's inventory by default.

Code Example:

import com.jomlom.recipebookaccess.api.RecipeBookInventoryProvider

public class YourCraftingScreenHandler extends AbstractRecipeScreenHandler implements RecipeBookInventoryProvider {
    // your existing code...

    @Override
    public List<Inventory> getInventoriesForAutofill() {
        return yourInventoriesList;
    }
}

Assumptions made by this API:

  • Your screen handler class extends 'AbstractRecipeScreenHandler', or any of its subclasses
  • Your corresponding screen extends 'RecipeBookScreen', in order to utilize the minecraft recipe book

(I have not tested outside these assumptions)

FAQs

  • Q: I think I found an issue...
    A: Feel free to create an issue on Github or reach out directly on discord @joonty

  • Q: Will you release support for x ?
    A: I plan to release support for older versions soon, I don't currently plan to release support outside of Fabric. If you would like to make a verion for another loader (Forge, NeoForge, etc) feel free to reach out on discord! @joonty

  • Q: Does my getInventoriesForAutofill() implementation need to work from the client?
    A: Nope! getInventoriesForAutofill() is only used from the server side screen handler, and the API will keep the client up to date on the results for you automatically!

Modrinth is open source.

main@4b75cb8

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.