Modding:Basic Block: Difference between revisions

From Vintage Story Wiki
m
Add quotes around json keys.
m (Add quotes around json keys.)
m (Add quotes around json keys.)
Line 146: Line 146:
Now we need to change a few things in our json file. We can add all kinds of different groups, but for now we keep it simple. We are adding group called <code>type</code>, with the states <code>gold</code> and <code>iron</code>. You can use any group code you want.
Now we need to change a few things in our json file. We can add all kinds of different groups, but for now we keep it simple. We are adding group called <code>type</code>, with the states <code>gold</code> and <code>iron</code>. You can use any group code you want.
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
variantgroups: [
"variantgroups": [
{ code: "type", states: ["gold", "iron"] }
{ "code": "type", "states": ["gold", "iron"] }
],
],
</syntaxhighlight>
</syntaxhighlight>
Line 157: Line 157:
<!--T:42-->
<!--T:42-->
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
texturesbytype: {
"texturesbytype": {
"*-gold": {
"*-gold": {
all: {  
"all": {  
base: "block/mygoldtexture",
"base": "block/mygoldtexture",
alternates: [{base: "block/mygoldtexture1" }, {base: "block/mygoldtexture2" }, {base: "block/mygoldtexture3" }],
"alternates": [{"base": "block/mygoldtexture1" }, {"base": "block/mygoldtexture2" }, {"base": "block/mygoldtexture3" }],
},
},
},
},
"*-iron": {
"*-iron": {
all: {  
"all": {  
base: "block/myirontexture",
"base": "block/myirontexture",
alternates: [{base: "block/myirontexture1" }, {base: "block/myirontexture2" }, {base: "block/myirontexture3" }],
"alternates": [{"base": "block/myirontexture1" }, {"base": "block/myirontexture2" }, {"base": "block/myirontexture3" }],
},
},
}
}
Line 181: Line 181:
<!--T:45-->
<!--T:45-->
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
textures: {
"textures": {
all: {  
"all": {  
base: "block/my{type}texture",
"base": "block/my{type}texture",
alternates: [{base: "block/my{type}texture1" }, {base: "block/my{type}texture2" }, {base: "block/my{type}texture3" }],
"alternates": [{"base": "block/my{type}texture1" }, {"base": "block/my{type}texture2" }, {"base": "block/my{type}texture3" }],
},
},
},
},
Line 193: Line 193:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
code: "myshinyblock",
"code": "myshinyblock",
creativeinventory: { "general": ["*"] },
"creativeinventory": { "general": ["*"] },
variantgroups: [
"variantgroups": [
{ code: "type", states: ["gold", "iron"] }
{ "code": "type", "states": ["gold", "iron"] }
],
],
blockmaterial: "Stone",
"blockmaterial": "Stone",
drawtype: "cube",
"drawtype": "cube",
textures: {
"textures": {
all: {  
"all": {  
base: "block/my{type}texture",
"base": "block/my{type}texture",
alternates: [{base: "block/my{type}texture1" }, {base: "block/my{type}texture2" }, {base: "block/my{type}texture3" }],
"alternates": [{"base": "block/my{type}texture1" }, {"base": "block/my{type}texture2" }, {"base": "block/my{type}texture3" }],
},
},
},
},
resistance: 3.5,
"resistance": 3.5,
sounds: {
"sounds": {
"place": "game:block/anvil",
"place": "game:block/anvil",
"walk": "game:walk/stone"
"walk": "game:walk/stone"
Confirmedusers
27

edits