COWMODSКаталог модов

custom-crafter-api

An advanced PaperMC crafting engine for building complex recipes with NBT-supported custom items.

Автор: Sakaki-Aruka1,3 тыс.2обновлён 2 авг. 2026 г.
Механики игрыБиблиотекиУтилиты

Описание

custom crafter

custom crafter is a custom recipe plugin for PaperMC servers, and also a library (API) for defining custom recipes from your own plugin.

Define custom recipes freely from your plugin and introduce new elements into the game.

Japanese README (日本語ドキュメント)


Features

  • Custom recipes for vanilla items — add new recipes for existing Minecraft items.
  • Custom item support — use items created by your plugin as results or materials.
  • Material management commands — for server administrators managing recipe materials.
  • Automatic integration — registered recipes appear in players' crafting environment without extra setup.
  • Vanilla crafting continues to work unmodified.

Demo

Crafting demo video
  1. Place base blocks (GOLD_BLOCK).
  2. Craft infinityIronBlockCore (recipe definition).
  3. Compress an iron block into infinityIronBlock (recipe definition).
  4. Repeat with the same recipe.
  5. Repeat again.
  6. Extract the infinity iron block with infinityIronBlockExtract (recipe definition).

Clone the repository and run the following command to build a demo plugin containing the recipes shown above, along with several others:

mvn -pl demo package

The resulting jar, ready to be placed in a server's plugins directory, is written to demo/target.


Supported Environments

Custom_Crafter VersionPaper Version
5.4.0 (latest)1.21.4 ~ 1.21.11, 26.1.x
5.0.13 ~ 5.0.21, 5.1.0 ~ 5.3.01.21.4 ~ 1.21.11, 26.1.x
5.0.0 ~ 5.0.111.21.3
4.3 (legacy)1.21.3
4.2 (legacy)1.20.1 ~ 1.20.4

The minimum supported Paper version rarely changes between releases, so using the latest release is recommended.

Note: custom crafter does not run on Spigot/Bukkit. Use PaperMC or a Paper fork.


Using the API

Since version 5.0.0, custom crafter also works as an API for defining and registering custom recipes from your own plugin.

Documentation

To build the documentation locally:

mvn -pl api dokka:dokka      # KDoc
mvn -pl api dokka:javadoc    # Javadoc

Dependency

Plugins depending on CustomCrafterAPI must list Custom_Crafter under depend in plugin.yml:

depend:
  - "Custom_Crafter"

Latest version: 5.4.0 (Maven Central)

The CustomCrafter plugin is assumed to be present at runtime, so set its dependency scope to compile-time only — the same applies to the Kotlin stdlib if your plugin is written in Kotlin.

Compile-time-only scope name by build tool:

  • Maven: provided
  • Gradle: compileOnly
Maven
<!-- CustomCrafterAPI -->
<dependency>
    <groupId>io.github.sakaki-aruka</groupId>
    <artifactId>custom-crafter-api</artifactId>
    <version>5.4.0</version>
    <scope>provided</scope>
</dependency>

<!-- kotlin-stdlib -->
<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib</artifactId>
    <version>2.3.0</version>
    <scope>provided</scope>
</dependency>
Gradle (Groovy)
dependencies {
    compileOnly 'io.github.sakaki-aruka:custom-crafter-api:5.4.0'
    compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:2.3.0' // if using Kotlin
}
Gradle (Kotlin DSL)
dependencies {
    compileOnly("io.github.sakaki-aruka:custom-crafter-api:5.4.0")
    compileOnly("org.jetbrains.kotlin:kotlin-stdlib:2.3.0") // if using Kotlin
}

Server Installation

custom crafter is written in Kotlin.

  1. Download the plugin jar and place the downloaded files in your plugins directory.
  2. Start or reload the server.
  3. Place base blocks in a 3x3 area directly beneath a standard workbench — a standard workbench alone does not enable custom recipes. The default base block is GOLD_BLOCK.

