Stones & Bricks SLABS?

Started by KreatorB on Fri, 07/27/2018 - 00:06

Topic category: Advanced modding

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Stones & Bricks SLABS?
Fri, 07/27/2018 - 00:12 (edited)

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" }
            }
        }
    ]
}
 

Edited by KreatorB on Fri, 07/27/2018 - 00:12
Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
JSON files are the very last…
Fri, 07/27/2018 - 00:40

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.

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
that is easier said then…
Fri, 07/27/2018 - 00:47

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!

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I love how everyone that…
Wed, 08/01/2018 - 12:48

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!

 

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think you actually need a…
Wed, 08/01/2018 - 15:16

I think you actually need a 3rd block that is both the top and bottom

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
thanks. I have to play…
Wed, 08/01/2018 - 20:48

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

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
There is an easier way, but…
Sun, 08/05/2018 - 00:28

There is an easier way, but you would have to code. Try looking in a vanilla slab.

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
could you provide me with a…
Sun, 08/05/2018 - 00:57

could you provide me with a place to start looking? that would be nice. ;-)

Last seen on 21:52, 23. Jun 2020
Joined Jul 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
KreatorB: You can make It…
Sun, 08/05/2018 - 14:25

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

 

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
NICE, will look into that…
Sun, 08/05/2018 - 17:32

NICE, will look into that right now! ;-)

 

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
This is a great fix and idea…
Sun, 08/05/2018 - 17:54

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.. ;-)

Last seen on 21:52, 23. Jun 2020
Joined Jul 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
KreatorB you can, but tell…
Sun, 08/05/2018 - 22:28

KreatorB you can, but tell me first which version of mcreator do you use.

Last seen on 02:47, 25. Nov 2020
Joined May 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i am using 1.7.9. I tried…
Sun, 08/05/2018 - 22:42

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

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sorry, I have no idea how to…
Fri, 08/10/2018 - 17:37

Sorry, I have no idea how to use the code