Hey there, ever made a mod that has custom blocks? Have you ever noticed how the amount of custom blocks you can make is limited because the ID cannot exceed 256? Well now you can make as many blocks as you want! How you ask? Simple, by giving a block of the same ID a different data value... What's a data value you ask? Well let's look at the planks, we know that there are more then one type of planks right? But they all share the same ID which is 5, the Oak Planks data is 0, Spruce is 1 and so on, but how do we make a custom blocks have different data values? It is really quite simple!
First we are going to make a block using the define block function, we will give it an ID a name and we will decide what textures we want it to have, add a source block, a render type and decide if it is opaque:
Now we have a custom block that looks like stone, great! But everyone knows how to do that right? Now we can add different textures to each side by adding more to the texture array like this:
Now each side is still stone but this is where things are going to start getting long... I mean like really long... We are going to give the block 250 a new data value so we can reuse the ID to do this, add in another 6 textures to the array and these will be the textures for the block 250 that has a data value of 1 instead of 0 (which is stone one we just made) so now we have this:
Great! You just made a block have more then one data value! How do we get the blocks now? Just add them to the creative inventory, note that you'll need to do one for each data value like this:
Now you have your custom block with two data values! But what if you want each one to have a different shape? Well using the set block shape function, at the end (after the endY co-ordinate) add the blocks data like this:
That is pretty much all there is to it! Hopefully this will help out some of you (if it does maybe consider hitting that Thanks button? ) and if none of this made sense just leave a message and I'll get back to you asap
Thanks! Hmm, I'm not too sure but I'll definitely look into this and get back to you asap, as for items, they don't use a data value because item ID's are unlimited but again, I'll look into it!
There are a few items that do use data values e.g.(dye, coal/charcoal, buckets).
You're right, I didn't think of that, I will still look into this but is it ok if I PM you the codes and you test it because I just soft bricked my phone this morning and I can't test scripts till I get it fixed
Hey there, ever made a mod that has custom blocks? Have you ever noticed how the amount of custom blocks you can make is limited because the ID cannot exceed 256? Well now you can make as many blocks as you want! How you ask? Simple, by giving a block of the same ID a different data value... What's a data value you ask? Well let's look at the planks, we know that there are more then one type of planks right? But they all share the same ID which is 5, the Oak Planks data is 0, Spruce is 1 and so on, but how do we make a custom blocks have different data values? It is really quite simple!
First we are going to make a block using the define block function, we will give it an ID a name and we will decide what textures we want it to have, add a source block, a render type and decide if it is opaque:
Now we have a custom block that looks like stone, great! But everyone knows how to do that right? Now we can add different textures to each side by adding more to the texture array like this:
Now each side is still stone but this is where things are going to start getting long... I mean like really long... We are going to give the block 250 a new data value so we can reuse the ID to do this, add in another 6 textures to the array and these will be the textures for the block 250 that has a data value of 1 instead of 0 (which is stone one we just made) so now we have this:
Great! You just made a block have more then one data value! How do we get the blocks now? Just add them to the creative inventory, note that you'll need to do one for each data value like this:
Now you have your custom block with two data values! But what if you want each one to have a different shape? Well using the set block shape function, at the end (after the endY co-ordinate) add the blocks data like this:
That is pretty much all there is to it! Hopefully this will help out some of you (if it does maybe consider hitting that Thanks button? ) and if none of this made sense just leave a message and I'll get back to you asap
Well done, this is very helpful. More tutorials like this would be appreciated.
Thanks.
Thanks! Hmm, I'm not too sure but I'll definitely look into this and get back to you asap, as for items, they don't use a data value because item ID's are unlimited but again, I'll look into it!
There are a few items that do use data values e.g.(dye, coal/charcoal, buckets).
My intention is to add buckets filled with sand, dirt, gravel and such.
Thanks for the prompt reply.
You're right, I didn't think of that, I will still look into this but is it ok if I PM you the codes and you test it because I just soft bricked my phone this morning and I can't test scripts till I get it fixed
Great! But how can I name the data value 1? I mean this: 240:0 BlockA 240:1 BlockB