Topic category: Advanced modding
Hello all I am in the middle of adding slabs to my mod. the lower part is not the issue it is the upper part that is giving me problems.
I know that if I create the slabs as to seprate blocks an upper and lower it works fine but i can not get them to snap together like MC blocks do!
But I was wondering if someone knew how to get the code to have it snap together as one block?
here is what I did with my JSONs
a LOWER & a UPPER file
{ "parent": "block/block",
"textures": {
"particle": "#side"
},
"elements": [
{ "from": [ 0, 0, 0 ],
"to": [ 16, 8, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
"north": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "north" },
"south": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "south" },
"west": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "west" },
"east": { "uv": [ 0, 8, 16, 16 ], "texture": "#side", "cullface": "east" }
}
}
]
}
{ "parent": "block/block",
"textures": {
"particle": "#side"
},
"elements": [
{ "from": [ 0, 8, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top", "cullface": "up" },
"north": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "north" },
"south": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "south" },
"west": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "west" },
"east": { "uv": [ 0, 0, 16, 8 ], "texture": "#side", "cullface": "east" }
}
}
]
}
JSON files are the very last thing you have to care about at this matter. You need two classes that both extend BlockSlab (or a child of BlockSlab). I recommend you to make your own parent class for them, as it will make any control of it easier. One of these classes is for the full block, the second is for both half variants. The half slab one needs to have a property, that will indicate the if it is the upper or lower. Also, you have to make your own ItemBlock instance/class and register all of them. The JSON file of the full variant should be pretty much the same, for the half slab one you have to check what variant is it.
that is easier said then done can you point me in a direction with a link to find how to create the class and the instances.
It sounds simple coming from what you say but I have no Idea where to begin!
I love how everyone that answers your questions assumes you know how to program in java! Its funny they tell you what to do but with no insight or direction... What people forget to consider is that if we knew how to do this stuff(programming) we would not use MCreator!
I think you actually need a 3rd block that is both the top and bottom
thanks. I have to play around with it. I have the lower slab, the block and just need to put the upper slab in place. but do not know how to call the option of when the direct the the slab above or below to place those slabs. Let alone figure out how to code the classes. the crazy part is that you have to create all those blocks and recipes first. there has to be an easier way.... thanks
There is an easier way, but you would have to code. Try looking in a vanilla slab.
could you provide me with a place to start looking? that would be nice. ;-)
KreatorB:
You can make It work with procedures/events much like this:
By example, the block that its the lower slab, you can set an stack events in whenclickedonblock field
And you set to placed an complete block and consume the upper slab block, but remember to fill the field condition with when the player has an ítem un its hand and set It to your upper slab
NICE, will look into that right now! ;-)
This is a great fix and idea, but means I still need to create a upper slab and recipe for it... WHICH sucks, however I am seeing if I can get it working.. Very long and time consuming for 1000;s of blocks. Will test and see what happens. thanks for the GREAT IDEA - Would love if they had a way to hide blocks from the inventory.. ;-)
KreatorB you can, but tell me first which version of mcreator do you use.
i am using 1.7.9. I tried the procedure system but always get the full block placing on top of the slab. LOL I am so lost with these things.... LOL
Sorry, I have no idea how to use the code