Jump to content

What is the Proper Way for Subblocks


Recommended Posts

As the topic states, what is the proper way for the subblocks? I have a block which changes facing and I'm trying to create subblocks of it for each vanilla wood type. So, 4 directions and 6 wood types result in 24 different metadata. But as far as I know, metadata only support up to 16.

I can think of two ways to solve it:

1 - I can separate them like logs, which results in 2 different blocks, first for oak, spruce, birch, jungle and second for acacia and dark oak.
2 - I can create a unique block for each wood variant and save the metadata for only facing.

I'm interested in brief explanations of why one would be better than the other.

Also, if you have a more proper than both of the ways, I would like to hear it. Thanks in advance.

Link to comment
Share on other sites

Separating them into 2 blocks creates a lot of confusion since your will have 2 meaningless blocks (BlockThingOne and BlockThingTwo). That said this way is pretty good if you want to save on block ids.

Creating a unique block for each variant is a more intuitiva approach. This is also how variants function in 1.13. So this approach will allow you to update your mod to 1.13 easier and is more intuitive but it's less conservative on block ids.

Alternatively you can store all your variants in a single block by using a TileEntity. Since TEs can be non-tickable now this approach is also viable.

  • Like 1
Link to comment
Share on other sites

Actually, since you're starting this now and 1.13 is getting close I would suggest taking the same approach and making it fully "flat" -- separate block for every variant. The way 1.13 seems to be going is that properties like facing orientation will still be applied to blocks but all the different types of wood will be their own block. I am not sure the entire motivation but I'd bet it is because the combination of variants with other states simply runs out of room with the 4-bit per block position "metadata". So instead of doing a half-assed approach like having two log blocks each with multiple variants just go all the way and make every variant its own thing.


For more on the 1.13 approach see: https://minecraft.gamepedia.com/1.13/Flattening


It will make your transition to 1.13 a LOT easier if you go ahead and flatten now.

Edited by jabelar
  • Like 1

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now


  • Create New...

Important Information

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