Modding:Item Json Properties: Difference between revisions
CreativeMD (talk | contribs) No edit summary |
No edit summary |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
A complete list of all available properties | __NOTOC__ | ||
== Overview == | |||
A complete list of all available properties | |||
<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'> | <table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'> | ||
<tr style='background-color: | <tr style='background-color: rgba(0,0,0,0.2);'> | ||
<th width='300' align='left'>Property</th> | <th width='300' align='left'>Property</th> | ||
<th width='200' align='left'>Type</th> | <th width='200' align='left'>Type</th> | ||
<th width=' | <th width='120' align='left'>Default</th> | ||
<th align='left'>Usage</th> | <th align='left'>Usage</th> | ||
</tr> | </tr> | ||
Line 15: | Line 17: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px; | <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Core (no byType available)</b></td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id="p_code" data-tt-parent="root"> | <td scope="row"><div class="tt" data-tt-id="p_code" data-tt-parent="root">Code</div></td> | ||
<td>string</td> | <td>string</td> | ||
<td>required</td> | |||
<td>A unique identifier for the item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_code_info" data-tt-parent="p_code" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
A '''domain prefix''' will be added dynamically depending on the location of the file. Every mod and VintageStory itself have a unique prefix. | |||
For example the code '''<code>stone</code>''' turns into '''<code>game:stone</code>'''. | |||
The code identifier has to be unique inside its domain. In theory there could be equal identifiers with different domain prefixes. | |||
Find out more about [[Basic Modding#Domains|Domains]]. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_enabled" data-tt-parent="root">Enabled</div></td> | |||
<td>boolean</td> | |||
<td>true</td> | |||
<td>If the item will be loaded or not. Can be used to temporarily remove the item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_variantgroups" data-tt-parent="root">VariantGroups</div></td> | |||
<td>array of object</td> | |||
<td>-</td> | |||
<td>Allows you define multiple variants of the same item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_variantgroups_info" data-tt-parent="p_variantgroups" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
The variantgroups property allows you to define multiple variants of this item. All of them will have their unique pattern, which will be added to the item code. | |||
An easy example would be a bowl, which can either be raw or burned: | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ code:"type", states: ["raw", "burned"] }, | |||
], | |||
</syntaxhighlight> | |||
Meaning there will be two variants <code>bowl-raw</code> and <code>bowl-burned</code>. | |||
---- | |||
It's also possible to define multiple groups. | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ code:"state", states: ["closed", "opened"] }, | |||
{ code:"contents", states: ["empty", "cabbage"] }, | |||
], | |||
</syntaxhighlight> | |||
As a result you will have 2x2 groups, which will be added one after each other: <code>barrel-closed-empty</code>, <code>barrel-closed-cabbage</code>, <code>barrel-opened-empty</code> and <code>barrel-opened-cabbage</code>. | |||
---- | |||
Additionally it is possible to refer to external lists (used for blocks) that are found in the worldproperties folder, such as <code>block/rock</code>, which contains all states of all rock types. This used for <code>gravel</code>, <code>sand</code> and <code>rock</code>. It's a good way to keep everything organized: | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ loadFromProperties: "block/rock" }, | |||
], | |||
</syntaxhighlight> | |||
Here is a full list of all groups and their variants (you can also find them in the <code>assets/worldproperties</code> folder): | |||
{{:json:block:worldvariantgroups}} | |||
---- | |||
Furthermore there are two ways of combining groups together. So far we covered the default combination mode, which is <code>multiplicative</code> (the total count of variants is the product of all states). | |||
Let's take a look at a different example (flowerpot), which uses the <code>additive</code> combination mode: | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ code: "type", states: ["raw"] }, | |||
{ code: "empty", states: ["empty"], combine: "additive" }, | |||
{ code: "flower", loadFromProperties: "block/flower", combine: "additive" }, | |||
{ code: "mushroom", loadFromProperties: "block/mushroom", combine: "additive" }, | |||
{ code: "sapling", loadFromProperties: "block/wood", combine: "additive" }, | |||
], | |||
</syntaxhighlight> | |||
The variants are <code>flowerpot-raw</code>, <code>flowerpot-empty</code>, <code>flowerpot-{all flowers}</code>, <code>flowerpot-{all mushrooms}</code> and <code>flowerpot-{all saplings}</code>. | |||
<code>Additive</code> mode could also be called separate, since it defines a variant separate from all the other groups: | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ code: "something", states: ["same", "different"] }, | |||
{ code: "type", states: ["raw", "baked"] }, | |||
{ code: "empty", states: ["red", "green"], "combine": "additive" }, | |||
], | |||
</syntaxhighlight> | |||
In this case, the result would be <code>same-raw</code>, <code>same-baked</code>, <code>different-raw</code>, <code>different-baked</code>, <code>red</code> and <code>green</code> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_byType" data-tt-parent="root">(any) byType</div></td> | |||
<td>key: string; value: object</td> | |||
<td>-</td> | |||
<td>You can create properties for certain variants of the item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_byType_info" data-tt-parent="p_byType" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
In order to define properties for specific variants you can add '''byType''' to the property name. This allows you to define it depending on the type and always follows the same syntax: | |||
<syntaxhighlight lang="json"> | |||
(property)ByType: { | |||
"selector": property, | |||
"selector2": property2, | |||
... | |||
} | |||
</syntaxhighlight> | |||
If the selector matches the name of the variant the given property will be used. Keep in mind that only the first matching one will be used (everything below will be ignored). | |||
A slab for example has two variants ('''up''', '''down'''), which have different collision boxes: | |||
<syntaxhighlight lang="json"> | |||
collisionboxByType: { | |||
"*-down": { x1: 0, y1: 0, z1: 0, x2: 1, y2: 0.5, z2: 1 }, | |||
"*-up": { x1: 0, y1: 0.5, z1: 0, x2: 1, y2: 1, z2: 1 } | |||
}, | |||
</syntaxhighlight> | |||
The char '''<code>*</code>''' stands for anything. In this case it ignores the code of the item. | |||
Furthermore this opens up even more possbilities for more advanced selectors like this one for doors: | |||
<code>*-north-*-opened-left</code>. This will ignore the second variantgroup. Additionally ByType can also be used for child properties: | |||
<syntaxhighlight lang="json"> | |||
collisionboxnbox: { | |||
x1: 0, y1: 0, z1: 0.875, x2: 1, y2: 1, z2: 1, | |||
rotateYByType: { | |||
"*-north-*-opened-left": 90, | |||
"*-north-*-closed-left": 0, | |||
"*-west-*-opened-left": 180, | |||
"*-west-*-closed-left": 90, | |||
"*-east-*-opened-left": 0, | |||
"*-east-*-closed-left": 270, | |||
"*-south-*-opened-left": 270, | |||
"*-south-*-closed-left": 180, | |||
"*-north-*-opened-right": 270, | |||
"*-north-*-closed-right": 0, | |||
"*-west-*-opened-right": 0, | |||
"*-west-*-closed-right": 90, | |||
"*-east-*-opened-right": 180, | |||
"*-east-*-closed-right": 270, | |||
"*-south-*-opened-right": 90, | |||
"*-south-*-closed-right": 180 | |||
} | |||
}, | |||
</syntaxhighlight> | |||
Since Vintagestory v1.8 it is also possible to use the variantgroup as a placeholder: | |||
<syntaxhighlight lang="json"> | |||
variantgroups: [ | |||
{ code: "metal", states: ["copper", "tinbronze", "bismuthbronze", "blackbronze", "gold", "silver", "iron" ] }, | |||
], | |||
textures: { | |||
"metal": { base: "block/metal/ingot/{metal}" }, | |||
"wood": { base: "item/tool/material/wood" } | |||
}, | |||
</syntaxhighlight> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Specific</b></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_class" data-tt-parent="root">Class</div></td> | |||
<td>string</td> | |||
<td>"item"</td> | |||
<td>The item class can add special functionalities for the item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_class_info" data-tt-parent="p_class" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
It can be used to open guis or adding other extra functionality to the item. A complete tutorial of how to add your own class to the game can be found [[Advanced Items|here]]. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_durability" data-tt-parent="root">Durability</div></td> | |||
<td>integer</td> | |||
<td>0</td> | |||
<td>How many uses does this item has when being used. Item disappears at durability 0.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_damagedby" data-tt-parent="root">DamagedBy</div></td> | |||
<td>array of string</td> | |||
<td>-</td> | |||
<td>From which damage sources does the item takes durability damage.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_damagedby_blockbreaking" data-tt-parent="p_damagedby">BlockBreaking</div></td> | |||
<td></td> | |||
<td>0</td> | |||
<td>Mining a block.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_damagedby_attacking" data-tt-parent="p_damagedby">Attacking</div></td> | |||
<td></td> | |||
<td>1</td> | |||
<td>Hitting an entity.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_damagedby_fire" data-tt-parent="p_damagedby">Fire</div></td> | |||
<td></td> | |||
<td>2</td> | |||
<td>Currently not used.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool" data-tt-parent="root">Tool</div></td> | |||
<td>string</td> | |||
<td>-</td> | |||
<td>If set, this item will be classified as given tool.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_knife" data-tt-parent="p_tool">Knife</div></td> | |||
<td></td> | |||
<td>0</td> | |||
<td>USed to break grass.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_pickaxe" data-tt-parent="p_tool">Pickaxe</div></td> | |||
<td></td> | |||
<td>1</td> | |||
<td>Can mine rock and other stone materials</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_axe" data-tt-parent="p_tool">Axe</div></td> | |||
<td></td> | |||
<td>2</td> | |||
<td>Useful for chopping trees.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_sword" data-tt-parent="p_tool">Sword</div></td> | |||
<td></td> | |||
<td>3</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_shovel" data-tt-parent="p_tool">Shovel</div></td> | |||
<td></td> | |||
<td>4</td> | |||
<td>Mines dirt, sand and gravel really fast.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_hammer" data-tt-parent="p_tool">Hammer</div></td> | |||
<td></td> | |||
<td>5</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_mallet" data-tt-parent="p_tool">Mallet</div></td> | |||
<td></td> | |||
<td>6</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_spear" data-tt-parent="p_tool">Spear</div></td> | |||
<td></td> | |||
<td>7</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_bow" data-tt-parent="p_tool">Bow</div></td> | |||
<td></td> | |||
<td>8</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_sickle" data-tt-parent="p_tool">Sickle</div></td> | |||
<td></td> | |||
<td>9</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_hoe" data-tt-parent="p_tool">Hoe</div></td> | |||
<td></td> | |||
<td>10</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tool_saw" data-tt-parent="p_tool">Saw</div></td> | |||
<td></td> | |||
<td>11</td> | |||
<td>No special abilities yet.</td> | |||
</tr> | |||
<tr> | |||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_creativeinventory" data-tt-parent="root">CreativeInventory</div></td> | |||
<td>key: string, value: string[]</td> | |||
<td>-</td> | <td>-</td> | ||
<td>A | <td>In which creative inventory tabs the item should be visible in.</td> | ||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_creativeinventory_info" data-tt-parent="p_creativeinventory" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
There are several tabs to you can add your stuff. Note that general should always be included, since it should contain everything. | |||
*general | |||
*terrain | |||
*flora | |||
*construction | |||
*decorative | |||
*items | |||
'''Rock''' adds all of it's variantions to general, terrain and construction: | |||
<syntaxhighlight lang="json"> | |||
creativeinventory: { "general": ["*"], "terrain": ["*"], "construction": ["*"] }, | |||
</syntaxhighlight> | |||
'''<code>*</code>''' reprents the variants which will be added. You can specify multiple and separate them with a comma. It follows the same way as the '''byType''' property. | |||
A '''Torch''' on the other hand only adds the variation '''<code>up</code>''': | |||
<syntaxhighlight lang="json"> | |||
creativeinventory: { "general": ["*-up"], "decorative": ["*-up"] }, | |||
</syntaxhighlight> | |||
</td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id="p_maxstacksize" data-tt-parent="root"> | <td scope="row"><div class="tt" data-tt-id="p_maxstacksize" data-tt-parent="root">MaxStackSize</div></td> | ||
<td> | <td>integer</td> | ||
<td>64</td> | <td>64</td> | ||
<td>Determines the maximum amount you can stack the block in one | <td>Determines the maximum amount you can stack the item in one slot.</td> | ||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_attackpower" data-tt-parent="root">AttackPower</div></td> | |||
<td>decimal number</td> | |||
<td>0.5</td> | |||
<td>The damage the deals when hitting an entity.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_attackrange" data-tt-parent="root">AttackRange</div></td> | |||
<td>decimal number</td> | |||
<td>1.5</td> | |||
<td>The maximum distance you can hit an entity.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_materialdensity" data-tt-parent="root">MaterialDensity</div></td> | |||
<td>integer</td> | |||
<td>9999</td> | |||
<td>Determines on whether an object floats on liquids or not.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_materialdensity_info" data-tt-parent="p_materialdensity" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
Water has a density of 1000, meaning everything below or equal will float on water. The same goes for lava which has a density of 5000. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_liquidselectable" data-tt-parent="root">LiquidSelectable</div></td> | |||
<td>boolean</td> | |||
<td>false</td> | |||
<td>If the item can select a liquid while holding it in hand.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_liquidselectable_info" data-tt-parent="p_liquidselectable" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
Used for buckets in order to fill it with water and to place waterlily on top of water. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_miningspeed" data-tt-parent="root">MiningSpeed</div></td> | |||
<td>key: string, value: decimal number</td> | |||
<td>-</td> | |||
<td>The mining speed for each material.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_miningspeed" data-tt-parent="root">MiningTier</div></td> | |||
<td>integer</td> | |||
<td>0</td> | |||
<td>Determines which blocks it can break. If the required miningtier is above the defined one there will be no drop from it.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_attributes" data-tt-parent="root">Attributes</div></td> | |||
<td>key: string, value: object</td> | |||
<td>-</td> | |||
<td>Custom Attributes associated with this item.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
Extra attributes added to a item or block. Those are final and cannot be modified. It's a good way to keep things organized and and modifiable. The '''oreblastingbomb''' for example has attributes, which define its radius and type. These can be used by behaviors and blockentities: | |||
<syntaxhighlight lang="json"> | |||
attributes: { | |||
"blastRadius": 4, | |||
"blastType": 0, | |||
}, | |||
</syntaxhighlight> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_combustibleprops" data-tt-parent="root">CombustibleProps</div></td> | |||
<td>object</td> | |||
<td>-</td> | |||
<td>Information about the items burnable states.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_burntemperature" data-tt-parent="p_combustibleprops">BurnTemperature</div></td> | |||
<td>integer</td> | |||
<td>-</td> | |||
<td>The temperature at which it burns in degrees celsius.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_burnduration" data-tt-parent="p_combustibleprops">BurnDuration</div></td> | |||
<td>decimal number</td> | |||
<td>-</td> | |||
<td>For how long it burns in seconds.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_heatresistance" data-tt-parent="p_combustibleprops">HeatResistance</div></td> | |||
<td>integer</td> | |||
<td>500</td> | |||
<td>How many degrees celsius it can resists before it ignites (not implemented yet).</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_meltingpoint" data-tt-parent="p_combustibleprops">MeltingPoint</div></td> | |||
<td>integer</td> | |||
<td>-</td> | |||
<td>How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and Melted is set.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_meltingduration" data-tt-parent="p_combustibleprops">MeltingDuration</div></td> | |||
<td>decimal number</td> | |||
<td>-</td> | |||
<td>For how many seconds the temperature has to be above the melting point until the item is smelted.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_smokelevel" data-tt-parent="p_combustibleprops">SmokeLevel</div></td> | |||
<td>decimal number</td> | |||
<td>1</td> | |||
<td>How much smoke this item produces when being used as fuel.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_smeltedratio" data-tt-parent="p_combustibleprops">SmeltedRatio</div></td> | |||
<td>integer</td> | |||
<td>1</td> | |||
<td>How many ores are required to produce one output stack.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_liquidlevel" data-tt-parent="p_combustibleprops">SmeltedStack</div></td> | |||
<td>object</td> | |||
<td>-</td> | |||
<td>If set, the block/item is smeltable in a furnace and this is the resulting itemstack once the MeltingPoint has been reached for the supplied duration.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_requirescontainer" data-tt-parent="p_combustibleprops">RequiresContainer</div></td> | |||
<td>boolean</td> | |||
<td>true</td> | |||
<td>If set to true, the block/item requires a smelting/cooking/baking container such as the Crucible. If false, it can be directly baked/melted without smelting/cooking/baking container.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_combustibleprops_info" data-tt-parent="p_combustibleprops" data-invisible="true"></div></td> | |||
<td colspan="3"> | |||
This property can be used to define a burning material. '''Plank''' for example can get on fire: | |||
<syntaxhighlight lang="json"> | |||
combustibleProps: { | |||
burnTemperature: 800, | |||
burnDuration: 12, | |||
}, | |||
</syntaxhighlight> | |||
Furthermore it can be used to define smelting processes. An example would be an '''ingotmold''' which turns into an ingotmold-burned: | |||
<syntaxhighlight lang="json"> | |||
combustiblePropsByType: { | |||
"ingotmold-raw": { | |||
meltingPoint: 600, | |||
meltingDuration: 30, | |||
smeltedRatio: 1, | |||
smeltedStack: { type: "block", code: "ingotmold-burned" }, | |||
requiresContainer: false | |||
} | |||
}, | |||
</syntaxhighlight> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_nutritionprops" data-tt-parent="root">NutritionProps</div></td> | |||
<td>object</td> | |||
<td>-</td> | |||
<td>Information about the items nutrients.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_nutritionprops_foodcategory" data-tt-parent="p_nutritionprops">FoodCategory</div></td> | |||
<td>string</td> | |||
<td>-</td> | |||
<td>Defines the type of food. It can be '''''fruit''''', '''''vegetable''''', '''''protein''''', '''''grain''''' and '''''dairy'''''.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_nutritionprops_saturation" data-tt-parent="p_nutritionprops">Saturation</div></td> | |||
<td>decimal number</td> | |||
<td>0</td> | |||
<td>How much saturation it can restore.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_nutritionprops_health" data-tt-parent="p_nutritionprops">Health</div></td> | |||
<td>decimal number</td> | |||
<td>0</td> | |||
<td>How much health it can restore.</td> | |||
</tr> | |||
<tr> | |||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Rendering</b></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">Textures</div></td> | |||
<td>string</td> | |||
<td>required</td> | |||
<td>The texture definitions for the item held in hand or dropped on the ground.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_shape" data-tt-parent="root">Shape</div></td> | |||
<td>object</td> | |||
<td>-</td> | |||
<td>The items shape. Empty for automatic shape based on the texture.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_guitransform" data-tt-parent="root">GuiTransform</div></td> | |||
<td>object</td> | |||
<td>item default</td> | |||
<td>Used for scaling, rotation or offseting the item when rendered in guis.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_fphandtransform" data-tt-parent="root">FpHandTransform</div></td> | |||
<td>object</td> | |||
<td>item default</td> | |||
<td>Used for scaling, rotation or offseting the item when rendered in the first person mode hand.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_tphandtransform" data-tt-parent="root">TpHandTransform</div></td> | |||
<td>object</td> | |||
<td>item default</td> | |||
<td>Used for scaling, rotation or offseting the item when rendered in the third person mode hand.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_groundtransform" data-tt-parent="root">GroundTransform</div></td> | |||
<td>object</td> | |||
<td>item default</td> | |||
<td>Used for scaling, rotation or offseting the rendered as a dropped item on the ground.</td> | |||
</tr> | </tr> | ||
</table> | </table> | ||
{{Navbox/modding|Vintage Story}} | |||
Revision as of 09:13, 26 March 2019
Overview
A complete list of all available properties
Property | Type | Default | Usage | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
json |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Core (no byType available) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Code |
string | required | A unique identifier for the item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A domain prefix will be added dynamically depending on the location of the file. Every mod and VintageStory itself have a unique prefix. For example the code The code identifier has to be unique inside its domain. In theory there could be equal identifiers with different domain prefixes. Find out more about Domains. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Enabled |
boolean | true | If the item will be loaded or not. Can be used to temporarily remove the item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VariantGroups |
array of object | - | Allows you define multiple variants of the same item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The variantgroups property allows you to define multiple variants of this item. All of them will have their unique pattern, which will be added to the item code. An easy example would be a bowl, which can either be raw or burned: variantgroups: [
{ code:"type", states: ["raw", "burned"] },
],
Meaning there will be two variants It's also possible to define multiple groups. variantgroups: [
{ code:"state", states: ["closed", "opened"] },
{ code:"contents", states: ["empty", "cabbage"] },
],
As a result you will have 2x2 groups, which will be added one after each other: Additionally it is possible to refer to external lists (used for blocks) that are found in the worldproperties folder, such as variantgroups: [
{ loadFromProperties: "block/rock" },
],
Here is a full list of all groups and their variants (you can also find them in the For example, the following creates a variant group named orientation. It contains 5 states. variantgroups: [
{ code: "orientation", states: ["up"], loadFromProperties: "abstract/horizontalorientation" }
],
Unwanted variant states can be filtered out with the
Wondering where some links have gone?
Furthermore there are two ways of combining groups together. So far we covered the default combination mode, which is Let's take a look at a different example (flowerpot), which uses the variantgroups: [
{ code: "type", states: ["raw"] },
{ code: "empty", states: ["empty"], combine: "additive" },
{ code: "flower", loadFromProperties: "block/flower", combine: "additive" },
{ code: "mushroom", loadFromProperties: "block/mushroom", combine: "additive" },
{ code: "sapling", loadFromProperties: "block/wood", combine: "additive" },
],
The variants are
variantgroups: [
{ code: "something", states: ["same", "different"] },
{ code: "type", states: ["raw", "baked"] },
{ code: "empty", states: ["red", "green"], "combine": "additive" },
],
In this case, the result would be |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(any) byType |
key: string; value: object | - | You can create properties for certain variants of the item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In order to define properties for specific variants you can add byType to the property name. This allows you to define it depending on the type and always follows the same syntax: (property)ByType: {
"selector": property,
"selector2": property2,
...
}
If the selector matches the name of the variant the given property will be used. Keep in mind that only the first matching one will be used (everything below will be ignored). A slab for example has two variants (up, down), which have different collision boxes: collisionboxByType: {
"*-down": { x1: 0, y1: 0, z1: 0, x2: 1, y2: 0.5, z2: 1 },
"*-up": { x1: 0, y1: 0.5, z1: 0, x2: 1, y2: 1, z2: 1 }
},
The char Furthermore this opens up even more possbilities for more advanced selectors like this one for doors:
collisionboxnbox: {
x1: 0, y1: 0, z1: 0.875, x2: 1, y2: 1, z2: 1,
rotateYByType: {
"*-north-*-opened-left": 90,
"*-north-*-closed-left": 0,
"*-west-*-opened-left": 180,
"*-west-*-closed-left": 90,
"*-east-*-opened-left": 0,
"*-east-*-closed-left": 270,
"*-south-*-opened-left": 270,
"*-south-*-closed-left": 180,
"*-north-*-opened-right": 270,
"*-north-*-closed-right": 0,
"*-west-*-opened-right": 0,
"*-west-*-closed-right": 90,
"*-east-*-opened-right": 180,
"*-east-*-closed-right": 270,
"*-south-*-opened-right": 90,
"*-south-*-closed-right": 180
}
},
Since Vintagestory v1.8 it is also possible to use the variantgroup as a placeholder: variantgroups: [
{ code: "metal", states: ["copper", "tinbronze", "bismuthbronze", "blackbronze", "gold", "silver", "iron" ] },
],
textures: {
"metal": { base: "block/metal/ingot/{metal}" },
"wood": { base: "item/tool/material/wood" }
},
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specific | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Class |
string | "item" | The item class can add special functionalities for the item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It can be used to open guis or adding other extra functionality to the item. A complete tutorial of how to add your own class to the game can be found here. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Durability |
integer | 0 | How many uses does this item has when being used. Item disappears at durability 0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DamagedBy |
array of string | - | From which damage sources does the item takes durability damage. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BlockBreaking |
0 | Mining a block. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Attacking |
1 | Hitting an entity. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fire |
2 | Currently not used. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Tool |
string | - | If set, this item will be classified as given tool. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Knife |
0 | USed to break grass. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pickaxe |
1 | Can mine rock and other stone materials | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Axe |
2 | Useful for chopping trees. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sword |
3 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shovel |
4 | Mines dirt, sand and gravel really fast. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hammer |
5 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mallet |
6 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Spear |
7 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bow |
8 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sickle |
9 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hoe |
10 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saw |
11 | No special abilities yet. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Common | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CreativeInventory |
key: string, value: string[] | - | In which creative inventory tabs the item should be visible in. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There are several tabs to you can add your stuff. Note that general should always be included, since it should contain everything.
Rock adds all of it's variantions to general, terrain and construction: creativeinventory: { "general": ["*"], "terrain": ["*"], "construction": ["*"] },
A Torch on the other hand only adds the variation creativeinventory: { "general": ["*-up"], "decorative": ["*-up"] },
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MaxStackSize |
integer | 64 | Determines the maximum amount you can stack the item in one slot. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AttackPower |
decimal number | 0.5 | The damage the deals when hitting an entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AttackRange |
decimal number | 1.5 | The maximum distance you can hit an entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MaterialDensity |
integer | 9999 | Determines on whether an object floats on liquids or not. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Water has a density of 1000, meaning everything below or equal will float on water. The same goes for lava which has a density of 5000. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LiquidSelectable |
boolean | false | If the item can select a liquid while holding it in hand. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Used for buckets in order to fill it with water and to place waterlily on top of water. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MiningSpeed |
key: string, value: decimal number | - | The mining speed for each material. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MiningTier |
integer | 0 | Determines which blocks it can break. If the required miningtier is above the defined one there will be no drop from it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Attributes |
key: string, value: object | - | Custom Attributes associated with this item. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Extra attributes added to a item or block. Those are final and cannot be modified. It's a good way to keep things organized and and modifiable. The oreblastingbomb for example has attributes, which define its radius and type. These can be used by behaviors and blockentities: attributes: {
"blastRadius": 4,
"blastType": 0,
},
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CombustibleProps |
object | - | Information about the items burnable states. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BurnTemperature |
integer | - | The temperature at which it burns in degrees celsius. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BurnDuration |
decimal number | - | For how long it burns in seconds. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HeatResistance |
integer | 500 | How many degrees celsius it can resists before it ignites (not implemented yet). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MeltingPoint |
integer | - | How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and Melted is set. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MeltingDuration |
decimal number | - | For how many seconds the temperature has to be above the melting point until the item is smelted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SmokeLevel |
decimal number | 1 | How much smoke this item produces when being used as fuel. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SmeltedRatio |
integer | 1 | How many ores are required to produce one output stack. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SmeltedStack |
object | - | If set, the block/item is smeltable in a furnace and this is the resulting itemstack once the MeltingPoint has been reached for the supplied duration. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RequiresContainer |
boolean | true | If set to true, the block/item requires a smelting/cooking/baking container such as the Crucible. If false, it can be directly baked/melted without smelting/cooking/baking container. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This property can be used to define a burning material. Plank for example can get on fire: combustibleProps: {
burnTemperature: 800,
burnDuration: 12,
},
Furthermore it can be used to define smelting processes. An example would be an ingotmold which turns into an ingotmold-burned: combustiblePropsByType: {
"ingotmold-raw": {
meltingPoint: 600,
meltingDuration: 30,
smeltedRatio: 1,
smeltedStack: { type: "block", code: "ingotmold-burned" },
requiresContainer: false
}
},
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NutritionProps |
object | - | Information about the items nutrients. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FoodCategory |
string | - | Defines the type of food. It can be fruit, vegetable, protein, grain and dairy. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saturation |
decimal number | 0 | How much saturation it can restore. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Health |
decimal number | 0 | How much health it can restore. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rendering | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Textures |
string | required | The texture definitions for the item held in hand or dropped on the ground. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shape |
object | - | The items shape. Empty for automatic shape based on the texture. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GuiTransform |
object | item default | Used for scaling, rotation or offseting the item when rendered in guis. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FpHandTransform |
object | item default | Used for scaling, rotation or offseting the item when rendered in the first person mode hand. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TpHandTransform |
object | item default | Used for scaling, rotation or offseting the item when rendered in the third person mode hand. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GroundTransform |
object | item default | Used for scaling, rotation or offseting the rendered as a dropped item on the ground. |
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |