How to use CNC [CNC] NBT Synthetic Chan

This tutorial is set by the author to use the CC By-NC-SA protocol.

(CNC1.3.6 and before, there are some small errors in the example function in the data packet, repair in CNC1.3.X Fix1, please pay attention)

Orderly synthesis

This is an orderly synthetic example function:

 Execute if block ~ ~ ~ minecraft: Barrel {items: [{slot: 20b, id: minecraft: stick ", tag: {cnc_example: 0b}}, {s LOT: 11B, ID: "Minecraft: Stick"}, {slot: 1b, id: "Minecraft: Iron_ingot"}, {slot: 2b, id: "minecraft: Iron_ingot"}, {slot: 10B, id: "minecraft: IRON_INGOT "}]} If entity @s [scores = {cnc_table_count = 5}] Run item replace block ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ : 1b} 

It indicates that the items are placed in the synthetic area as follows:

Iron ingot iron ingot iron stick wood stick

Wood stick*

*Wooden stick with {cnc_example: 0b} label

At the same time, the output bar is an iron ax with {cnc_example: 1b} tag.

Operation precautions:

1. Under the if block field, fill in the items placed in the synthetic area in Barrel's NBT, and each object is an item under the Item list.其中需写明物品id、NBT标签(即tag,如有)和槽位(即Slot。合成区槽位:由上到下,由左到右依次为:1b,2b,3b;10b,11b,12B; 19B, 20B, 21B)

2. CNC_TABLE_COUNT scoreboards in the iF Entity field fill in the items that are filled in the synthetic area.

3. Fill in the output item data under the Item Replace field, which is the same as the format of the GIVE command;

4. But you need to add {output: 1b} tags under the output item, otherwise you cannot work normally.

5. If your formula supports translation or mirror synthesis, you need to write the formula after translation or mirroring according to the new slot position, that is, the possible situation is needed.

Disorderly synthesis

No disorderly synthesis of no repeated items

The disorderly synthesis synthesis is the same as orderly synthesis. The only difference is that you do not write the slot tag when filling in the items of the synthetic area;

Therefore, orderly synthesis and disorderly synthesis can be mixed. You can specify that some items are arranged as specified, and another part of items are arranged at will.

The following is the complete example of the Eye of the Morality:

 Execute if block ~ ~ ~ minecraft: Barrel {items: [{id: "minecraft: blaze_powder"}, {id: "minecraft: ender_pearl"}]}}} if entity @s [scores = {cnc_table_count = 2}] Run Item Replace Block ~ ~ ~ ~ container.16 with Ender_eye 

There are disorderly synthesis of repeated items

Because filling in multiple same objects in the IF will not allow data packets to detect multiple items. As long as there is such an item, it will pass this condition. Therefore, for disorderly synthetic formulas with repeated itemsdetermination.Add the following commands before the main command:

 Execute Store Result score @s CNC_SLOUT if data block ~ ~ ~ ~ items [{id: "mineCraft: Paper"}] 

The scoring board CNC_SLOUT is the scoring board for preset disorderly synthetic judgment. You can replace it with your own, as long as it is consistent, it does not matter.

In the main function below, the CNC_SLOUT scoring board is added to the condition after the iF Entity field. The number of scores is the number of items:

 Execute if block ~ ~ ~ minecraft: Barrel {items: [{id: "minecraft: pain"}, {id: "minecraft: leather"}]} if entity @s [[scores = {cnc_table_count = 4, cnc_slout = 3}] Run Item Replace Block ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ dainer.16 with book {output: 1B} 

For the disorderly synthesis of multiple repetitive items, use multiple score boards, as if it is made.

The preset score boards are: CNC_SLOUT, CNC_SLOUT2, CNC_SLOUT3, CNC_SLOUT4

The following is a complete example of the synthesis of the book:

#disorderly synthetic module

Execute Store Result SCORE @S CNC_SLOUT If Data Block ~ ~ ~ ITEMS [{id: "Minecraft: Paper"}]

#主

Execute if block ~ ~ ~ ~ minecraft: Barrels {items: [{id: "minecraft: pain"}, {id: "minecraft: leather"}]} if entity @s [scores = {cnc_table_co_co Unt = 4, cnc_slout = 3}] Run item replace block ~ ~ ~ ~ container.16 with book {output: 1b}

Replace the synthetic column items (required version 1.4 or above)

Replace the synthetic column items: Sometimes after synthetic items, some items in the synthetic column do not need to be cleared, and only need to be replaced with other items or do not change.

At this time, the following methods can be implemented: after the main function is over, the output bar items are detected. If the target item of this formula, set the score board (CNC_REPLACE_1 ~ 9, see the following example) of the corresponding synthetic field to the specified value.The value needs to be established in the CNC/Funcctions/Machine/Crafting_Table/Recipes/Clear/Replacements.mcFunction file, and the operation method see the example in the corresponding function.

Existing preset: 0 is not moving (not the corresponding value is not moved), 1 is replaced with a bucket (suitable for buckets, lava barrels, milk barrels), 2 is an empty bottlePotion, honey bottle)

If the number of items of the slot is greater than 1 (if multiple honey bottles are stacked), return a replaced item from the player, and the number of items of the synthetic column slot is reduced by 1; if the quantity is equal to 1, the item of the slot willReplace it with a specified item.Example 1: The synthesis of cakes

#master command

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 1b, id: "milk_bucket"}, {slot: 2b, id: milk_bucket "}, {slot: 3b , ID: "Minecraft: milk_bucket "}, {slot: 10b, id:" minecraft: sub "}, {slot: 12b, id:" minecraft: sub "}, {slot: 11b, id:" minecraft: egg "}, {slot:: {slot:19B, ID: "Minecraft: WHEAT"}, {slot: 20b, id: "minecraft: when"}, {slot: 21b, id: "minecraft: when"}]} if entity @s [scores = {cnc_table_co_co und =9}] Run item replace block ~ ~ ~ ~ container.16 with minecraft: care {output: 1b}

#检 检

Execute if block ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: cake"}]} Run Scoreboard Players Set @S CNC_REPLE_1 1 1 1

Execute if block ~ ~ ~ minecraft: Barrels {items: [{slot: 16b, id: "minecraft: cake"}]} Run Scoreboard Players Set @s CNC_REPLACE_2 1

Execute if block ~ ~ ~ ~ minecraft: Barrels {items: [{slot: 16b, id: "minecraft: cake"}]} run scoreboard players set @s cnc_replace_3 1

If the items to be replaced are not determined, it is necessary to check the slot position poorly.

Example 2: Synthetic sugar by honey

#master command

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{id: minecraft: honey_bottle "}]} if entity @s [scores = {cnc_table_count = 1}] run itemre Place block ~ ~ ~ container.16 with minecraft:sugar {output: 1b} 3#detection replacement

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 1b, id: "minecraft: honey_bottle"}} Run ScoreBoard Players set @s cnc_replace_1 2

