Custom CraftingModule - gisellevonbingen-Minecraft/MineColonies_Tweaks GitHub Wiki

Summary

Custom CraftingModule can be declare at common config. This will add 'Crafting Recipes' tab on building.

Can add recipes using MineColonies's Custom Recipe system. Also this module can't teach recipes. Only supports Custom Recipes.

Important

Need build a new building for added Custom CraftingModule will operate.

Specification

Can declare multiple Custom CraftingModule . Just add elements at Config.

Need RESTART client/server instance when config changed. Also should client/server must have same data.

minecolonies_tweaks-common.toml

[buildings]
	customCraftingModules= [
		"{\"name\": \"YOUR_MODULE_NAME_1\", \"buildingId\": \"BUILDING_ID_1\", \"jobId\": \"JOB_ID_1\"}",
		"{\"name\": \"YOUR_MODULE_NAME_1\", \"buildingId\": \"BUILDING_ID_1\", \"jobId\": \"JOB_ID_2\", \"forceVisible\": true}",
	]

Element Specification

No. Key Skippable Desc.
1 name X should be consist of only lowercase alphabet and number and . ([a-z0-9])
2 buildingId X building id what add this module.the id where delcared at code on MineColonies and Addon.MineColonies Codecan skip 'minecolonies:'.
3 JobId X job id what handle this module.the id where delcared at code on MineColonies and Addon.MineColonies Codecan skip 'minecolonies:'.
4 forceVisible O if true, show module tab if recipes are empty.if skipped, will be false.

Assets

Add modules are need module icon file and translation.

Icon file is must placed at 'assets/minecolonies/textures/gui/modules/YOUR_MODULE_NAME.png' in resource pack.

Translation path is 'com.minecolonies.coremod.gui.workerhuts.recipe.YOUR_MODULE_NAME'.

Custom Recipe Key

If you add custom recipe to this module, add 'crafter' key on custom recipe json The value like 'MODULE_JOB_ID' + '_' + 'MODULE_NAME'.

e.g.) if job id is 'farmer' and module name is 'test', then 'crafter' should have value is 'farmer_test'.

Example

Config file

minecolonies_tweaks-common.toml

[buildings]
	customCraftingModules = ["{\"name\": \"test\", \"buildingId\": \"farmer\", \"jobId\": \"farmer\", \"forceVisible\": false}"]

Above is meaning this.

{
   "name":"test",
   "buildingId":"farmer",
   "jobId":"farmer",
   "forceVisible":false
}

Custom recipe file

data/datapack_name/crafterrecipes/biofuel.json

{
   "type":"recipe",
   "additional-output":[],
   "crafter":"farmer_test",
   "inputs":[
      { "item":"minecraft:wheat" }
   ],
   "intermediate":"minecraft:air",
   "min-building-level":1,
   "result":"mekanism:bio_fuel",
   "count":5
}

Assets

Resource pack file for test. test.zip

Ingame result

image