Question about custom blockstates

Status
Resolved
Issue description

I figured I would ask here as this could help more people in the long run with an awesome for this question then sending off an email.

So I have been getting a lot of requests for a door and I have done some digging and around for the files for the door specifically and I know blockstates are used for the rotation for the block say while models are just the physical properties of what is displayed.

Now giving that no files are overwritten by the editor when compiling the elements could one say copy the model and blockstate properties of the door listed below and update the files imported and generated to make a custom door?

acacia_door.json (blockstate)

{
    "variants": {
        "facing=east,half=lower,hinge=left,open=false":  { "model": "acacia_door_bottom" },
        "facing=south,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom", "y": 90 },
        "facing=west,half=lower,hinge=left,open=false":  { "model": "acacia_door_bottom", "y": 180 },
        "facing=north,half=lower,hinge=left,open=false": { "model": "acacia_door_bottom", "y": 270 },
        "facing=east,half=lower,hinge=right,open=false":  { "model": "acacia_door_bottom_rh" },
        "facing=south,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh", "y": 90 },
        "facing=west,half=lower,hinge=right,open=false":  { "model": "acacia_door_bottom_rh", "y": 180 },
        "facing=north,half=lower,hinge=right,open=false": { "model": "acacia_door_bottom_rh", "y": 270 },
        "facing=east,half=lower,hinge=left,open=true":  { "model": "acacia_door_bottom_rh", "y": 90 },
        "facing=south,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh", "y": 180 },
        "facing=west,half=lower,hinge=left,open=true":  { "model": "acacia_door_bottom_rh", "y": 270 },
        "facing=north,half=lower,hinge=left,open=true": { "model": "acacia_door_bottom_rh" },
        "facing=east,half=lower,hinge=right,open=true":  { "model": "acacia_door_bottom", "y": 270 },
        "facing=south,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom" },
        "facing=west,half=lower,hinge=right,open=true":  { "model": "acacia_door_bottom", "y": 90 },
        "facing=north,half=lower,hinge=right,open=true": { "model": "acacia_door_bottom", "y": 180 },
        "facing=east,half=upper,hinge=left,open=false":  { "model": "acacia_door_top" },
        "facing=south,half=upper,hinge=left,open=false": { "model": "acacia_door_top", "y": 90 },
        "facing=west,half=upper,hinge=left,open=false":  { "model": "acacia_door_top", "y": 180 },
        "facing=north,half=upper,hinge=left,open=false": { "model": "acacia_door_top", "y": 270 },
        "facing=east,half=upper,hinge=right,open=false":  { "model": "acacia_door_top_rh" },
        "facing=south,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh", "y": 90 },
        "facing=west,half=upper,hinge=right,open=false":  { "model": "acacia_door_top_rh", "y": 180 },
        "facing=north,half=upper,hinge=right,open=false": { "model": "acacia_door_top_rh", "y": 270 },
        "facing=east,half=upper,hinge=left,open=true":  { "model": "acacia_door_top_rh", "y": 90 },
        "facing=south,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh", "y": 180 },
        "facing=west,half=upper,hinge=left,open=true":  { "model": "acacia_door_top_rh", "y": 270 },
        "facing=north,half=upper,hinge=left,open=true": { "model": "acacia_door_top_rh" },
        "facing=east,half=upper,hinge=right,open=true":  { "model": "acacia_door_top", "y": 270 },
        "facing=south,half=upper,hinge=right,open=true": { "model": "acacia_door_top" },
        "facing=west,half=upper,hinge=right,open=true":  { "model": "acacia_door_top", "y": 90 },
        "facing=north,half=upper,hinge=right,open=true": { "model": "acacia_door_top", "y": 180 }
    }
}

Doors have four models two bottom for open and close and two top for open and close. They are listed below.

acacia_door_bottom.json (model)

{
    "parent": "block/door_bottom",
    "textures": {
        "bottom": "blocks/door_acacia_lower",
        "top": "blocks/door_acacia_upper"
    }
}

door_bootom.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#bottom"
    },
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 3, 16, 16 ],
            "faces": {
                "down":  { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
                "north": { "uv": [  3, 0,  0, 16 ], "texture": "#bottom", "cullface": "north" },
                "south": { "uv": [  0, 0,  3, 16 ], "texture": "#bottom", "cullface": "south" },
                "west":  { "uv": [  0, 0, 16, 16 ], "texture": "#bottom", "cullface": "west" },
                "east":  { "uv": [ 16, 0,  0, 16 ], "texture": "#bottom" }
            }
        }
    ]
}

