Jump to content

Forge Blockstate Variant syntax


TaeoG

Recommended Posts

Hi there,

 

Is it possible to mix the property definition and variant definition syntax in a Forge Blockstate?

For example, I have a block that has three properties: 

  1. Boolean "outer"
  2. Boolean "inner"
  3. Integer "state", from 0 to 4

The block model it corresponds to has a base texture, and an overlay texture.

The base texture is one of two textures and is chosen by the "inner" property alone

The overlay texture, however, can be one of 10 possible options, which is chosen by combining the "outer" and "state" properties
As I understand it, Forge Blockstates have two syntax, either by defining each property independent of each other 
 

{
    "forge_marker": 1,
    "defaults" : {
        "textures": {
            "outerTex": "mod:blocks/out_default",
            "innerTex": "mod:blocks/in_default"
        },
        "model": "mod:blockmodel"
    },
    "variants": {
        "outer": {
            "true": {},
            "false": {}
        },
        "inner": {
           "true": {
                "innerTex": "mod:blocks/in_other"
           },
          "false" : {}
        }
        "state": {
            "0": {},
            "1": {},
            "2": {},
            "3": {},
            "4": {}
        }
    }
}

or by defining variants individually

{
    "forge_marker": 1,
    "defaults" : {
        "textures": {
            "outerTex": "mod:blocks/out_default",
            "innerTex": "mod:blocks/in_default"
        },
        "model": "mod:blockmodel"
    },
    "variants": {
        "[outer=true, inner=true, state=0]": [{}],
        "[outer=true, inner=false, state=1]": [{}],  
        //etc etc, not really certain of the syntax for this type of declaration
    }
}


Is it possible to combine these somehow to allow me to define "[outer=x, state=y]" variants, and have the "inner" property defined by itself, and let forge combine those in the background?

Link to comment
Share on other sites

hmmm, the forge docs for 1.15 mention the Forge Blockstate format in passing, but I now see that link on that page is broken.

Let me rephrase the question then, how would I achieve this with the multipart format, or another format? I avoided multipart because it doesn't look like I can set the textures in the blockstate file

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.