Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Is it possible to define a variant for a block inside of another variant using the Forge Blockstate JSON?

 

As an example, I'm adding custom stairs to Minecraft, but in order to allow inner stairs and outer stairs the y needs to change based on which direction the stair block is facing AND which type of stairs it is (inner, outer, or straight).

 

Is it possible to define this using the Forge Blockstate JSON?

 

(Here's the JSON i'm currently using which doesn't rotate the block correctly for inner stairs:

Spoiler

{
  "forge_marker": 1,
  "defaults": {
    "textures": {
      "bottom": "blocks/glass",
      "top": "blocks/glass",
      "side": "blocks/glass"
    },
    "model": "expanded:stairs/stairs_alternate",
    "uvlock": true
  },
  "variants": {
    "inventory": {
      "model": "expanded:stairs/stairs_alternate"
    },
    "facing": {
      "north": {
        "y": 270
      },
      "east": {
        "y": 0
      },
      "south": {
        "y": 90
      },
      "west": {
        "y:": 180
      }
    },
    "half": {
      "bottom": {
        "x": 0
      },
      "top": {
        "x": 180
      }
    },
    "shape": {
      "straight": {
        "model": "expanded:stairs/stairs_alternate"
      },
      "outer_right": {
        "model": "expanded:stairs/stairs_alternate_outer"
      },
      "outer_left": {
        "model": "expanded:stairs/stairs_alternate_outer"
      },
      "inner_right": {
        "model": "expanded:stairs/stairs_alternate_inner"
      },
      "inner_left": {
        "model": "expanded:stairs/stairs_alternate_inner"
      }
    }
  }
}

 

 

Forge's blockstates format only allows you to specify the effects of individual property values or fully-defined variants, you can't specify the effects of a subset of properties (e.g. two of three properties).

 

You also can't specify the x and y rotation separately, if you specify one then the other will be 0 for that variant.

 

You could use an IStateMapper to have a different blockstates file for each value of one of the properties or use Vanilla's multipart blockstates format; but I think you may be best off with a single Forge blockstates file with fully-defined variants.

Edited by Choonster

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.