Jump to content

[1.9.4] Blockstate JSON Question


LogicTechCorp

Recommended Posts

See this page for an explanation of sub-models in Forge's blockstates format.

 

I also have an example of the format here. This is a BuildCraft-style pipe composed of two individual models: the centre cube and the side attachment. The cube is used as a base model and the side attachment is added as a sub-model rotated as necessary.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Isn't that exactly what is described in the Sub-Models section of the blockstate documentation?

See this page for an explanation of sub-models in Forge's blockstates format.

 

I also have an example of the format here. This is a BuildCraft-style pipe composed of two individual models: the centre cube and the side attachment. The cube is used as a base model and the side attachment is added as a sub-model rotated as necessary.

 

I followed that but my model does not display correctly.

 

Forge Blockstate:

{
  "forge_marker": 1,
  "defaults": {
    "transform": "forge:default-block"
  },
  "variants": {
    "normal": [
      {
        "model": "nex:fingers_plant"
      }
    ],
    "north": {
      "true": {
        "model": "nex:fingers_plant_side"
      },
      "false": {
        "submodel": {
            "noside0": { "model": "nex:fingers_plant_noside", "weight": 6 },
            "noside1": { "model": "nex:fingers_plant_noside1" },
            "noside2": { "model": "nex:fingers_plant_noside2" },
            "noside3": { "model": "nex:fingers_plant_noside3" }
        }
      }
    },
    "east": {
      "true": {
        "model": "nex:fingers_plant_side", "y": 90, "uvlock": true
      },
      "false": {
        "submodel": {
          "noside4": { "model": "nex:fingers_plant_noside1", "y": 90, "uvlock": true },
          "noside5": { "model": "nex:fingers_plant_noside2", "y": 90, "uvlock": true },
          "noside6": { "model": "nex:fingers_plant_noside3", "y": 90, "uvlock": false },
          "nosid7": { "model": "nex:fingers_plant_noside", "weight": 6, "y": 90, "uvlock": true }
        }
      }
    },
    "south": {
      "true": {
        "model": "nex:fingers_plant_side", "y": 180, "uvlock": true
      },
      "false": {
        "submodel": {
          "noside8": { "model": "nex:fingers_plant_noside2", "y": 180, "uvlock": true },
          "noside9": { "model": "nex:fingers_plant_noside3", "y": 180, "uvlock": false },
          "noside10": { "model": "nex:fingers_plant_noside", "weight": 6, "y": 180, "uvlock": true },
          "noside11": { "model": "nex:fingers_plant_noside1", "y": 180, "uvlock": true }
        }
      }
    },
    "west": {
      "true": {
        "model": "nex:fingers_plant_side", "y": 270, "uvlock": true
      },
      "false": {
        "submodel": {
          "noside12":{ "model": "nex:fingers_plant_noside3", "y": 270, "uvlock": false },
          "noside13":{ "model": "nex:fingers_plant_noside", "weight": 6, "y": 270, "uvlock": true },
          "noside14":{ "model": "nex:fingers_plant_noside1", "y": 270, "uvlock": true },
          "noside15":{ "model": "nex:fingers_plant_noside2", "y": 270, "uvlock": true }
        }
      }
    },
    "up": {
      "true": {
        "model": "nex:fingers_plant_side", "x": 270, "uvlock": true
      },
      "false": {
        "submodel": {
          "nosidev0": { "model": "nex:fingers_plant_noside_v1", "x": 270, "uvlock": false },
          "nosidev1": { "model": "nex:fingers_plant_noside_v1", "x": 270, "y": 90, "uvlock": false },
          "nosidev2": { "model": "nex:fingers_plant_noside_v1", "x": 270, "y": 180, "uvlock": false },
          "nosidev3": { "model": "nex:fingers_plant_noside_v2", "x": 270, "uvlock": false }
        }
      }
    },
    "down": {
      "true": {
        "model": "nex:fingers_plant_side", "x": 90, "uvlock": true
      },
      "false": {
        "submodel": {
          "nosidev4": { "model": "nex:fingers_plant_noside_v1", "x": 90, "uvlock": false },
          "nosidev5": { "model": "nex:fingers_plant_noside_v1", "x": 90, "y": 180, "uvlock": false },
          "nosidev6": { "model": "nex:fingers_plant_noside_v2", "x": 90, "uvlock": false },
          "nosidev7": { "model": "nex:fingers_plant_noside_v2", "x": 90, "y": 90,  "uvlock": false }
        }
      }
    }
  }
}

 