Code Samples

Compatibility check

Checks whether the CustomCrafterAPI version your plugin depends on is compatible with the version running on the server:

class YourPlugin : JavaPlugin() {
    val dependVersion = Triple(5, 3, 0)

    @Override
    fun onEnable() {
        if (CustomCrafterAPI.MAJOR_VERSION == dependVersion.first
            && CustomCrafterAPI.MINOR_VERSION >= dependVersion.second) {
            return
        }
        Bukkit.pluginManager.disablePlugin(this)
    }
}

Defining a recipe

A custom recipe consists of three parts:

  1. Material (CMatter) — the input requirements for crafting.
  2. Result (ResultSupplier) — what a successful craft produces.
  3. Recipe (CRecipe) — combines materials, results, and shape (shaped/shapeless) for registration.

1. Materials (CMatter)

CMatter defines which item, how many, and where it must be placed. Use CMatterImpl or your own implementation of CMatter.

Accept 1 stone or 1 cobblestone:

val matter: CMatter = CMatterImpl(
    name = "test-matter",
    candidate = setOf(Material.STONE, Material.COBBLESTONE),
    amount = 1,
    anyAmount = false, // true: allow the amount to be satisfied across a stack
    predicates = null  // additional NBT or other conditions
)

For a simple set of candidate materials, of is shorter:

val matter: CMatter = CMatterImpl.of(Material.STONE, Material.COBBLESTONE)

2. Results (ResultSupplier)

A ResultSupplier receives the crafting context (Config) and returns the output items. Command execution can be used instead where no item result is needed.

val supplier = ResultSupplier { config ->
    // 'config' holds crafting context: player, workbench, etc.
    emptyList<ItemStack>()
}

Helper methods cover common cases:

// Always returns 1 stone
val supplier = ResultSupplier.single(ItemStack.of(Material.STONE))

// Scales output with the number of items crafted in one action (e.g. shift-click)
val supplier2 = ResultSupplier.timesSingle(ItemStack.of(Material.STONE))

3. Recipe (CRecipe)

CRecipeImpl combines materials and results into a registrable recipe.

val recipe: CRecipe = CRecipeImpl(
    name = "test-recipe",
    items = mapOf(CoordinateComponent(0, 0) to matter),
    containers = null, // additional conditions, e.g. permissions
    results = setOf(ResultSupplier.timesSingle(Material.STONE)),
    type = CRecipe.Type.NORMAL
)
  • items: maps grid coordinates (CoordinateComponent(x, y)) to the required CMatter.
  • type: CRecipe.Type.NORMAL is a shaped recipe, where coordinates matter; CRecipe.Type.AMORPHOUS is shapeless, where coordinate values are arbitrary.

License

MIT License

Copyright (c) 2023 - 2026 Sakaki-Aruka

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Галерея

Potatos placed on the crafting slots

Последние версии

Все версии →
release

custom-crafter-api 5.4.0

5.4.0
2 авг. 2026 г.86Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
## ⚠️ Breaking Changes * `CMatter.isValidMatter()`, `CRecipe.isValidRecipe()`, `CraftUIDesigner.Baked.isValid()`, and `AllCandidateUIDesigner.Baked.isValid()` no longer return `Result<Unit>`; they now throw `IllegalStateException` directly on failure and return nothing on success. * `CMatter.firstFailedPredicate()` and `CRecipe.firstFailedRecipePredicate()` now return `kotlin.Pair<Int, CMatterPredicate>` / `kotlin.Pair<Int, CRecipePredicate>` instead of `IndexedValue`. * `AllCandidateUIDesigner.Baked.ungeneratedIconPlaceholderItem` changed from the Kotlin function type `(CRecipe) -> ItemStack` to `java.util.function.Function<CRecipe, ItemStack>`. * `Explainer`'s constructor parameter order changed from `(name, verbosity)` to `(verbosity, name)`, since controlling the log level without naming the instance is the more common use case. ## ✨ New Features and Enhancements * **[Enhancement]** Improved Java interoperability across the public API by replacing Kotlin-only return types (`Result`, `IndexedValue`) and lambda parameter types with plain exceptions and `java.util.function.Function`.
release

custom-crafter-api 5.3.0

5.3.0
26 июл. 2026 г.31Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
## ⚠️ Breaking Changes * **[Dependency Removal]** Removed the **Choco-solver** dependency; shapeless matching now uses an in-house max-flow solver, so the `org.chocosolver` shaded relocation is gone. * `CMatter.predicates` changed from `Collection<CMatterPredicate>?` to `List<CMatterPredicate>?`, making predicate order significant. * `CMatterImpl.defaultMatterPredicates()` now returns `List<CMatterPredicate>` instead of `Set<CMatterPredicate>`. * `CMatterPredicate.Context` and `CRecipePredicate.Context` gained a trailing `explainer` parameter; Kotlin source compatibility is preserved, but binary compatibility is not. ## ✨ New Features and Enhancements * **[New Feature]** Added `Explainer`: an opt-in, thread-safe diagnostic recorder that reports why each recipe did or did not match during a search. * **[New Feature]** Added `MatchGroup` and `CRecipe.matchGroups()`, generalising shapeless matching from "every slot is mandatory" into a min/max bounded assignment. * **[New Feature]** Added `ShapelessGroupRecipe`: the shapeless counterpart of `GroupRecipe`, needing no `Material.AIR` placeholder to express an optional slot. * **[New Feature]** Added the `CMatterPredicates` and `CRecipePredicates` utility objects, providing the `and`, `or`, `allOf`, and `nOf` combinators. * **[New Feature]** Added `named()` and a `name()` default method on both predicate interfaces, so a predicate is reported by name instead of by index (combinators compose names automatically). * **[Enhancement]** `CMatterPredicate.Context` and `CRecipePredicate.Context` now expose an `explainer` field, letting a predicate record why it rejected an input. * **[Enhancement]** Added `CMatter.firstFailedPredicate()` and `CRecipe.firstFailedRecipePredicate()`, returning the first rejecting predicate instead of only whether one rejected. * **[Enhancement]** `Search.search`, `Search.asyncSearch`, `PartialSearch.asyncPartialSearch`, and `VanillaSearch.search` now accept an optional `explainer`. * **[Documentation]** Added the "Advanced Debugging for Recipe Search" page (EN / JA) and documented the `Predicates` utilities and predicate naming on the `CRecipePredicate` page.
release

custom-crafter-api 5.2.1

5.2.1
9 июн. 2026 г.77Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
# 5.2.1 ## ✨ New Features and Enhancements * **[Enhancement]** Added Javadoc so that Java users can browse API details in a familiar documentation format. * **[Enhancement]** Several functions can now be called from Java in a more intuitive way.
release

custom-crafter-api 5.2.0

5.2.0
7 июн. 2026 г.23Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
# 5.2.0 ## ⚠️ Breaking Changes * The method for resetting `CustomCrafterAPI` properties to their default values has changed. * `hasFullCompatibility()` has been deprecated. Use `MAJOR_VERSION`, `MINOR_VERSION`, `PATCH_VERSION`, and `VERSION_TYPE` instead. * Several utility functions have been made private or relocated. * Passing a plugin instance when registering recipes is now recommended. * Several events are now non-cancellable. ## ✨ New Features and Enhancements * **[New Feature]** Added `AllCandidateUIDesigner`: the AllCandidateUI appearance can now be customized. * **[New Feature]** Added `NameStrictLevel`: recipe registration can now be restricted to prevent duplicate names. * **[Enhancement]** Version information is now more accessible via `MAJOR_VERSION`, `MINOR_VERSION`, `PATCH_VERSION`, and `VERSION_TYPE`. * **[Enhancement]** Recipe registration and deregistration APIs have been improved; recipes can now be filtered by registering plugin. * **[Enhancement]** Added default implementations to `CraftUIDesigner`, reducing boilerplate for partial customization.
release