Execute if block ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 2b, id: "minecraft: honey_bottle"}} Run ScoreBoard Players set @s cnc_replace_2 2 2

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 3b, id: "minecraft: honey_bottle"}]} Run ScoreBoard Players set @s cnc_replace_3 2

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 10b, id: "minecraft: honey_bottle"}} Run SCOREBOARD Players set @s cnc_replace_4 2

Execute if block ~ ~ ~ ~ Minecraft: Barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 11b, id: "minecraft: honey_bottle"}} Players set @s cnc_replace_5 2

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 12b, id: "minecraft: honey_bottle"}} Run ScoreBoard Players set @s cnc_replace_6 2executeif block ~ ~ ~ minecraft: barrel {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 19b, id: "minecraft: honey_bottle"}]} Run SCOREBOARD PLAYERS Set @S CNC_Replace_7 2

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 20b, id: "minecraft: honey_bottle"}} Run ScoreBoard Players set @s cnc_replace_8 2

Execute if block ~ ~ ~ ~ minecraft: barrels {items: [{slot: 16b, id: "minecraft: sugar"}, {slot: 21b, id: "minecraft: honey_bottle"}]} Run SCOREARD Players set @s cnc_replace_9 2

Contains a formula (version 1.3.7 or above)

1.3.7 version and above support this method.

The operation was slightly simplified on the basis of the old version, but the performance was greater.