- - - - -

acacia_door_bottom_rh.json (model)

{
    "parent": "block/door_bottom_rh",
    "textures": {
        "bottom": "blocks/door_acacia_lower",
        "top": "blocks/door_acacia_upper"
    }
}

 

door_bottom_rh.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#bottom"
    },
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 3, 16, 16 ],
            "faces": {
                "down":  { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
                "north": { "uv": [  3, 0,  0, 16 ], "texture": "#bottom", "cullface": "north" },
                "south": { "uv": [  0, 0,  3, 16 ], "texture": "#bottom", "cullface": "south" },
                "west":  { "uv": [ 16, 0,  0, 16 ], "texture": "#bottom", "cullface": "west" },
                "east":  { "uv": [  0, 0, 16, 16 ], "texture": "#bottom" }
            }
        }
    ]
}

 

- - - - -

 

acacia_door_top.json (model)

{
    "parent": "block/door_top",
    "textures": {
        "bottom": "blocks/door_acacia_lower",
        "top": "blocks/door_acacia_upper"
    }
}

 

door_top.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#top"
    },
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 3, 16, 16 ],
            "faces": {
                "up":    { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "up" },
                "north": { "uv": [  3, 0,  0, 16 ], "texture": "#top", "cullface": "north" },
                "south": { "uv": [  0, 0,  3, 16 ], "texture": "#top", "cullface": "south" },
                "west":  { "uv": [  0, 0, 16, 16 ], "texture": "#top", "cullface": "west" },
                "east":  { "uv": [ 16, 0,  0, 16 ], "texture": "#top" }
            }
        }
    ]
}

 

- - - - -

 

acacia_door_top_rh.json (model)

{
    "parent": "block/door_top_rh",
    "textures": {
        "bottom": "blocks/door_acacia_lower",
        "top": "blocks/door_acacia_upper"
    }
}

 

door_top_rh.json

{
    "ambientocclusion": false,
    "textures": {
        "particle": "#top"
    },
    "elements": [
        {   "from": [ 0, 0, 0 ],
            "to": [ 3, 16, 16 ],
            "faces": {
                "up":    { "uv": [ 13, 0, 16, 16 ], "texture": "#bottom", "cullface": "up" },
                "north": { "uv": [  3, 0,  0, 16 ], "texture": "#top", "cullface": "north" },
                "south": { "uv": [  0, 0,  3, 16 ], "texture": "#top", "cullface": "south" },
                "west":  { "uv": [ 16, 0,  0, 16 ], "texture": "#top", "cullface": "west" },
                "east":  { "uv": [  0, 0, 16, 16 ], "texture": "#top" }
            }
        }
    ]
}

 

To recap I am wondering if I can just change some things in the json blockstate to work with renamed models and textures, what would need to be done exactly to get a working door with these files.

I am aware that the file that I will need to use for the model file is the base door file or aka the file that acacia is a child of.
from what I can read in the blockstate the model name will need to be pointed to the new model name but will the rest work fine?

Anyhow hopefully this made sense and will be able to help others in a future tutorial if I can get this working right. this would be a far easier way to make a door than what I was going to end up doing a tutorial on and I have not had the time until now to look at the files to check to see what Mojang did to make doors.

I am looking forward to your reply and I looking forward to Monday working on the next tutorial for MCreator ;)
Talk to you soon.

Cheers

Issue comments

You would need to add some new JSON files which is not possible, yet, but we will add this.

Your idea is essentially what block bases do, so it is fine.

You would need to edit Java code too, at least change extending block class to BlockDoor, but possibly more things might be required.

Hope this helps :)

This does help a tone thank you.

I think it would be easier than for just updating the blocks using procedures for a tutorial, not to much work more than I was hoping for but Minecraft is complex, I guarantee that without MCreator many people would not be making mods due to how complex Minecraft and Java is for beginners :)

Okay scratch that, I accidentally made some progress. This would be impossible with MCreator because as Klemen says you'd need 4 json model files but using the trapdoor block base, you can edit the information in the Java File, basically removing the "Trap" from everything. The block states are an easy copy/paste so now we have 4 json files and we need 4 json files. Almost everything works but this is where I need your help because unfortunately I am unable to to display textures on the door even thought the model bounding box shows up and works. I think that's because the name of the Json files is still the same and I can't seem to edit it so I was wondering if you had any thoughts on that?

You can open project browser on the left side and add json file into any folder you want by pressing + button in the project browser.