Jump to content

How do I create a block with different textures on each side


Elite_Puddle

Recommended Posts

Im able to create a block with the same texture on every side but I can't figure out why my json's won't create a block with unique textures on the north and south sides.

I can't find any good examples online or in the forge project.

 

Code

"

{
    "parent": "block/cube_all",
    "textures": {
        "all": "minecraftedu:block/edu_default_block"
        "north": "minecraftedu:block/not_block"
        "south": "minecraftedu:block/not_block"
    }
}

"

"

{
    "variants": {
        "": { "model": "minecraftedu:block/edu_default_block" }
        "north": { "model": "minecraftedu:block/not_block" }
        "south": { "model": "minecraftedu:block/not_block" }
    }
}

"

Link to comment
Share on other sites

1 minute ago, Ugdhar said:

The minecraft wiki has a good breakdown of the model json format:

https://minecraft.gamepedia.com/Model#Block_models

 

Also, check the vanilla model files for things with different faces to see how they did it. The vanilla sources are a very good reference, and should be viewable through your IDE.

where are they, ive been looking for hours and can only find the classes

Link to comment
Share on other sites

I've tried what the link you posted suggested and it's still not working

 

{
    "parent": "block/cube_all",
    "textures": {
        "all":  "minecraftedu:block/not_block"
    },
    "elements": [
        {
            "from": [ 0, 0, 0 ],
            "to": [ 16, 16, 16 ],
            "faces": {
                "down": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "down" },
                "up": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "up" },
                "north": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "north" },
                "south": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "south" },
                "west": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "west" },
                "east": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "east" },
            }
        }
    ]
}

 

Link to comment
Share on other sites

Did you find the client-extra.jar? Look at the json for the crafting table as an example.

That's what I would do if I were trying to do what you are doing.

 

What is working/not working? (be specific) If you're getting missing textures (black/purple squares), you should also post logs so it shows what it is looking for.

Edited by Ugdhar
Link to comment
Share on other sites

57 minutes ago, Elite_Puddle said:

"parent": "block/cube_all"

You see this bit? This bit points to another json file that defines the six sides. Check out all of the other "cube_xxx.json" assets (including cube.json)

 

And oh yeah,

57 minutes ago, Elite_Puddle said:

            "faces": {
                "down": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "down" },
                "up": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "up" },
                "north": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "north" },
                "south": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "south" },
                "west": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "west" },
                "east": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "east" },
            }

That's pretty much exactly what cube_all defines and guess what that definition is? One texture on all sides.

 

So of course what you did didn't work because you told the game "I want one texture on all the sides."

Edited by Draco18s

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.



×
×
  • Create New...

Important Information

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