Detailed explanation of JSON [CVH] Custom Village Minecraft Game

This article uses an example as an example.

Standard expression

thing

 {{

"Item": "Minecraft: Diamond", the name of the item registration

"Count": 1, quantity (can exceed the upper limit of stack)

"Data": 0, metadata (if the item owns metadata, it must be provided, or it can be used as DAMAGE)

"Nbt": "{haha: true}", nbt,

"Enchantment": [[

Since MC1.12.2 enchantment uses digital IDs in the NBT, adding additional enchantment is added here with a separate method.Can't write, use NBT to edit the effect is equivalent to the same

{{

"Name": "Minecraft: Fire_protection",,

"Level": 12

Level can also write

"Level": {

"Type": "Minecraft: Price",

"Min": 12,

"Max": 12

}

}

]

}

scope

The number of items in the original version must not exceed 255, otherwise the remaining examples such as 514 = 256+256+2 = 2

Uniform value

 {{

"Type": "Minecraft: Price", if there is no Type field, the default Type is "Minecraft: Price".

"Min": 1, minimum value

"Max": 2 maximum value

}

constant

 {{

"Type": "CVH: Constant",

"Constant": 1 constant

}

Bai Song distribution

 {{

"Type": "CVH: Poisson_distribution",

"Min": 1, minimum value

"Max": 22, the maximum value

"Lambda": 5 average

Bai Song is distributed, but the value is within [min, max).

Do not take too much value because of ride.

}

Ouhuang can not open a transaction that is too reversed (x

Villager occupation

Master career

The main category of occupation.

0_profession.json

 {{

"Type": "Minecraft: Profession", the main type, declares that this is a main profession JSON

"ProfessionName": "CVR: Example", the main professional registration name, repeating will lead to collapse

"Villagetexture": "null: null.png", the stickers of the villagers

"Zombietexture": "null: null.png" zombie villager's stickers

}

Sideline

Specific occupation, practical action of transactions.

1_cancer.json

 {{

"Type": "Minecraft: CANCER", the main type, declares that this is a deputy professional JSON

"Career": "Career", professional name, single string, can be repeated, related to villagers' transaction interface title translation keys

"Profession": "CVR: EXAMPLE" main occupation

}

trade

Emerald changes

2_Emerald_FOR_ITEMS.JSON2_EMERALD_FOR_ITEMS.JSON effect

 {{

"Type": "Minecraft: EMERALD_FOR_ITEMS", the main type, declares that this is a emerald exchange JSON

"Profession": "CVR: Example", the main occupation bound

"Career": "Career", binding sideline

"Level": 1, the unlocking level of this transaction, the lowest is 1, but does not fill in, the default is 1

"Trade": {The main content of the transaction, the above part of the other transactions is equal, the difference is within the trade

1.0.2 Before Minecraft: EMERALD_FOR_ITEMS has the actual content of Bug, to, and from.

After 1.0.2, this bug is fixed, you can fill it arbitrarily, and it will automatically analyze

Below is an example of anti -filling

In fact, there is no To and from here, because the villagers always provide an emerald

"From": {What the player needs to provide (but it is provided by the villagers in the items for the emerald)

"Price": {Number of items, random value in the middle of the two middle (this is a MOD standard range expression)

"Min": 1,

"Max": 2

}

},

"To": {provided by the villagers (but it is provided by the player in the change of the items)

"Item": {item (this is an MOD standard item expression)

"Item": "Minecraft: Diamond", the name of the item registration

"Count": 1, quantity (can exceed stack)

"Data": 0, metadata (if the item owns metadata, it must be provided, or it can be used as DAMAGE)

"Nbt": "{haha: true}", nbt,

"Enchantment": [Since the MC1.12.2 enchantment uses the digital ID in the NBT, adding an additional enchantment with a separate method here.Do not write, use NBT to edit the effect is equivalent {

"Name": "Minecraft: Fire_protection",,

"Level": 12

}

]

}

}

}

}

Items and emerald changes

3_ITEM_AND_EMERARALD_TO_ITEM.JSON

3_ITEM_AND_EMERARALD_TO_ITEM.JSON effect

 {{

"Type": "Minecraft: Item_and_emerald_to_item",, "

"Profession": "CVR: Example",

"Career": "Career",

"Level": 1,

"Level": 1,

"Trade": {

"From": {{

"Price": {Number of emeralds

"Min": 1,

"Max": 2

},

"Count": {Number of items, covering items Count

"Min": 1,

"Max": 2

},

"Item": {item

"Item": "Minecraft: DIRT", "Count": 1,

"Data": 0,

"Nbt": "{haha: true}",

"Enchantment": [[

{{

"Name": "Minecraft: Fire_protection",,

"Level": 12

}

]

}

},

"To": {{

"Count": {Number of items

"Min": 3,

"Max": 4

},

"Item": {item

"Item": "Minecraft: Iron_sword",,

"Count": 1,

"Data": 0,

"Nbt": "{haha: true}",

"Enchantment": [[

{"Name": "MineCraft: Fire_protection",

"Level": 5

}

]

}

}

}

}

Emerald replacement

4_list_item_FOR_EMERALDS.JSON

4_list_item_FOR_EMERALDS.JSON effect

 {{

"Type": "Minecraft: list_item_for_emeralds",,

"Profession": "CVR: Example",

"Career": "Career",

"Level": 1,

"Trade": {

"From": {{

Price: If the negative number is taken here, expresses the number of items that an emerald can be purchased.

Non -standard range expression (1.1.3 removed)

"Minprice": 1. The minimum number of emeralds required

"Maxprice": 2 The maximum number of emeralds required

1.1.3 New increase:

"Price": {Standard range

"Type": "Minecraft: Price",

"Min": 1,

"Max": 2

}

},

"To": {{

"Item": {Item Standard Express (MOD)

"Item": "Minecraft: Apple",

"Count": 10,

"Data": 0,

"Nbt": "{haha: true}",

"Enchantment": [[

{{

"Name": "Minecraft: Fire_protection",,

"Level": 114

}

]

}

}

}

}

Object

5_cvh_slots.json

5_cvh_slots.json effect

 {{

"Type": "CVH: Slots",

"Profession": "CVR: Example",

"Career": "Career",

"Level": 1,

"Trade": {

"From": {{

"Slot1": {{

"Price": {{

"Type": "CVH: Poisson_distribution",

"Min": 1, "max": 22,

"Lambda": 5

},

"Item": {{

"Item": "Minecraft: DIRT",

"Count": 1,

"Data": 0,

"Nbt": "{haha: true}",

"Enchantment": [[

{{

"Name": "Minecraft: Fire_protection",,

"Level": {

"Type": "CVH: Poisson_distribution",

"Min": 1,

"Max": 22,

"Lambda": 5

}}

]

}

},

"Slot2": {

"Price": {{

"Type": "CVH: Poisson_distribution",

"Min": 1,

"Max": 22,

"Lambda": 5

},

"Item": {{

"Item": "Minecraft: Diamond",,

"Count": 1,

"Data": 0,

"Nbt": "{haha: false}",

"Enchantment": [[

{{

"Name": "Minecraft: Fire_protection",,

"Level": {"Type": "CVH: Poisson_distribution",

"Min": 3,

"Max": 5,

"Lambda": 4

}

}

]

}

}

},

"To": {{

"Slot3": {{

"Price": {{

"Type": "CVH: Constant",

"Constant": 32

},

"Item": {{

"Item": "Minecraft: Apple",

"Count": 10,

"Data": 0,

"Nbt": "{haha: true}", "enchantment": [

{{

"Name": "Minecraft: Fire_protection",,

"Level": {

"Type": "CVH: Constant",

"Constant": 32

}

}

]

}

}

}

}

}