How do you decide which tab the block/item will be in during creative mode? (ex. How to put your block/item in "Combat" or "Building Blocks" or "Materials" )
P.S. THANK YOU
This really helps because it is the only modding tutorial that I could find for 1.3.1!
Can I see your code? I would like to compare it to mine, which is not working, but gives no errors!
Thats odd, I'm getting MCP errors, also,
I know what your problem is!!!! You have to use symbols like @, # and $ for crafting, but I might have to use some of your code, casue mine just won't work.
Example:
package net.minecraft.src
[i]Create the package[/i]
public class mod_BlockLight extends BaseMod
{
public static final BlockLight = new BlockLight(160, 0).setBlockName("BlockLight").setHardness(3F).setResistance(2F).setLightValue(8F);
[i]Register the block code[/i]
[i]What this means. SetHardness chooses how hard the block is, the resistance is almost the same thing, and the light value is how much light it gives off. [/i]
public void load()
{
Light.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockLight.png");
ModLoader.registerBlock(Light);
ModLoader.addName(BlockLight, "Fancy Light");
ModLoader.addRecipe(new ItemStack(BlockLight, 8), new Object [] {"@@@", "@#@", "@@@", Character.valueOf('@'), Block.glass, Character.valueOf('#')});
[i]Add the recipe[/i]
}
public String getVersion()
{
return "Fancy Light Loading, Loaded successfully, Have Fun :D";
}
}
BlockLight:
package net.minecraft.src;
import java.util.Random;
public class BlockLight extends Block
{
public BlockLight(int i, int j)
{
super(i, j, Material.stone);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Light.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Well, I don't know what I'm doing wrong, but I know what you were doing wrong, anyway, use symbols.
EDIT: I used your coding and edited mine, still got like 10 errors, then I use your and no errors... WHAT AM I DOING WRONG!!!
Rollback Post to RevisionRollBack
Get it here: Click here! Wan't to see my Youtube Videos? Well, I'm plazmacatcher, check it out
Thats odd, I'm getting MCP errors, also,
I know what your problem is!!!! You have to use symbols like @, # and $ for crafting, but I might have to use some of your code, casue mine just won't work.
Example:
package net.minecraft.src
[i]Create the package[/i]
public class mod_BlockLight extends BaseMod
{
public static final BlockLight = new BlockLight(160, 0).setBlockName("BlockLight").setHardness(3F).setResistance(2F).setLightValue(8F);
[i]Register the block code[/i]
[i]What this means. SetHardness chooses how hard the block is, the resistance is almost the same thing, and the light value is how much light it gives off. [/i]
public void load()
{
Light.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockLight.png");
ModLoader.registerBlock(Light);
ModLoader.addName(BlockLight, "Fancy Light");
ModLoader.addRecipe(new ItemStack(BlockLight, 8), new Object [] {"@@@", "@#@", "@@@", Character.valueOf('@'), Block.glass, Character.valueOf('#')});
[i]Add the recipe[/i]
}
public String getVersion()
{
return "Fancy Light Loading, Loaded successfully, Have Fun :D";
}
}
BlockLight:
package net.minecraft.src;
import java.util.Random;
public class BlockLight extends Block
{
public BlockLight(int i, int j)
{
super(i, j, Material.stone);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Light.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Well, I don't know what I'm doing wrong, but I know what you were doing wrong, anyway, use symbols.
EDIT: I used your coding and edited mine, still got like 10 errors, then I use your and no errors... WHAT AM I DOING WRONG!!!
I can see several errors in your code.
You have defined your block as "BlockLight" but you refer to it in several places as just "Light".
Change the references to match.
Your recipe needs attention aswell. Change
Character.valueOf('@'), Block.glass
to
'@', Block.glass
You also have not included a block or item for '#'.
Mod_ File
package net.minecraft.src
public class mod_BlockTut extends BaseMod
{
public static final BlockCopper = new BlockCopper(160, 0).setBlockCopper("CopperBlock(CopperBlock)").setHardness(3F).setResistance(4F).setLightValue(1F);
[i]Register the block code[/i]
public void load()
{
Copper.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/CopperblockBlock.png");
ModLoader.registerBlock(BlockCopper);
ModLoader.addCopper(CopperHere, "Tutorial Block (Ingame Copper)");
ModLoader.addRecipe(new ItemStack(Copper, 10), new Object [] {"##", Character.valueOf('#'), Block.stone});
[i]Add the recipe[/i]
}
public String getVersion()
{
return "Tutorail for 1.3.1";
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockTutorial extends Block
{
public BlockTutorial(int i, int j)
{
super(i, j, Material.stone);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.BlockCopper.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
im a noob at coding so its probably really messed up and wheres the spoiler button
Ive got the same problem as AskMikeIfYaMAD, with the code:
Mod_BlockLight
package net.minecraft.src
[i]Create the package[/i]
public class mod_BlockLight extends BaseMod
{
public static final BlockLight = new BlockLight(160, 0).setBlockName("BlockLight").setHardness(3F).setResistance(2F).setLightValue(8F);
[i]Register the block code[/i]
[i]What this means. SetHardness chooses how hard the block is, the resistance is almost the same thing, and the light value is how much light it gives off. [/i]
public void load()
{
Light.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/BlockLight.png");
ModLoader.registerBlock(Light);
ModLoader.addName(BlockLight, "Fancy Light");
ModLoader.addRecipe(new ItemStack(BlockLight, 8), new Object [] {"@@@", "@#@", "@@@", Character.valueOf('@'), Block.glass, Character.valueOf('#')});
[i]Add the recipe[/i]
}
public String getVersion()
{
return "Fancy Light Loading, Loaded successfully, Have Fun :D";
}
}
BlockLight:
package net.minecraft.src;
import java.util.Random;
public class BlockLight extends Block
{
public BlockLight(int i, int j)
{
super(i, j, Material.stone);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Light.160;
}
public int quantityDropped(Random random)
{
return 1;
}
}
And here are the MCP errors:
== MCP 7.0 (data: 7.0a, client: 1.3.1, server: 1.3.1) ==
# found jad, ff, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, param csvs, renumber csv, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"javac" -Xlint:-options -deprecation -g -source 1.6 -target 1.6 -classpath "lib:lib/*:jars/bin/minec...' failed : 1
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/BlockLight.java:11: ';' expected
return mod_Block.Light.160;
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:1: ';' expected
package net.minecraft.src
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:5: <identifier> expected
public static final BlockLight = new BlockLight(160, 0).setBlockName("BlockLight").setHardness(3F).setResistance(2F).setLightValue(8F);
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: illegal start of type
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: illegal start of type
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: ']' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: illegal start of type
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:6: <identifier> expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: illegal start of type
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: <identifier> expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:7: <identifier> expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: illegal start of expression
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: not a statement
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: ';' expected
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: illegal start of expression
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: not a statement
^
src/minecraft/net/minecraft/src/Mod_BlockLight.java:15: ';' expected
^
36 errors
==================
!! Can not find server sources, try decompiling !!
But, I had the same problem when i was modding for 1.2.5, so I have no idea whats going on.
For me the block work but I dont code the same way of you you should try my way.
mod_Tuto:
package net.minecraft.src;
import java.util.Random;
public class mod_Tuto extends BaseMod{
public mod_Tuto()
{
//TODO List
addNames();
setTextures();
registerBlocks();
addRecipes();
addSmelting();
}
public void addNames()
{
//***
//* This adds the name for your Item/Block then the in game name.
//***
ModLoader.addName(BlockTest, "Test");
}
public void setTextures()
{
//***
//* This adds the Textures for you Item's/Block's
//***
GuiTest.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mods/dota/block/guitest.png");
}
public void registerBlocks()
{
//***
//* This will register the block. (This Has to be added if you're making a block no items go here)
//***
ModLoader.registerBlock(BlockTest);
}
public void addRecipes()
{
//***
//* Be Creative! This part will be how you craft your Item's/Block's
//***
ModLoader.addRecipe(new ItemStack(BlockTest, 1), new Object[]{"x", Character.valueOf('x'), Block.dirt});
}
public void addSmelting()
{
//***
//* This part is where we add our Smelting Recipes.
//***
}
//***
//* This is where we Register our Items/Blocks for the part below.
//***
public static Block BlockTest;
static
{
//***
//* This is where the fun begins with some food and blocks.
//***
BlockTest = new BlockTest(160, 0).setHardness(1F).setLightValue(1F).setBlockName("Test");
}
public String getVersion()
{
//***
//* This is where we name our mod.
//***
return "Mod Name - 1.3.1";
}
public void load()
{
//***
//* This is where Some NPC Stuff will go.
//***
}
}
And the Block Class
package net.minecraft.src;
import java.util.Random;
public class BlockTest extends Block
{
public BlockTest(int i, int j)
{
super(i, j, Material.wood);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public boolean isOpaqueCube()
{
return true;
}
public int idDropped(int i, Random random, int j)
{
return mod_Tuto.BlockTest.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public int idPicked(World par1World, int par2, int par3, int par4)
{
return this.blockID;
}
}
I have created my own image (Lamb.png) and im using this code:
package net.minecraft.src
public class mod_Lamb Extends Basemod
[i]Labels Mod [/i]
public static final Item Lamb = new ItemFood(5001, 4, 1F, false).setItemName("<Lamb>");
public void load()
{
.iconIndex = ModLoader.addOverride("/gui/items.png","/gui/Lamb.png");
ModLoader.addName(, "Lamb");
ModLoader.addRecipe(new ItemStack(ItemLamb, 1), new Object [] {"@", "#",Character.valueOf('#'), Item.porkCooked,Character.valuaOf('@'), Item.beefCooked});
[i]This says override the items.png and make it a different file. Than you add the recipe, look at previous tutorials.[/i]
}
{
public String getVersion()
}
{
public String getVersion()
}
So you have this code:
Remove the "Character.valueOf", so it looks like this:
P.S. THANK YOU
This really helps because it is the only modding tutorial that I could find for 1.3.1!
Thats odd, I'm getting MCP errors, also,
I know what your problem is!!!! You have to use symbols like @, # and $ for crafting, but I might have to use some of your code, casue mine just won't work.
Example:
Mod_BlockLight
BlockLight:
EDIT: I used your coding and edited mine, still got like 10 errors, then I use your and no errors... WHAT AM I DOING WRONG!!!
Get it here: Click here! Wan't to see my Youtube Videos? Well, I'm plazmacatcher, check it out
I can see several errors in your code.
You have defined your block as "BlockLight" but you refer to it in several places as just "Light".
Change the references to match.
Your recipe needs attention aswell. Change
to
You also have not included a block or item for '#'.
In the BlockLight class file change
to
Hope this helps.
but it would help if you made a gun tutorial/weapon tutorial.
Thanks.
heres my recipie code:
public class mod_clearblocks extends BaseMod
{
public static final Block clearblock = new clearblock(160,
0).setblockname("clearblock(anything)").sethardness(3F).setResistance(4F).setLightValue(1F);
public void load()
{
Name.blockIndexInTexture = Moldoader.addOverride("/terrain.png", "/block.png");
ModLoader.registerBlock(clearblock);
ModLoader.addName(nameHere, "clearblock (Clear Block)");
ModLoader.addRecipe(new ItemStack(clearblock, 1), new Object[]{"#", character.valueOf('#'),block.glass});
"gg "; "gg "; " ";'g'; Block.glass;
}
public String getVersion()
{
return "v 0.1";
}
}
and heres my errors:
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/mod_ClearBlocks.java:12: not a statement
"gg "; "gg "; " ";'g'; Block.glass;
^
src/minecraft/net/minecraft/src/mod_ClearBlocks.java:12: not a statement
"gg "; "gg "; " ";'g'; Block.glass;
^
src/minecraft/net/minecraft/src/mod_ClearBlocks.java:12: not a statement
"gg "; "gg "; " ";'g'; Block.glass;
^
src/minecraft/net/minecraft/src/mod_ClearBlocks.java:12: not a statement
"gg "; "gg "; " ";'g'; Block.glass;
^
src/minecraft/net/minecraft/src/mod_ClearBlocks.java:12: not a statement
"gg "; "gg "; " ";'g'; Block.glass;
^
5 errors
==================
i want to have a block (clearblock) that has the same properties as glass and looks invisible
help?
im a noob at coding so its probably really messed up and wheres the spoiler button
For me the block work but I dont code the same way of you you should try my way.
mod_Tuto:
And the Block Class
I wish that will help a lot of person.
I added Comments in the code That should help ya
look at what a posted, that give some explication
They should!
Yep
but i get a crash message. please help thx.
btw can you please check out my mod Essential Add-Ons:
http://www.minecraft...al-add-ons-mod/
Make sure lamb.png is in the gui folder.