Ok so ALL of this is new to me, meaning im new to reading/writing code, and this is my first minecraft mod i have ever attempted, i also apologize if i am posting this in the wrong section but i just need someone to look at these files and tell me what they mean and how to fix them.
So when i load regular Minecraft, it works ( meaning that it will load the game, but the block that I have attempted to create, is not in the creative inventory, i cannot craft it, and even when i type in the( /give player <block ID> )command, it still will not load the block. There are no errors in my code, (according to Eclipse), and it suggests that it should load just fine, but when i click "run client" in Eclipse, it will load the Mojang logo page, and then it crashes. this is the crash report that it gave me:
---- Minecraft Crash Report ----
// I blame Dinnerbone.
Time: 3/21/13 4:32 PM
Description: Exception occured in ModLoader
java.lang.IllegalArgumentException: Slot 200 is already occupied by [email protected] when adding [email protected]
at net.minecraft.src.Block.<init>(Block.java:289)
at net.minecraft.src.BlockMyblock.<init>(BlockMyblock.java:16)
at net.minecraft.src.mod_Tutorialmod.<init>(mod_Tutorialmod.java:11)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:366)
at net.minecraft.src.ModLoader.readFromModFolder(ModLoader.java:1292)
at net.minecraft.src.ModLoader.init(ModLoader.java:780)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:180)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:96)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:416)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:725)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.5
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 969417400 bytes (924 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, ILogAgent, MinecraftFakeLauncher, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.5
This is the code for my mod:
package net.minecraft.src;
public class mod_Tutorialmod extends BaseMod {
public static Block myblockBlock;
public String Version() {
return "1.6.6";
}
public mod_Tutorialmod() {
myblockBlock = new BlockMyblock(200).setBlockName("Myblock Block"); //name for minecraft
ModLoader.registerBlock(myblockBlock);
ModLoader.addName(myblockBlock, "Myblock Block"); //name for ModLoader
ModLoader.addRecipe(new ItemStack(myblockBlock,4), new Object[] {
" ##"," @ ","++ ",
Character.valueOf('#'),Block.planks,
Character.valueOf('@'),Item.redstone,
Character.valueOf('+'),Block.stone
});
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
@Override
public void load() {
// TODO Auto-generated method stub
}
}
And this is the code for the block I am attempting to create:
I don't care if the block has some crazy special function, or that it does anything special, i just want to be able to create my own block that has its own name and texture. The literal name want the block to be called in Minecraft, is Myblock. The method i used for saving the file as a mod (pretty sure it's not correct) is by making an archive with WinRar(as a .zip file) and named the archive mod_Tutorialmod.zip. Then in that i placed a copy of my mod file(mod_Tutorialmod), along with a copy of my block file(BlockMyblock). Then, along with the other two files i made a new file called "textures", then inside of that folder("textures"), I made another folder called "blocks" and inside of the blocks folder, i placed the 16x16 png file for the texture, and named it "myblock"
If someone could please help with this, it would be GREATLY appreciated. I would just like to know how many errors i have made and how i can fix them or if this is still the correct way of making a block or not. Thank you =D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So when i load regular Minecraft, it works ( meaning that it will load the game, but the block that I have attempted to create, is not in the creative inventory, i cannot craft it, and even when i type in the( /give player <block ID> )command, it still will not load the block. There are no errors in my code, (according to Eclipse), and it suggests that it should load just fine, but when i click "run client" in Eclipse, it will load the Mojang logo page, and then it crashes. this is the crash report that it gave me:
---- Minecraft Crash Report ----
// I blame Dinnerbone.
Time: 3/21/13 4:32 PM
Description: Exception occured in ModLoader
java.lang.IllegalArgumentException: Slot 200 is already occupied by [email protected] when adding [email protected]
at net.minecraft.src.Block.<init>(Block.java:289)
at net.minecraft.src.BlockMyblock.<init>(BlockMyblock.java:16)
at net.minecraft.src.mod_Tutorialmod.<init>(mod_Tutorialmod.java:11)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:366)
at net.minecraft.src.ModLoader.readFromModFolder(ModLoader.java:1292)
at net.minecraft.src.ModLoader.init(ModLoader.java:780)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:180)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:96)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:416)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:725)
at java.lang.Thread.run(Unknown Source)
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- System Details --
Details:
Minecraft Version: 1.5
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_17, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 969417400 bytes (924 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: Start[net.minecraft.src.IPlayerUsage, ILogAgent, MinecraftFakeLauncher, ...]
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
ModLoader: Mods loaded: 1
ModLoader 1.5
This is the code for my mod:
package net.minecraft.src; public class mod_Tutorialmod extends BaseMod { public static Block myblockBlock; public String Version() { return "1.6.6"; } public mod_Tutorialmod() { myblockBlock = new BlockMyblock(200).setBlockName("Myblock Block"); //name for minecraft ModLoader.registerBlock(myblockBlock); ModLoader.addName(myblockBlock, "Myblock Block"); //name for ModLoader ModLoader.addRecipe(new ItemStack(myblockBlock,4), new Object[] { " ##"," @ ","++ ", Character.valueOf('#'),Block.planks, Character.valueOf('@'),Item.redstone, Character.valueOf('+'),Block.stone }); } @Override public String getVersion() { // TODO Auto-generated method stub return null; } @Override public void load() { // TODO Auto-generated method stub } }And this is the code for the block I am attempting to create:
package net.minecraft.src; import java.util.Random; public class BlockMyblock extends Block { private Icon field_94383_a; private Icon field_94381_b; private Icon field_94382_c; protected BlockMyblock(int par1) { super(par1, Material.ground); this.setCreativeTab(CreativeTabs.tabBlock); // TODO Auto-generated constructor stub } public Icon getBlockTextureFromSideAndMetadata(int par1, int par2) { return par1 == 1 ? this.field_94383_a : (par1 == 0 ? this.field_94381_b : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon)); } public void registerIcons(IconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("myblock"); this.field_94382_c = par1IconRegister.registerIcon("myblock"); this.field_94383_a = par1IconRegister.registerIcon("myblock"); this.field_94381_b = par1IconRegister.registerIcon("myblock"); } public Block setBlockName(String string) { // TODO Auto-generated method stub return null; } }I don't care if the block has some crazy special function, or that it does anything special, i just want to be able to create my own block that has its own name and texture. The literal name want the block to be called in Minecraft, is Myblock. The method i used for saving the file as a mod (pretty sure it's not correct) is by making an archive with WinRar(as a .zip file) and named the archive mod_Tutorialmod.zip. Then in that i placed a copy of my mod file(mod_Tutorialmod), along with a copy of my block file(BlockMyblock). Then, along with the other two files i made a new file called "textures", then inside of that folder("textures"), I made another folder called "blocks" and inside of the blocks folder, i placed the 16x16 png file for the texture, and named it "myblock"
If someone could please help with this, it would be GREATLY appreciated. I would just like to know how many errors i have made and how i can fix them or if this is still the correct way of making a block or not. Thank you =D