MonitoringMinecraft MonitoringMinecraft

Create: Recipe Hooks

Мод FabricForgeNeoForge

Create: Recipe Hooks — библиотека для Майнкрафт для модов и аддонов на основе Create с рецептами

41 скачивание 0 подписчиков
Оцените первым

Create Recipe Hooks

Create Recipe Hooks is a server-side library for Minecraft 1.20.1 (Forge and Fabric) that fires events whenever a Create machine finishes processing a recipe, and whenever a Create machine processes a world block: Drill mining, Harvester reaping, Saw felling trees. It provides a unified API so that integration mods - such as quest books, automation scripts, and analytics tools, can react to Create production without writing their own mixins.

What it does

The mod hooks into Create's machines at the bytecode level and fires three events:

  • recipeFinished - a Create machine completed a recipe (Basin, Fan, Press, Millstone, Crushing Wheels, Saw, Crafter, Deployer, Spout, Item Drain, Sand Paper, Sequenced Assembly, CEI Printer)
  • blockProcessed - a machine processed a world block: one event per block broken by a Mechanical Drill, per plant cut by a Mechanical Harvester, per lone block cut by a horizontal Mechanical Saw
  • treeCut - a Mechanical Saw felled a whole tree, with the exact log and leaf counts

Every event carries:

  • Source - which machine did the work
  • Player attribution - the UUID of the player who placed the machine (for Crushing Wheels: who threw the item, with a fallback to whoever placed the wheels for belt and hopper input). Persisted across server restarts and carried along inside moving contraptions
  • Recipe ID, item inputs and outputs, fluid outputs - for recipe events
  • Block id, block state, contraption flag, log count - for block events
  • Block position - where it happened in the world

Supported machines

Machine Source constant Event
Basin (Mixing / Compacting)BASINrecipeFinished
Crushing WheelsCRUSHING_WHEELrecipeFinished
Mechanical Saw (recipes)MECHANICAL_SAWrecipeFinished
Spout (recipe and bucket filling)SPOUT_FILLINGrecipeFinished
MillstoneMILLSTONErecipeFinished
Mechanical Press (belt and world)MECHANICAL_PRESSrecipeFinished
Mechanical CrafterMECHANICAL_CRAFTERrecipeFinished
DeployerDEPLOYER_BELTrecipeFinished
Encased Fan (belt and world)FAN_BLASTING / FAN_HAUNTING / FAN_SPLASHING / FAN_SMOKINGrecipeFinished
Item Drain (recipes, buckets, potions)ITEM_DRAIN_EMPTYINGrecipeFinished
Sand PaperSAND_PAPERrecipeFinished
Sequenced Assembly (final step)SEQUENCED_ASSEMBLYrecipeFinished
CEI Printer (optional, Forge only)CEI_PRINTERrecipeFinished
Mechanical Drill (stationary and contraption)MECHANICAL_DRILLblockProcessed
Mechanical Harvester (contraption)MECHANICAL_HARVESTERblockProcessed
Mechanical Saw, horizontal (stationary and contraption)MECHANICAL_SAWtreeCut / blockProcessed

KubeJS scripting, no addons needed

CRH registers its own KubeJS event group. The same scripts run unchanged on Forge and Fabric, with an optional source filter and built-in owner resolution:


CRHEvents.recipeFinished('MILLSTONE', event => {
    const player = event.getOwner();
    if (!player) return;
    player.server.runCommandSilent('give ' + player.name.string + ' minecraft:emerald 1');
});

CRHEvents.treeCut('MECHANICAL_SAW', event => {
    // event.getLogCount(), event.getBlockId(), event.getOwner()
});
  

Ready-to-use script examples (FTB Quests integration, output filtering, per-player counters, drill mining quests, log counting) are available in the README.

Why you might want this

If you are building a quest integration (FTB Quests etc.), you can trigger quest progress the moment a Create machine finishes, attributed to the right player - not just when items land in an inventory. Quests like "smelt 64 iron with a Fan", "mine 500 stone with a Drill" or "fell 50 trees with a Saw" become one short script each.

If you are writing analytics or logging tools for a server, you get a single reliable event stream for all Create production.

This mod does nothing visible on its own. It is a library - you will not see any in-game UI, items, or blocks. Install it when another mod or script requires it. It is server-side: clients without the mod can join a server that has it. For singleplayer, install it in your instance.

Requirements

  • Minecraft 1.20.1
  • Forge file: Forge 47 or newer, Create 6.0.8 or newer. Also runs on NeoForge 1.20.1, verified on clients and dedicated servers
  • Fabric file: Fabric Loader 0.15+, Fabric API, Create Fabric 6.0.8.1 or newer. Works on Quilt
  • KubeJS - optional, only for JS scripting (no EventJS or other addons required)
  • Create Enchantment Industry - optional soft dependency on Forge; CEI Printer events are only fired when CEI is installed

For developers

Register listeners during mod initialization, identical on both loaders:


CreateRecipeHooks.register(ctx -> {
    if (ctx.getSource() == RecipeSource.BASIN) {
        // ctx.getRecipeId(), ctx.getItemOutputs(), ctx.getBlockPos(), ...
    }
});

CreateRecipeHooks.registerBlockProcessed(ctx -> {
    // ctx.getBlockId(), ctx.isContraption(), ctx.getMetadata()
});

CreateRecipeHooks.registerTreeCut(ctx -> {
    // ctx.getLogCount(), ctx.getLeafCount()
});
  

On Forge the events are also posted on the event bus (CreateRecipeFinishedEvent, CreateBlockProcessedEvent, CreateTreeCutEvent); on Fabric they are standard callbacks (CreateRecipeFinishedCallback, CreateBlockProcessedCallback, CreateTreeCutCallback).

A debug mode is available for testing on Forge. Launch with the JVM argument -Dcrh.debug=true to write every recipe completion to logs/crh-events.log.

Full API documentation is available in the per-loader READMEs on the GitHub repository.

License

LGPL-3.0-or-later - free to use in public and private modpacks and as a dependency in other mods. Forks and derivative mods must remain open source under the same license with attribution.

Смотри также

Похожие подборки моды — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
1539 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
HyperGrief
0 онлайн
1.16.5 — 26.2 версия
Лучшая анархия на 2026 год
MigosMc
MigosMc Java + BE
2040 онлайн
1.8 — 26.2 версия
🌿 MigosMc.net | Гриферский сервер с войс-чатом | Награды за онлайн ⭐ ВЫЖИВАНИЕ⭐ ОДИНБЛОК⭐ МИНИ-ИГРЫ
AxisMine - ВаниллаPlus
45 онлайн
1.21.4 — 26.1.2 версия
Ванильный мир с сотнями уникальных механик и справедливой игрой! /free, pat-pat, emotecraft, Voice.
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.16.5. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат