Modding:Entity Json Properties: Difference between revisions
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 124: | Line 124: | ||
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). | 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). | ||
An entity for example has two variants ('''big''', '''small'''): | |||
<syntaxhighlight lang="json"> | <syntaxhighlight lang="json"> | ||
falldamagebyType: { | |||
"*- | "*-big": true, | ||
"*- | "*-small": false | ||
}, | }, | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 174: | Line 143: | ||
<tr> | <tr> | ||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td> | <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_class" data-tt-parent="root">Class</div></td> | |||
<td>string</td> | |||
<td>"block"</td> | |||
<td>The entity class can add special functionalities for the entity.</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"> | |||
Can be used to add interaction to the entity or other special functionalities. Example uses are <code>EntityItem</code> and <code>EntityPlayer</code>. | |||
</td> | |||
</tr> | </tr> | ||
</table> | </table> |
Revision as of 11:41, 25 October 2018
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 entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 entity will be loaded or not. Can be used to temporarily remove the entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
VariantGroups |
array of object | - | Allows you define multiple variants of the same entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The variantgroups property allows you to define multiple variants of this entity. All of them will have their unique pattern, which will be added to the entity code. An easy example would be a sheep, which can either be small or tall: variantgroups: [
{ code:"size", states: ["small", "tall"] },
],
Meaning there will be two blocks It's also possible to define multiple groups. variantgroups: [
{ code:"size", states: ["small", "tall"] },
{ code:"color", states: ["white", "black"] },
],
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 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?
Futhermore there are two ways of combining groups together. So far we covered the default combination mode, which is Imagine you want to implement a living tree, were either flowers, mushrooms or saplings or on it. You can use the variantgroups: [
{ code: "type", loadFromProperties: "block/wood" },
{ code: "flower", loadFromProperties: "block/flower", combine: "additive" },
{ code: "mushroom", loadFromProperties: "block/mushroom", combine: "additive" },
{ code: "sapling", loadFromProperties: "block/wood", combine: "additive" },
],
The living trees exists for every wood type (birch, oak, maple, pine, acacia, kapok) and can either have a flower, mushroom or a sapling suffix: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(any) byType |
key: string; value: object | - | You can create properties for certain variants of the block. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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). An entity for example has two variants (big, small): falldamagebyType: {
"*-big": true,
"*-small": false
},
Since Vintagestory v1.8 it is also possible to use the variantgroup as a placeholder: variantgroups: [
{ code: "type", states: ["normal", "bamboo"] },
],
texture: { base: "entity/fish/{type}" }
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Common | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Class |
string | "block" | The entity class can add special functionalities for the entity. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Can be used to add interaction to the entity or other special functionalities. Example uses are |
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 • Content Mod Concepts |
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 • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |