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

Hey everyone,


I tried my hand at some X and Z rotating to save myself a bunch of models on my connected model, but it seems "z": 90 doesn't to anything. "x":90 works just fine and so does "y":90, but z seems to be completely ignored. Why could this be and how can I fix it?

Here's my BlockState (it's a long one):

{
  "forge_marker": 1,
  "variants": {
    "normal": [
      {"model": "kaidencraft:boilertank/single.obj"}
    ],
    "inventory": [
      {}
    ],
    "mb_part": {
      "single": {
        "model": "kaidencraft:boilertank/single.obj"
      },
      "end": {
        "model": "kaidencraft:boilertank/pillar_bottom.obj",
        "x": 90
      },
      "line_edge": {
        "model": "kaidencraft:boilertank/pillar_center.obj",
        "z": 90
      },
      "corner": {
        "model": "kaidencraft:boilertank/end.obj",
        "z": 90
      },
      "edge": {
        "model": "kaidencraft:boilertank/edge_single.obj"
      },
      "center": {
        "model": "kaidencraft:boilertank/center_single.obj"
      },
      "bottom_end": {
        "model": "kaidencraft:boilertank/end.obj"
      },
      "bottom_edge": {
        "model": "kaidencraft:boilertank/edge.obj"
      },
      "bottom_corner": {
        "model": "kaidencraft:boilertank/corner.obj"
      },
      "bottom_center": {
        "model": "kaidencraft:boilertank/center_top.obj",
        "x": 180
      },
      "bottom_pillar": {
        "model": "kaidencraft:boilertank/pillar_bottom.obj"
      },
      "center_end": {
        "model": "kaidencraft:boilertank/edge_single.obj",
        "x": 90, "z": 90
      },
      "center_corner": {
        "model": "kaidencraft:boilertank/edge.obj",
        "z": 90,
        "x": 90
      },
      "center_edge": {
        "model": "kaidencraft:boilertank/center_top.obj",
        "x": 270
      },
      "center_line_edge": {
        "model": "kaidencraft:boilertank/center_single.obj",
        "x": 90
      },
      "center_pillar": {
        "model": "kaidencraft:boilertank/pillar_center.obj"
      },
      "top_end": {
        "model": "kaidencraft:boilertank/end.obj",
        "z": 180
      },
      "top_corner": {
        "model": "kaidencraft:boilertank/corner.obj",
        "x": 180
      },
      "top_edge": {
        "model": "kaidencraft:boilertank/edge.obj",
        "x": 90
      },
      "top_line_edge": {
        "model": "kaidencraft:boilertank/edge_single.obj",
        "x": 90
      },
      "top_pillar": {
        "model": "kaidencraft:boilertank/pillar_bottom.obj",
        "x": 180
      },
      "top_center": {
        "model": "kaidencraft:boilertank/center_top.obj"
      },
      "hidden": {
        "model": "kaidencraft:blank.obj"
      }
    },
    "facing": {
      "north": {},
      "south": {
        "y": 180
      },
      "west": {
        "y": 270
      },
      "east": {
        "y": 90
      }
    }
  },
  "defaults": {
    "model": "kaidencraft:boilertank/single.obj",
    "textures": {
      "#initialShadingGroup": "kaidencraft:block/boiler_main"
    }
  }
}

The part I'm testing with is "corner", which rotates fine when I put in an x rotation, but does nothing when I put in various z rotations.

Cheers in advance

 

Edit for posterity: You can get any transforms you want using forge specific BlockState parts - see Forge Blockstate V1 specs for all details. Only the last specified transform will be applied - this includes simple rotation like you would use in a facing variant.

Edited by BenignBanana

Minecraft and Forge didn't add the "z" rotation tag because you can replicate it with a combination of the "x" and "y" tag.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author
Just now, larsgerrits said:

Minecraft and Forge didn't add the "z" rotation tag because you can replicate it with a combination of the "x" and "y" tag.

Can you tell me how to do that specifically? I'm terrible at 3D visualization and vector math. Also, would the y rotation work additively with the facing?

I haven't done this in a while, but I think that if you set the "y" tag to 90, any rotation on the x-axis will apply to the z-axis instead.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

  • Author
6 minutes ago, larsgerrits said:

I haven't done this in a while, but I think that if you set the "y" tag to 90, any rotation on the x-axis will apply to the z-axis instead.

Yea I figured that out now with some hand moving and loading a test object into Maya :P But I'm still struggling to understand how that will interact with the facing property that I use for Y rotation.

  • Author

Yea this definitely doesn't work. After recreating the BlockState scenarios in Maya it seems that Y is always applied after X, making this trick impossible. Applying y 270 first, then x 90 gives me the correct result in Maya (as it should), but what I see in Minecraft is equivalent to applying x 90 first, then y 270. This is what I did in my JSON:

      "corner": {
        "model": "kaidencraft:boilertank/end.obj",
        "y": 270, "x": 90
      },

 

Edited by BenignBanana

Probably not.

Minecraft does not encode a z-axis rotation as it treats it identically to an x-axis rotation.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Yea I looked at the ModelRotation code. That's some of the most inflexible code I've ever seen. Guess I'll just have to bake it in then. Anyways, thanks for the help.

  • Author

Just posting one last update here for anyone who sees this in the future. Turns out there IS a way to rotate around the Z axis, it's just really hard to find. I stumbled upon it after googling for blockstate transforms (as in moving the model). See Forge Blockstate V1 specs for all the details. Do keep in mind that any Y rotation you may do in a facing variant will override these transforms.

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.