Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Chain-Crafting
### Chain-Crafting
Chain Crafting is a custom crafting engine made for Minecraft Bedrock. It works by chaining the ```minecraft:interact``` component with events and component groups. Since this is a task you don't want to do by hand, I made this generator to do the work.
You can get the items you put into the "crafting table" back at any point in time by sneaking & interacting with the entity. That's one of the very special features of the Chain Crafting system: It saves the current input!

### Usage
Visit https://solveddev.github.io/Chain-Crafting or download this repository and open the index.html file in the browser of your choice. Write a JSON file to describe the recipes you want to add with the following syntax:
Write a JSON file to describe the recipes you want to add with the following syntax:
```javascript
{
"entity": "minecraft:shulker",
"entity": "av:act",
"recipes": [
{
"ingredients": [
Expand All @@ -26,16 +26,18 @@ Visit https://solveddev.github.io/Chain-Crafting or download this repository and
]
}
```
After a short amount of time, the page downloads the result of the generator as a .zip file. This archive contains a "loot_tables" & "entities" folder. In order to add the system to your behavior pack, drag the chain_crafting.zip file into your BP and unpackage it there. If you did it the right way, you should not see a "chain_crafting" folder in your BP.
You also have an example of multiple crafting recipes in one file in the main folder. Open https://drav0011.github.io/ChainCrafting-AdvancedCraftingTable/, then click on "import JSON file" and upload your already written JSON file.
After a short amount of time, the page downloads the result of the generator as a "cc+act_bp.mcpack" file, open it, and once loaded open download the "cc+act_rp.mcpack" file and open it too.
Now just create a world, add the behaviour pack and the resource pack to it, enable experimental gameplay, and have fun :D

If you do, move the "entities" & "loot_tables" folder into the BP root folder and remove the now empty "chain_crafting" folder
For now is only possible to summon the ACT in creative, so for it to not be destroyed by accident the entity is not punchable. To remove it, stand next to it and enter the following minecraft command "/kill @e[type=!player,c=1]


### Other Examples
You can also add multiple ingredients. In this case, you start by interacting with the first item defined, then you need to interact with the second one, etc.
```javascript
{
"entity": "minecraft:shulker",
"entity": "av:act",
"recipes": [
{
"ingredients": [
Expand Down Expand Up @@ -67,7 +69,7 @@ You can also add multiple ingredients. In this case, you start by interacting wi
Chain Crafting also supports multiple results:
```javascript
{
"entity": "minecraft:shulker",
"entity": "av:act",
"recipes": [
{
"ingredients": [
Expand Down Expand Up @@ -103,4 +105,9 @@ Chain Crafting also supports multiple results:
}
]
}
```
```

### Credits

The original creator of the Chain Crafting (CC) system used in this generator is solvedDev (https://twitter.com/solvedDev), the creator of the Advanced Crafting Table (ACT), and modifier of the CC system is DrAv0011 (https://twitter.com/DrAv0011)(https://www.youtube.com/channel/UCFUG8RhqH6y1wfcVpLR7fFg).
The texture of the ACT is from the old Minecraft Java mod RedPower2.
2 changes: 1 addition & 1 deletion chain_crafting.json → cc+act_example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"entity": "minecraft:sheep",
"entity": "av:act",
"never_despawn": true,
"recipes": [
{
Expand Down
Binary file added cc+act_rp.mcpack
Binary file not shown.
Binary file modified imgs/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chain Crafting</title>
<title>Chain Crafting + Advanced Crafting Table</title>
<link rel="stylesheet" href="styles/main.css">
<link rel="shortcut icon" type="image/x-icon" href="imgs/icon.png">
</head>
<body>
<h1>Chain Crafting</h1>
<h1>Chain Crafting + Advanced Crafting Table (Original CC creator solvedDev, ACT creator+ modifier DrAv0011)</h1>
<label for="import">import JSON file</label>
<input type="file" name="import" id="import">

Expand Down
54 changes: 46 additions & 8 deletions scripts/main.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
var entity = {
"format_version": "1.8.0",
"minecraft:entity": {
"format_version": "1.4.0",
"description": {
"identifier": "",
"is_spawnable": true,
"is_summonable": true,
"is_experimental": true
},
"components": {
"minecraft:identifier": {
"id": ""
"minecraft:health": {
"value": 2,
"max": 2
},
"minecraft:damage_sensor": {
"cause": "any",
"deals_damage": false
},
"minecraft:knockback_resistance": {
"value": 100,
"max": 100
},
"minecraft:push_through": {
"value": 1
},
"minecraft:loot": {
"table": "loot_tables/act.json"
},
"minecraft:physics": {}
},
"component_groups": {
Expand All @@ -18,7 +35,8 @@ var entity = {
"add_effects": [
{
"effect": "strength",
"duration": 9999
"duration": 9999,
"visible": false
}
],
"remove_effects": [ "haste", "jump_boost" ]
Expand All @@ -37,6 +55,23 @@ var entity = {
}
}
};
var manifest = {
"format_version": 1,
"header": {
"description": "BP(Chain Crafting by solvedDev + Advanced Crafting Table by DrAv0011)",
"name": "BP(Chain Crafting + Advanced Crafting Table)",
"uuid": "ab7eaccb-53ec-4417-a417-7b11aba7566b",
"version": [1, 0, 0]
},
"modules": [
{
"description": "BP(Chain Crafting by solvedDev + Advanced Crafting Table by DrAv0011)",
"type": "data",
"uuid": "bbb90cbb-0c26-4731-9de7-93655b5720fb",
"version": [1, 0, 0]
}
]
}
var c_names = [];
var loot = { normal: {}, results: {} };
class Interaction {
Expand Down Expand Up @@ -89,7 +124,7 @@ function loadFile(pFile) {
}

function parseCrafting(pC) {
entity["minecraft:entity"]["components"]["minecraft:identifier"]["id"] = pC["entity"];
entity["minecraft:entity"]["description"]["identifier"] = pC["entity"];
let recipes = pC["recipes"];

for(let i = 0; i < recipes.length; i++) {
Expand All @@ -106,7 +141,8 @@ function parseCrafting(pC) {
for(let key in loot.normal) {
addToZip("loot_tables/chain_crafting/destruct/"+ key + ".json", JSON.stringify(loot.normal[key], undefined, "\t"));
}
downloadZip("chain_crafting.zip");
addToZip("manifest" + ".json", JSON.stringify(manifest, undefined, "\t"));
downloadZip("cc+act_bp.mcpack");
location.reload();
}

Expand Down Expand Up @@ -161,7 +197,8 @@ function generateState(pS, pArr, pEnd, pFirst, pLast, pResults) {
add_effects: [
{
effect: "haste",
duration: 9999
duration: 9999,
visible: false
}
],
remove_effects: [ "strength" ]
Expand All @@ -174,7 +211,8 @@ function generateState(pS, pArr, pEnd, pFirst, pLast, pResults) {
add_effects: [
{
effect: "jump_boost",
duration: 9999
duration: 9999,
visible: false
}
],
remove_effects: [ "strength", "haste" ]
Expand Down