First of all, the writing of the file is slightly different:

 {{

"Condition": "Minecraft: Inverted",

"Term": {{

"Condition": "Minecraft: Alternative",

"Terms": [

{{

"Condition": "Minecraft: Inverted",

"Term": {{

"Condition": "Minecraft: Entity_properties", "Entity": "This",

"Predicate": {

"Equipment": {

"Chest": {

"Tag": "Minecraft: Planks"

}

}

}

}

},

{{

"Condition": "Minecraft: Inverted",

"Term": {{

"Condition": "Minecraft: Entity_scores",

"Entity": "This",

"Scores": {

"Cnc_tag_id": -1}

}

}

]

}

}

Use the writing of the door to write a condition that meets the scores and the TAG at the same time. It is recommended to copy the example break saying. Remember to change the ID value (CNC_TAG_ID score board)

Then quote this assertion to the main word (Data/CNC/Predicates/Crafting_table/Tag_main.mcFunction)

There are already some examples in the main words:

 {{

"Condition": "Minecraft: Alternative",

"Terms": [

{{

"Condition": "Minecraft: Reference",

"Name": "CNC: Crafting_table/Planks"

},

{{

"Condition": "Minecraft: Reference",

"Name": "CNC: Crafting_table/SLABS" "

}

]

}

Reference in the formula function.Note that the CNC_TAG_ID score board is set to the ID value you set

After the test is completed, the results will be recorded on the CNC_CRAFTAG score board of the armor frame to further deal with

Example 1: Synthesis of bowls

#initialization

scoreboard players reset @s cnc_tag_out

scoreboard players reset @S CNC_CRAFTAG

#Set the ID (the ID should be consistent with the ID specified by the assertive file you set)

Scoreboard Players Set @S CNC_TAG_ID -1#TAG detection

#Set cnc_tag_slot to 0, detect all slots

scoreboard players set @S CNC_TAG_SLOT 0

Function CNC: Machine/Crafting_table/Tag

Execute if score @S CNC_CRAFTAG MATCHES 3 Run SCOREBOARD PLAYERS SET @S CNC_TAG_OUT 1

#主

Execute if block ~ ~ ~ minecraft: barrel {items: [{slot: 1b}, {slot: 11b}, {slot: 3b}]} if entity @s [scores = {cnc_table_count = 3, cnc_t ag_out = 1}] Runitem replace block ~ ~ ~ ~ container.16 with bowl

Execute if block ~ ~ ~ ~ minecraft: barrel {items: [{slot: 10b}, {slot: 20b}, {slot: 12b}]} if entity @s [scores = {cnc_table_count = 3, cnc_t ag_out = 1}] Runitem replace block ~ ~ ~ ~ container.16 with bowl {output: 1b}

For multiple TAG detection and only some slot detection, the use of old version methods is the best way to perform performance. See the tag_old function;

If it is difficult to grasp the poor method, CNC supports a way to operate simple, but the performance consumption is large:

For multiple slot detection, first detect a TAG, transfer the scores obtained on a score board, (CNC provides 9 sets of scores: CNC_TAG_OUT score board, and CNC_TAG_OUT2 ~ 9.) Then detect another TAG, transfer the scores to the score on another score board, and then call the scores of these two score boards in the main function;Determine whether the return value meets the expectations, if the CNC_TAG_OUT is set to 1; of course, the return value of the directly stored back can be determined in the main function);

Note that initialization needs to be detected before each TAG.

Only for some slot detection, you need to set the CNC_TAG_SLOT score, and calculate according to binary (the first slot is 1, the second is 2, the third is 4, and then add it together)

#If you want to detect all slots, it is recommended to set the value to 0 instead of 511.

Example 2: The synthesis of wooden barrels

#tag detection

#(Slot: 1+3+4+6+7+9, value 1+4+8+32+64+256 = 365)

scoreboard players reset @S CNC_CRAFTAG

scoreboard players reset @s cnc_tag_out

scoreboard players set @S CNC_TAG_ID -1

scoreboard players set @S CNC_TAG_SLOT 365

Function CNC: Machine/Crafting_table/Tagexecute if score @S CNC_CRAFTAG MATCHES 6 Run Scoreboard Players Set @S CNC_TAG_OUT 1

#(Slot: 2+8, value 2+128 = 130)

scoreboard players reset @S CNC_CRAFTAG

scoreboard players reset @s cnc_tag_out2

scoreboard players set @S CNC_TAG_ID-2

scoreboard players set @S CNC_TAG_SLOT 130

Function CNC: Machine/Crafting_table/Tag

Execute if score @S CNC_CRAFTAG MATCHES 2 Run SCOREBOARD PLAYERS SET @S CNC_TAG_OUT2 1

#主

Execute if entity @s [scores = {cnc_table_count = 8, cnc_tag_out = 1, cnc_tag_out2 = 1}] Run item replace block ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Arrel {output: 1b}

The old Tag detection method is still available. See below:

Recipe containing tags

The operation method is more complicated.

First set an assertion:

 {{

"Condition": "Minecraft: Entity_properties",, "

"Entity": "This",

"Predicate": {

"Equipment": {

"Chest": {{

"Tag": "Minecraft: Planks"

}

}

}

}

The items are in this tag, assertive.

Then quote the assertion in the function.

It is recommended to copy the following command (CNC1.3.6 and before, this paragraph in the example function in the packet is wrong. The scoring board should be CNC_CRAFTAG instead of CAM_CRAFTAG, fixed in CNC1.3.x Fix1):

#initialization

scoreboard players reset @S CNC_CRAFTAG

#检 tag

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 1b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 2b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 3b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 10b}]. ID

Execute if entity @s [Predicate = cnc: Crafting_table/Planks] Run Scoreboard Players Add @S CNC_CRAFTAG 1Data Modify @S Armoritems [2] Se t value {id: "minecraft: stone", count: 1b}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 11b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 12b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 19b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set FROM BLOCK ~ ~ ~ ~ ITEMS [{slot: 20b}]. ID

Execute if entity @s [Predicate = cnc: Crafting_table/Planks] Run Scoreboard Players Add @S CNC_CRAFTAG 1Data Modify @S Armoritems [2] Se t value {id: "minecraft: stone", count: 1b}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 21b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players Add @S CNC_CRAFTAG 1

It can be seen that under the#detection TAG, there are 9 groups of commands, each group of 3 rows, which is poverty to the 9 synthetic bar grooves.

In the third line of each group, the assertion file (if entity @s [Predicate = CNC: Crafting_table/Planks]) can be changed to your own assertion path behind Predicate.

Next, in the formula master function, if it is disorderly synthesis, there is no need to fill in the relevant messages of the TAG item in the if block field; if it is orderly synthesis, you need to fill in the slot of the TAG item.Be careful not to write ID.

Then add the CNC_CRAFTAG score board to the iF Entity field, that is, the total number of TAG items.The following is a complete example of the synthesis of the bowl:

#initialization

scoreboard players reset @S CNC_CRAFTAG

#检 tag

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 1b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 2b}]. ID

Execute if entity @s [Predicate = cnc: Crafting_table/Planks] Run Scoreboard Players Add @S CNC_CRAFTAG 1Data Modify @S Armoritems [2] Se t value {id: "minecraft: stone", count: 1b}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 3b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 10b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 11b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 12b}]. ID

Execute if entity @s [Predicate = cnc: Crafting_table/Planks] Run Scoreboard Players Add @S CNC_CRAFTAG 1Data Modify @S Armoritems [2] Se t value {id: "minecraft: stone", count: 1b}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 19b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set FROM BLOCK ~ ~ ~ ~ ITEMS [{slot: 20b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

Data Modify Entity @S Armoritems [2] Set Value {id: "Minecraft: Stone", Count: 1B}

Data Modify Entity @S Armoritems [2] .id Set from Block ~ ~ ~ ~ items [{slot: 21b}]. ID

Execute if entity @s [Predicate = CNC: Crafting_table/Planks] Run Scoreboard Players ADD @S CNC_CRAFTAG 1

#主

Execute if block ~ ~ ~ ~ minecraft: barrel {items: [{slot: 1b}, {slot: 11b}, {slot: 3b}]} if entity @s [scores = {cnc_table_count = 3, cnc_c_c raftag = 3}] Runitem replace block ~ ~ ~ ~ container.16 with bowl {output: 1B}