Vanilla Blockstate:

{
  "multipart": [
    {"when": { "north": true },
      "apply": { "model": "nex:fingers_plant_side" }
    },
    {   "when": { "east": true },
      "apply": { "model": "nex:fingers_plant_side", "y": 90, "uvlock": true }
    },
    {   "when": { "south": true },
      "apply": { "model": "nex:fingers_plant_side", "y": 180, "uvlock": true }
    },
    {   "when": { "west": true },
      "apply": { "model": "nex:fingers_plant_side", "y": 270, "uvlock": true }
    },
    {   "when": { "up": true },
      "apply": { "model": "nex:fingers_plant_side", "x": 270, "uvlock": true }
    },
    {   "when": { "down": true },
      "apply": { "model": "nex:fingers_plant_side", "x": 90, "uvlock": true }
    },
    {   "when": { "north": false },
      "apply": [
        { "model": "nex:fingers_plant_noside", "weight": 6 },
        { "model": "nex:fingers_plant_noside1" },
        { "model": "nex:fingers_plant_noside2" },
        { "model": "nex:fingers_plant_noside3" }
      ]
    },
    {   "when": { "east": false },
      "apply": [
        { "model": "nex:fingers_plant_noside1", "y": 90, "uvlock": true },
        { "model": "nex:fingers_plant_noside2", "y": 90, "uvlock": true },
        { "model": "nex:fingers_plant_noside3", "y": 90, "uvlock": false },
        { "model": "nex:fingers_plant_noside", "weight": 6, "y": 90, "uvlock": true }
      ]
    },
    {   "when": { "south": false },
      "apply": [
        { "model": "nex:fingers_plant_noside2", "y": 180, "uvlock": true },
        { "model": "nex:fingers_plant_noside3", "y": 180, "uvlock": false },
        { "model": "nex:fingers_plant_noside", "weight": 6, "y": 180, "uvlock": true },
        { "model": "nex:fingers_plant_noside1", "y": 180, "uvlock": true }
      ]
    },
    {   "when": { "west": false },
      "apply": [
        { "model": "nex:fingers_plant_noside3", "y": 270, "uvlock": false },
        { "model": "nex:fingers_plant_noside", "weight": 6, "y": 270, "uvlock": true },
        { "model": "nex:fingers_plant_noside1", "y": 270, "uvlock": true },
        { "model": "nex:fingers_plant_noside2", "y": 270, "uvlock": true }
      ]
    },
    {   "when": { "up": false },
      "apply": [
        { "model": "nex:fingers_plant_noside_v1", "x": 270, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v1", "x": 270, "y": 90, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v1", "x": 270, "y": 180, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 270, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 270, "y": 180, "uvlock": false }
      ]
    },
    {   "when": { "down": false },
      "apply": [
        { "model": "nex:fingers_plant_noside_v1", "x": 90, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v1", "x": 90, "y": 180, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 90, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 90, "y": 90,  "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 90, "y": 180, "uvlock": false },
        { "model": "nex:fingers_plant_noside_v2", "x": 90, "y": 270, "uvlock": false }
      ]
    }]
}

Link to comment
Share on other sites

I don't see any obvious errors.

 

Post your models and describe (possibly with screenshots) how it's not displaying correctly.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Vanilla's JSON format has improved in 1.9. Just go with it unless you have some awesome variant to add to what you've already shown.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.