Jump to content

[1.8] Subblocks only works with one json file. How to fix this?


Kander16

Recommended Posts

Hi,

 

I'm trying to create my own sapling blocks. I've tried to copy some of the code for the normal saplings. The thing I don't understand, is that it only works with one json file (Like sapling.json) while the base minecraft has multiple. To get different textures on different saplings, You'll need multiple json files.

I don't want all saplings to get an universal texture. I currently only have one json file for all saplings. Called "sapling.json".

I want to have multiple json files to work with, like "mango_sapling.json" and "olive_sapling.json" to get each different sapling another texture.

I see that the forge class files can work with multiple json files. They got "acacia_sapling.json, birch_sapling.json etc...". But how do I do that?

 

If you need more information I didn't give to you, just ask.

 

Thanks for helping!

Kander18

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Link to comment
Share on other sites

You need a blockstate file!

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

Yes I know, and I have that. But it's still not the same as forge does it. Forge has in the blockstates folder files like "acacia_sapling.json" (and not "sapling.json").

I got in my "sapling.json" file in the blockstates folder:

 

{
    "variants": {
        "stage=0,type=mango": { "model": "chef:mango_sapling" },
        "stage=1,type=mango": { "model": "chef:mango_sapling" },
        "stage=0,type=olive": { "model": "chef:olive_sapling" },
        "stage=1,type=olive": { "model": "chef:olive_sapling" }
    }
}

 

This works for the block that is placed, but the texture is universal in hand. (Models/item/sapling.json)

Creator of the Master Chef Mod and many more to come.

 

If I helped you, please click the 'thank you' button.

Link to comment
Share on other sites

This works for the block that is placed, but the texture is universal in hand. (Models/item/sapling.json)

 

You need to register a separate model for each metadata value of the

Item

using

ModelLoader.setCustomModelResourceLocation

.

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.

Link to comment
Share on other sites

Also, I don't know why you'd want a separate file for each variant. So much nicer to have one json file.

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

Using the Forge Blockstate format you can specify a texture for each model based on metadata.

There are plenty of tutorials on how to use it.

However, as it sits update to 1.10.2+ if you want more help.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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