Jump to content

How to create a forge .json file for meta items


winnetrie

Recommended Posts

Basically like this:

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L79-L88

IMetaLookup is just a helper interface on an the enum used to supply the variant items (also blocks) to make it easier to determine things about the variants.

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.

Link to comment
Share on other sites

I mean how would that .json file look like. I can make 16 different models for the items (16 .json files)

I know how to do that. I was wondering if i could also do it all in 1 file, just like the blocks.

 

I experimented with some stuff.

I have 16 different clayballs (items). i made a .json file in the blockstate folder for those items, just like i did for blocks. This works, but it makes cuboids of it, while i want it flat ofc.

 

It looks like this:

 

{
    "forge_marker": 1,
    "defaults": {
        "model": "minecraft:cube_all"
    },
    "variants": {
        "type": {
            "white": {
                "textures": {
                    "all": "tem:items/white_stained_clay_ball"
                }
            },
            "orange": {
                "textures": {
                    "all": "tem:items/orange_stained_clay_ball"
                }
            },
            "magenta": {
                "textures": {
                    "all": "tem:items/magenta_stained_clay_ball"
                }
            },
            "light_blue": {
                "textures": {
                    "all": "tem:items/light_blue_stained_clay_ball"
                }
            },
            "yellow": {
                "textures": {
                    "all": "tem:items/yellow_stained_clay_ball"
                }
            },
            "lime": {
                "textures": {
                    "all": "tem:items/lime_stained_clay_ball"
                }
            },
            "pink": {
                "textures": {
                    "all": "tem:items/pink_stained_clay_ball"
                }
            },
            "gray": {
                "textures": {
                    "all": "tem:items/gray_stained_clay_ball"
                }
            },
            "silver": {
                "textures": {
                    "all": "tem:items/silver_stained_clay_ball"
                }
            },
            "cyan": {
                "textures": {
                    "all": "tem:items/cyan_stained_clay_ball"
                }
            },
            "purple": {
                "textures": {
                    "all": "tem:items/purple_stained_clay_ball"
                }
            },
            "blue": {
                "textures": {
                    "all": "tem:items/blue_stained_clay_ball"
                }
            },
            "brown": {
                "textures": {
                    "all": "tem:items/brown_stained_clay_ball"
                }
            },
            "green": {
                "textures": {
                    "all": "tem:items/green_stained_clay_ball"
                }
            },
            "red": {
                "textures": {
                    "all": "tem:items/red_stained_clay_ball"
                }
            },
            "black": {
                "textures": {
                    "all": "tem:items/black_stained_clay_ball"
                }
            }
        }
    }
}

 

 

Ofc i know it will be a cuboid, because of this line:

"model": "minecraft:cube_all"

 

How do i get a flat item?

 

Link to comment
Share on other sites

I mean how would that .json file look like. I can make 16 different models for the items

 

{
    "forge_marker": 1,
    "defaults": {
        "model": "harderores:item/generated"
    },
    "variants": {
        "ore_type": {
            "iron":     {"textures": {"layer0": "harderores:items/irondust_sm"} },
            "gold":     {"textures": {"layer0": "harderores:items/golddust_sm"} },
            "flour":    {"textures": {"layer0": "harderores:items/flourdust_sm"} },
            "sugar":    {"textures": {"layer0": "harderores:items/sugardust_sm"} },
            "tin":      {"textures": {"layer0": "harderores:items/tindust_sm"} },
            "copper":   {"textures": {"layer0": "harderores:items/copperdust_sm"} },
            "lead":     {"textures": {"layer0": "harderores:items/leaddust_sm"} },
            "silver":   {"textures": {"layer0": "harderores:items/silverdust_sm"} },
            "nickel":   {"textures": {"layer0": "harderores:items/nickeldust_sm"} },
            "aluminum": {"textures": {"layer0": "harderores:items/aluminumdust_sm"} },
            "osmium":   {"textures": {"layer0": "harderores:items/osmiumdust_sm"} }
        }
    }
}

 

And you're not limited to 16, either.  "Osmium" there is meta-data value 24.

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.

Link to comment
Share on other sites

Blockstate folder

Take a look through my git repo

https://github.com/Draco18s/ReasonableRealism

 

Might want to go back to the Jul 28, 2016 commit, there's less stuff in there at that point.

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.

Link to comment
Share on other sites

Alright it works now

 

It looks like this now:

 

{
    "forge_marker": 1,
    "defaults": {
        "model": "tem:generated"
    },
    "variants": {
        "type": {
            "white": {
                "textures": {
                    "layer0": "tem:items/white_stained_clay_ball"
                }
            },
            "orange": {
                "textures": {
                    "layer0": "tem:items/orange_stained_clay_ball"
                }
            },
            "magenta": {
                "textures": {
                    "layer0": "tem:items/magenta_stained_clay_ball"
                }
            },
            "light_blue": {
                "textures": {
                    "layer0": "tem:items/light_blue_stained_clay_ball"
                }
            },
            "yellow": {
                "textures": {
                    "layer0": "tem:items/yellow_stained_clay_ball"
                }
            },
            "lime": {
                "textures": {
                    "layer0": "tem:items/lime_stained_clay_ball"
                }
            },
            "pink": {
                "textures": {
                    "layer0": "tem:items/pink_stained_clay_ball"
                }
            },
            "gray": {
                "textures": {
                    "layer0": "tem:items/gray_stained_clay_ball"
                }
            },
            "silver": {
                "textures": {
                    "layer0": "tem:items/silver_stained_clay_ball"
                }
            },
            "cyan": {
                "textures": {
                    "layer0": "tem:items/cyan_stained_clay_ball"
                }
            },
            "purple": {
                "textures": {
                    "layer0": "tem:items/purple_stained_clay_ball"
                }
            },
            "blue": {
                "textures": {
                    "layer0": "tem:items/blue_stained_clay_ball"
                }
            },
            "brown": {
                "textures": {
                    "layer0": "tem:items/brown_stained_clay_ball"
                }
            },
            "green": {
                "textures": {
                    "layer0": "tem:items/green_stained_clay_ball"
                }
            },
            "red": {
                "textures": {
                    "layer0": "tem:items/red_stained_clay_ball"
                }
            },
            "black": {
                "textures": {
                    "layer0": "tem:items/black_stained_clay_ball"
                }
            }
        }
    }
}

 

 

I also copied the generated.json file from minecraft over to my block model folder.

That way i can reference to it. If i put it in my item model folder he still keeps looking for it in the block model folder even when i do this:

"model": "tem:item/generated"

The game is then searching for tem:block/item/generated.json

To fix this i dragged the file to the block folder.

At least i think it's ok like this. If not plz tell me. For now it is all working for me.

Link to comment
Share on other sites

You can reference a vanilla model like any other model, but with either

minecraft

as the modid or leaving the modid empty (

"item/generated"

alone).

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/

Link to comment
Share on other sites

That way i can reference to it. If i put it in my item model folder he still keeps looking for it in the block model folder even when i do this:

"model": "tem:item/generated"

The game is then searching for tem:block/item/generated.json

To fix this i dragged the file to the block folder.

At least i think it's ok like this. If not plz tell me. For now it is all working for me.

 

Yes, I have one there, it works fine.

https://github.com/Draco18s/ReasonableRealism/tree/master/src/main/resources/assets/harderores/models/block/item

 

{
    "__comment": "Allows blockstates files to use basic item models",
    "parent": "minecraft:item/generated"
}

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.

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.