custom-crafter-api 5.1.0

5.1.0
1 мая 2026 г.62Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
# 5.1.0 The minimum compatible version requirement rarely changes between updates. Using the latest release is recommended. ## ⚠️ Breaking Changes * **[Package Rename]** Several packages have been significantly renamed and reorganized. Projects that reference specific package paths will require import updates. ## ✨ New Features and Enhancements * **[New Feature]** Added `AdjacentRecipe`: a recipe that requires input items to be placed adjacent to one another — a weakly shape-constrained recipe type. * **[Enhancement]** Simplified constructors for several classes to reduce boilerplate in common use cases. ## 🛠 Fix * Fixed an issue where item replacement after a craft did not work correctly when a customized crafting UI layout was applied. * Fixed a critical bug in shapeless recipe matching where a recipe slot with no valid candidates was silently skipped instead of causing the match to fail. This allowed invalid ingredient combinations to incorrectly succeed and prevented some inputs from being consumed.
release

custom-crafter-api 5.0.21

5.0.21
26 апр. 2026 г.21Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
## ✨ New Features and Enhancements * **[New Feature]** Added `ReplaceableResultSupplier` interface: writes items back into crafting UI slots after a craft, enabling ingredient transformation (e.g. returning a modified tool) and byproduct placement patterns. * **[New Feature]** Added `ResultSupplier.Context.CallMode` enum (`CRAFT` / `ICON`): allows `supply()` implementations to distinguish a real craft from an icon-generation call (e.g. in the AllCandidateUI display), replacing the old `isMultipleDisplayCall` field. * **[New Feature]** Added `CraftInputInterruptEvent`: fired when a player interacts with input slots or closes the CraftUI while a craft process is in progress. * **[New Feature]** Added `PreventDoubleCraftEvent`: fired when a player attempts to start a new craft while one is already running. * **[Enhancement]** Added `PartialSearch` API: asynchronous partial recipe match search for crafting hints and autocomplete suggestions. Supports both shaped and shapeless recipes. * **[New Feature]** Added `CVanillaRecipe.fromTransmute()`: converts a vanilla `TransmuteRecipe` into a `CVanillaRecipe`, enabling transmute recipes to be used with `PartialSearch` and other CustomCrafter features. Each ingredient's `RecipeChoice` is converted to a `CMatterPredicate` via `RecipeChoice.test()`, so NBT and exact-item constraints are preserved. ## 🛠 Fix * Fixed a race condition in `ONLY_FIRST` search mode that could return an empty result even when a matching recipe existed. * Fixed `isAsync()` returning an inverted value in `CMatterPredicate.Context` and `CRecipePredicate.Context`. * `CompletableFuture` tasks now consistently run on virtual threads.
release

custom-crafter-api 5.0.20-p1

5.0.20-p1
16 апр. 2026 г.25Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2folia, paper, purpur
Скачать
Что нового
# 🛠 Fix - UI processing order
release

custom-crafter-api 5.0.20

5.0.20
26 мар. 2026 г.41Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11folia, paper, purpur
Скачать
Что нового
## ✨ New Features and Enhancements * **[Enhancement]** Async interruption support * **[Enhancement]** Faster rendering in AllCandidateUI * **[Enhancement]** Folia support
release

custom-crafter-api 5.0.19

5.0.19
9 февр. 2026 г.598Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11paper, purpur
Скачать
Что нового
# 5.0.19 ## ✨ New Features and Enhancements * **[Enhancement]** Search speed for shapeless recipes is now faster. ## 🛠 Fix * Event internal fix
release

custom-crafter-api 5.0.18

5.0.18
16 янв. 2026 г.92Minecraft: 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11paper, purpur
Скачать
Что нового
# 5.0.18 ## ✨ New Features and Enhancements * **[Enhancement]** MCKotlin-Paper is no longer required to run CustomCrafterAPI.