I've been working on a mod that requires well over 100 New blocks but there are only a limited number of ids to use so is it possible to put that many blocks in the game?
The Meaning of Life, the Universe, and Everything.
Join Date:
10/13/2014
Posts:
175
Location:
1 Mine St, Minecraftia
Minecraft:
Andr3w246
Xbox:
Andr3w246
PSN:
None
Member Details
You can make a block with different damage ids, up to 16 different damages per block.
You do this in this way:
//Variables to make it easy to type (unnessisary, but easier)
var d= "dirt"
var s= "stone"
Block.defineBlock(Id, blockName, [
[d,0],[d,0],[d,0],[d,0],[d,0],[d,0], //Damage 0
[s,0],[s,0],[s,0],[s,0],[s,0],[s,0] //Damage 1
], 1, false, 0); //False has to be there to work
Basically what you are doing is giving the block more textures than just 6, which blocklauncher decodes as a new block damage!
That is how you do it, but there is a blocklauncher problem.
If you place a custom damage block down (Ex: block 23, damage 1) it will be places as the first damage (damage 0).
You have to make a special useitem thing to correctly place down the blocks:
function useItem(x, y, z, blockId, itemId, side){
var dam= Player.getSelectedSlotData() //Gets damage of held item
If(blockId==23){
switch(side){ //"Switches" code depending on the argument (side)
case 0: //If(side==0) also the bottom side of any block
Level.setTile(x, y-1, z, 23, dam); //Set the tile to block 23 and the correct held damage
//Add all other sides below this one
}
}
}
There is yet another problem, the name!
If you want each block damage to have a different name, you would do this:
function modTick(){
//Get the item and item damage
var item= Player.getCarriedItem()
var dam= Player.getCarriedItemData ()
If(item==23){
switch(dam){ //Switches are your friend!
case 0: //if(dam==0)
ModPE.setText(tile.blockName.name, "New Name");
//Sets the original text of block to new text, can be done with every damage!
}
}
}
And that is how you can make alot of custom blocks!
Some Functions may be spelt wrong, so try not to copy and paste!
Rollback Post to RevisionRollBack
Seeing this reference here... It fills you with determination!
"Knowlage is Power!"- School House Rock "Codeing is the best power in the world!"- Me
Have fun and code on!
Rocket Science: -Mg=(M-R*t)a+R*t(Ve-g)
I've been working on a mod that requires well over 100 New blocks but there are only a limited number of ids to use so is it possible to put that many blocks in the game?
You can make a block with different damage ids, up to 16 different damages per block.
You do this in this way:
Basically what you are doing is giving the block more textures than just 6, which blocklauncher decodes as a new block damage!
That is how you do it, but there is a blocklauncher problem.
If you place a custom damage block down (Ex: block 23, damage 1) it will be places as the first damage (damage 0).
You have to make a special useitem thing to correctly place down the blocks:
function useItem(x, y, z, blockId, itemId, side){ var dam= Player.getSelectedSlotData() //Gets damage of held item If(blockId==23){ switch(side){ //"Switches" code depending on the argument (side) case 0: //If(side==0) also the bottom side of any block Level.setTile(x, y-1, z, 23, dam); //Set the tile to block 23 and the correct held damage //Add all other sides below this one } } }There is yet another problem, the name!
If you want each block damage to have a different name, you would do this:
function modTick(){ //Get the item and item damage var item= Player.getCarriedItem() var dam= Player.getCarriedItemData () If(item==23){ switch(dam){ //Switches are your friend!
case 0: //if(dam==0)
ModPE.setText(tile.blockName.name, "New Name");
//Sets the original text of block to new text, can be done with every damage!
}
}
}And that is how you can make alot of custom blocks!
Some Functions may be spelt wrong, so try not to copy and paste!
Seeing this reference here... It fills you with determination!
"Knowlage is Power!"- School House Rock
"Codeing is the best power in the world!"- Me
Have fun and code on!
Rocket Science: -Mg=(M-R*t)a+R*t(Ve-g)
Also if you are using a custom Texture Pack, the first two block textures will be messed up.
Make 2 "junk textures" that you will never use and name them the following:
"aa_0.png", "aa_1.png"
Seeing this reference here... It fills you with determination!
"Knowlage is Power!"- School House Rock
"Codeing is the best power in the world!"- Me
Have fun and code on!
Rocket Science: -Mg=(M-R*t)a+R*t(Ve-g)
Ok thanks dude!
No problem!
Always glad to help!
Seeing this reference here... It fills you with determination!
"Knowlage is Power!"- School House Rock
"Codeing is the best power in the world!"- Me
Have fun and code on!
Rocket Science: -Mg=(M-R*t)a+R*t(Ve-g)
Just asking but are you good at GUI