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

Here is the blockstate file:

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/dirt"
        }
    },
    "variants": {
        "layers": {
            "1": {
                "model": "ml:layer_2"
            },
            "2": {
                "model": "ml:layer_4"
            },
            "3": {
                "model": "ml:layer_6"
            },
            "4": {
                "model": "ml:layer_8"
            },
            "5": {
                "model": "ml:layer_10"
            },
            "6": {
                "model": "ml:layer_12"
            },
            "7": {
                "model": "ml:layer_14"
            },
            "8": {
                "model": "ml:layer_16"
            }
        },
        "inventory": [{
            "model": "ml:layer_2",
            "textures": {
                "all": "blocks/dirt"
            },
            "transform": {
                "display": {
                    "gui": {
                        "rotation": [30, 225, 0],
                        "translation": [0, 0, 0],
                        "scale": [0.625, 0.625, 0.625]
                    },
                    "ground": {
                        "rotation": [0, 0, 0],
                        "translation": [0, 3, 0],
                        "scale": [0.25, 0.25, 0.25]
                    },
                    "firstperson_righthand": {
                        "rotation": [0, 45, 0],
                        "translation": [0, 4.2, 0],
                        "scale": [0.40, 0.40, 0.40]
                    },
                    "firstperson_lefthand": {
                        "rotation": [0, 225, 0],
                        "translation": [0, 4.2, 0],
                        "scale": [0.40, 0.40, 0.40]
                    }
                }
            }
        }]
    }
}

Why doesn't this load correctly? It gives the error: [12:53:03] [main/ERROR] [FML]: Exception loading model for variant ml:dirt_layer#inventory for item "ml:dirt_layer", normal location exception

 

Removing the inventory part makes it load again.

 

Thankful for all help!

 

Edited by MCrafterzz

The "transform" tag applies to models.

Blockstate files are not models.

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.

You can specify display transformations in Forge's blockstates format, but not in the Vanilla model format like you're doing.

 

I explain how to do this here.

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.

  • Author

Thanks Choonster, I did change it but it seems to ignore everything except the gui part:

{
    "forge_marker": 1,
    "defaults": {
        "textures": {
            "all": "blocks/dirt"
        }
    },
    "variants": {
        "layers": {
            "1": {
                "model": "ml:layer_2"
            },
            "2": {
                "model": "ml:layer_4"
            },
            "3": {
                "model": "ml:layer_6"
            },
            "4": {
                "model": "ml:layer_8"
            },
            "5": {
                "model": "ml:layer_10"
            },
            "6": {
                "model": "ml:layer_12"
            },
            "7": {
                "model": "ml:layer_14"
            },
            "8": {
                "model": "ml:layer_16"
            }
        },
        "inventory": [{
            "model": "ml:layer_2",
            "transform": {
                "gui": {
                    "rotation": [{
                        "x": 30
                    }, {
                        "y": 225
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 0, 0],
                    "scale": 0.625
                },
                "ground": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 0
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 3, 0],
                    "scale": 0.1
                },
                "firstperson_righthand": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 45
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 4.2, 0],
                    "scale": 0.1
                },
                "firstperson_lefthand": {
                    "rotation": [{
                        "x": 0
                    }, {
                        "y": 225
                    }, {
                        "z": 0
                    }],
                    "translation": [0, 4.2, 0],
                    "scale": 0.1
                }
            }
        }]
    }
}

 

The scale is 0.1 but it's still much larger than any other block

I'm not too sure, that looks right to me. Are you getting any errors in the log?

 

Try stepping through ForgeBlockStateV1.Variant.Deserializer#deserialize to see if it's recognising your transforms.

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.

  • Author

I'm not getting any errors and after changing some values it does seem to work. I just need to continue changing values it hopefully will be good. It's totally guess work so it'll take a while.

 

EDIT: I tried converting the values with code:

Main.logger.warn(new TRSRTransformation(new ItemTransformVec3f(new Vector3f(0, 45, 0), new Vector3f(0, 4.2f, 0), new Vector3f(0.4f,0.4f,0.4f))).getTranslation());

 

But it just printed out the same values as in the constructor :C

Edited by MCrafterzz

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.