Hi, thank you so much for making this topic. Ive been looking for a good tutorial for mod making. but something went wrong when i tried. I did everything correctly and exactly how you said to, but after i closed eclipse, minecraft would not open because 'modoader had failed to start' or something like that. so i forced update,(installed modloader correctly) and i replaced the bin and resources folders in the 'jars' folder in the extracted mcp with the new bin and resources folders, and double clicked the 'decompile.bat' file in the mcp directory. But this time, when it started do decompile, it went through a few lines then said,
'!!missing server jar file. aborted!!' So I tried again, forced update again, reinstalled modloader, and replaced the bin and resources folders. this time, when i tried decompiling it, it said the same thing i did this several times, with no luck. any help?
i dont have time to go on minecraftforum very often, so can you email me at [email protected]? If you can't, that is also okay-just reply on this post.
go to minecraft.net and download their minecraft_server.jar file (not exe) and place it in the folder you placed the bin and resources folder in. that should fix that error.
cant ask for everyone to think logically, lol. ANYWAYS, i have a question that still hasnt been answered exactly just yet.
For some reason the half slabs wount stack? Ive followed the tutorial, but when i do so it fails to compile because of the "true" statement in the mod_namehere file.
package net.minecraft.src;
public class mod_Slab extends BaseMod
{
public static final Block nameHereSingleSlab = new BlockNameHereSlab(250, false).setBlockName("anyNameHereSlabSingle").setHardness(3F).setResistance(4F);
public static final Block nameHereDoubleSlab = new BlockNameHereSlab(251, true).setBlockName("anyNameHereSlabDouble").setHardness(3F).setResistance(4F);
public void load()
{
nameHereSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab2.png");
ModLoader.registerBlock(nameHereSingleSlab);
ModLoader.addName(nameHereSingleSlab, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(nameHereSingleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone});
nameHereDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab.png");
ModLoader.registerBlock(nameHereDoubleSlab);
ModLoader.addName(nameHereDoubleSlab, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(nameHereDoubleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone});
}
public String getVersion()
{
return "1.3.1";
}
}
the "true" statement causes a compile error. here is MY code and not the code from the tutorial.
mod_namehere
package net.minecraft.src;
public class mod_Pslab extends BaseMod
{
public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F);
public static final Block PslabD = new Blockmod_PslabD(251,0).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
public void load()
{
Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png");
ModLoader.registerBlock(Pslab1);
ModLoader.addName(Pslab1, "Pavement Slab");
ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object []
{
"##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone
});
}
public String getVersion()
{
return "1.3.1";
}
}
Blockmod_Pslab
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class Blockmod_Pslab extends BlockHalfSlab
{
public Blockmod_Pslab(int par1, boolean par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
setLightOpacity(0);
}
public int getBlockTextureFromSide(int par1)
{
return blockIndexInTexture;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Pslab.Pslab1.blockID;
}
public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID);
}
}
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(mod_Pslab.PslabD.blockID, 2, par1 & 7);
}
public String getFullSlabName(int var1)
{
return null;
}
}
Blockmod_PslabD
package net.minecraft.src;
import java.util.Random;
public class Blockmod_PslabD extends Block
{
public Blockmod_PslabD(int i, int j)
{
super(i,j,Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Pslab.PslabD.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
anyone have any clue?
EDIT: i changed the true to a zero. which causes it to compile without hitch, just doesnt stack.
Ah, well, I've found why the texture won't work...so, along with my directional thing, does anyone know how to make items place blocks?
EDIT: Alright, got items to place blocks. Just copied the code for flint & steel, works now. But still, anyone know how to make it so blocks can be placed directionally?
i get this error when recompiling
srs\ minecraft\net\minecraft\src\mod_block.java:3: error: class mod_block is public,
should be declared in a file named mod_block.java
public class mod_block extends BaseMod
if you can help this is my code
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block crate = new BlockCrate(160,
0).setBlockName("Crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png");
ModLoader.registerBlock(crate);
ModLoader.addName(crate, "Crate");
}
public String getVersion()
{
return "1.3.1";
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockCrate extends Block
{
public BlockCrate(int i, int j)
{
super(i, j, Material.wood);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.crate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
So, does anyone know how to make a mob fly? Kind of like the enderdragon? Or should I just look at the enderdragon coding?
EDIT: Oh, and could you add tutorials for armor, special item powers (like enchantments or flint and steel, but in the coding), villages, and custom mob animations? That would be very nice.
Getting this error when I test my code, no base classes have been changed or any errors:
Crash report
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Reecety\Documents\MCP\jars\.\crash-reports\crash-2012-08-16_08.41.20-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 53ad0b47 --------
Generated 8/16/12 8:41 AM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997860768 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_NomNom 1.3.1
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:162)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_NomNom.load(mod_NomNom.java:18)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ea1fc2e6 ----------
Here is the mod_ file, if it'll help:
package net.minecraft.src;
public class mod_NomNom extends BaseMod
{
public static final Item Candy = new ItemFood(600, 2, 1F, false).setItemName("Candy");
public static final Item Wrapper = new ItemWrapper(601).setItemName("Wrapper");
public static final Item EggSoup = new ItemFood(602, 8, 3F, true).setItemName("EggSoup");
public static final Item Jar = new ItemJar(603).setItemName("Jar");
public static final Item ShroomSpread = new ItemFood(604, 2, 1F, true).setItemName("ShroomSpread");
public void load()
{
Candy.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/candy.png");
ModLoader.addName(Candy, "Candy");
ModLoader.addRecipe(new ItemStack(Candy, 3), new Object [] {"C", "W", Character.valueOf('C'), Item.dyePowder, 1, 3, Character.valueOf('C'), mod_NomNom.Wrapper.shiftedIndex});
Wrapper.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/wrapper.png");
ModLoader.addName(Wrapper, "Wrapper");
ModLoader.addRecipe(new ItemStack(Wrapper, 3), new Object [] {"P", Character.valueOf('P'), Item.paper});
EggSoup.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/eggsoup.png");
ModLoader.addName(EggSoup, "EggSoup");
ModLoader.addRecipe(new ItemStack(EggSoup, 1), new Object [] {"E", "B", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty});
Jar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/jar.png");
ModLoader.addName(Jar, "Jar");
ModLoader.addRecipe(new ItemStack(Jar, 4), new Object [] {"P", Character.valueOf('P'), Block.glass});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomRed, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomBrown, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
}
public String getVersion()
{
return "1.3.1";
}
}
Any fixes/ideas what's wrong? (Using Tech's Tutorials).
Getting this error when I test my code, no base classes have been changed or any errors:
Crash report
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem; ModLoader has failed to initialize.
This error has been saved to C:\Users\Reecety\Documents\MCP\jars\.\crash-reports\crash-2012-08-16_08.41.20-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 53ad0b47 --------
Generated 8/16/12 8:41 AM
- Minecraft Version: 1.3.1
- Operating System: Windows 7 (amd64) version 6.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
- Memory: 997860768 bytes (951 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.1
mod_NomNom 1.3.1
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Character
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:162)
at net.minecraft.src.ModLoader.addRecipe(ModLoader.java:482)
at net.minecraft.src.mod_NomNom.load(mod_NomNom.java:18)
at net.minecraft.src.ModLoader.init(ModLoader.java:927)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:161)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:86)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ea1fc2e6 ----------
Here is the mod_ file, if it'll help:
package net.minecraft.src;
public class mod_NomNom extends BaseMod
{
public static final Item Candy = new ItemFood(600, 2, 1F, false).setItemName("Candy");
public static final Item Wrapper = new ItemWrapper(601).setItemName("Wrapper");
public static final Item EggSoup = new ItemFood(602, 8, 3F, true).setItemName("EggSoup");
public static final Item Jar = new ItemJar(603).setItemName("Jar");
public static final Item ShroomSpread = new ItemFood(604, 2, 1F, true).setItemName("ShroomSpread");
public void load()
{
Candy.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/candy.png");
ModLoader.addName(Candy, "Candy");
ModLoader.addRecipe(new ItemStack(Candy, 3), new Object [] {"C", "W", Character.valueOf('C'), Item.dyePowder, 1, 3, Character.valueOf('C'), mod_NomNom.Wrapper.shiftedIndex});
Wrapper.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/wrapper.png");
ModLoader.addName(Wrapper, "Wrapper");
ModLoader.addRecipe(new ItemStack(Wrapper, 3), new Object [] {"P", Character.valueOf('P'), Item.paper});
EggSoup.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/eggsoup.png");
ModLoader.addName(EggSoup, "EggSoup");
ModLoader.addRecipe(new ItemStack(EggSoup, 1), new Object [] {"E", "B", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty});
Jar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/jar.png");
ModLoader.addName(Jar, "Jar");
ModLoader.addRecipe(new ItemStack(Jar, 4), new Object [] {"P", Character.valueOf('P'), Block.glass});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomRed, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png");
ModLoader.addName(ShroomSpread, "'shroom Spread");
ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomBrown, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex});
}
public String getVersion()
{
return "1.3.1";
}
}
Only thing I saw was this, and I'm not sure if it was causing it. Your code:
If you cant figure out how to use this simple code than you were not made for coding and you should probably stop.
And if you dont check the code please read it closely, I dont know Java but with this tutorial I learned how to make mods for Minecraft without any Java knowledge and I understand the code.
This tutorial is not missing anything.
If you dont know what to change then i feel sorry for you because it indicates you in the code what you are suppose to change. Im warning you Coding requires logical thinking and it seems your not really good at it because this tutorial is so clear and you dont get it. You are the kinda guy who needs sombody who tells you EVERY SINGLE THING, so you are not a guy who was made for coding because its all about trying.
The only hope im seeing for you is for you to learn Java.
P.S: If you would send me your code i would be willing to help to look up what is wrong.
Good luck.
Wow. Respect, thank you, and **** you.
You see, it's not really that easy when you're given basic coding, as an example, and nothing much really told other than parts of the coding being changed.
Put in an example from a bit of coding that works, and it makes it so much easier because it helps pin point what is wrong.
You see, it's not really that easy when you're given basic coding, as an example, and nothing much really told other than parts of the coding being changed.
Put in an example from a bit of coding that works, and it makes it so much easier because it helps pin point what is wrong.
know what, I have given you THREE examples of what is wrong and you chose to ignore all three of them. So what do you expect from others?
EDIT: Did I mention they were full examples, I even gave you one that had it already compiled with the source code! What more in hell do you want?
You see, it's not really that easy when you're given basic coding, as an example, and nothing much really told other than parts of the coding being changed.
Put in an example from a bit of coding that works, and it makes it so much easier because it helps pin point what is wrong.
Dude, you can go to one of the thousands of other mod tutorial threads, because if you "talk" to people like that they're not going to help you.
If you want, I could help if you would calm down.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
Dude, you can go to one of the thousands of other mod tutorial threads, because if you "talk" to people like that they're not going to help you.
If you want, I could help if you would calm down.
There is no point in even trying man, I've corrected his code 3 times and even gave him a working copy ready to install into minecraft. All the corrections gave explanation as to why it was wrong and it was full code. I even tested it in game to make sure there was no problems. I don't know what more else can be done.
There is no point in even trying man, I've corrected his code 3 times and even gave him a working copy ready to install into minecraft. All the corrections gave explanation as to why it was wrong and it was full code. I even tested it in game to make sure there was no problems. I don't know what more else can be done.
Oh, should've read farther back, haha.
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
And out of curiosity, what does updating a mod consist of? It is simply updating Minecraft, putting it into MCP, and then copying and pasting your old code?
And what changes are there for making it a server mod?
And out of curiosity, what does updating a mod consist of? It is simply updating Minecraft, putting it into MCP, and then copying and pasting your old code?
And what changes are there for making it a server mod?
getchangedsrc.bat/sh
Copy and paste it in to the newer MCP's SRC after decompiling
Rollback Post to RevisionRollBack
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
cant ask for everyone to think logically, lol. ANYWAYS, i have a question that still hasnt been answered exactly just yet.
For some reason the half slabs wount stack? Ive followed the tutorial, but when i do so it fails to compile because of the "true" statement in the mod_namehere file.
package net.minecraft.src;
public class mod_Slab extends BaseMod
{
public static final Block nameHereSingleSlab = new BlockNameHereSlab(250, false).setBlockName("anyNameHereSlabSingle").setHardness(3F).setResistance(4F);
public static final Block nameHereDoubleSlab = new BlockNameHereSlab(251, true).setBlockName("anyNameHereSlabDouble").setHardness(3F).setResistance(4F);
public void load()
{
nameHereSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab2.png");
ModLoader.registerBlock(nameHereSingleSlab);
ModLoader.addName(nameHereSingleSlab, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(nameHereSingleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone});
nameHereDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab.png");
ModLoader.registerBlock(nameHereDoubleSlab);
ModLoader.addName(nameHereDoubleSlab, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(nameHereDoubleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone});
}
public String getVersion()
{
return "1.3.1";
}
}
the "true" statement causes a compile error. here is MY code and not the code from the tutorial.
mod_namehere
package net.minecraft.src;
public class mod_Pslab extends BaseMod
{
public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F);
public static final Block PslabD = new Blockmod_PslabD(251,0).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F);
public void load()
{
Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png");
ModLoader.registerBlock(Pslab1);
ModLoader.addName(Pslab1, "Pavement Slab");
ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object []
{
"##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone
});
}
public String getVersion()
{
return "1.3.1";
}
}
Blockmod_Pslab
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class Blockmod_Pslab extends BlockHalfSlab
{
public Blockmod_Pslab(int par1, boolean par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
setLightOpacity(0);
}
public int getBlockTextureFromSide(int par1)
{
return blockIndexInTexture;
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_Pslab.Pslab1.blockID;
}
public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving)
{
if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID);
}
}
protected ItemStack createStackedBlock(int par1)
{
return new ItemStack(mod_Pslab.PslabD.blockID, 2, par1 & 7);
}
public String getFullSlabName(int var1)
{
return null;
}
}
Blockmod_PslabD
package net.minecraft.src;
import java.util.Random;
public class Blockmod_PslabD extends Block
{
public Blockmod_PslabD(int i, int j)
{
super(i,j,Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Pslab.PslabD.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
anyone have any clue?
EDIT: i changed the true to a zero. which causes it to compile without hitch, just doesnt stack.
I'm still waiting for a tip or some sort of guidance on this issue, any takers?
The Meaning of Life, the Universe, and Everything.
Join Date:
7/1/2012
Posts:
76
Minecraft:
Nukeannihilation
Member Details
I have zeroed in on the method in the ModLoader.class that defines sprite indexes, I doubled the sprite indexes from 256-512 and no longer got the
"java.lang.Exception: No more empty terrain sprite indices left!"
error. If you guys have this issue, I'm guessing its OK to distribute the modified class file (maybe with permission?) with your mod? Not sure, but it does save a ton of pains and is probably the simplest fix I have ever seen to this issue. (or at least a temporary fix until FML is fully updated).
if you modify these lines HERE:
private static final boolean[] usedItemSprites = new boolean[256];
private static final boolean[] usedTerrainSprites = new boolean[256];
to THIS:
private static final boolean[] usedItemSprites = new boolean[512];
private static final boolean[] usedTerrainSprites = new boolean[512];
it will give you twice the images to work with. if you need even MORE you can double the 512 to 1024 or even quadruple it to 2048 (theoretically).
this may or may not be a good idea, please feel free to tell me to fu** off with my suggestion, just something I stumbled upon and thought might be convenient.
EDIT: Think I know why it was set at 256, lol. Have some minor texture bugs, it may just be me missing some textures however, some are replaced with the biomeless grass side texture (and the grass top texture)
Hey Techguy, I made a mod file, and the entire game loads up in eclipse with no errors, but when I try to smelt "Silver Ore" In a furnace into my "Silver Ingot" Nothing happens! Here is my Code for "mod_Silveringot.java"
package net.minecraft.src;
import java.util.Random;
public class mod_Silveringot extends BaseMod
{
public static final Item Silveringot = new Silveringot(5000).setItemName("Silveringot");
public static final Block Silverore = new Silverore(166, 0).setBlockName("Silverore").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
Silverore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Silverore.png");
ModLoader.registerBlock(Silverore);
ModLoader.addName(Silverore, "Silver Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 4; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(28);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Silverore.blockID, 11)).generate(world, random, randPosX, randPosY, randPosZ);
Silveringot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Silveringot.png");
ModLoader.addName(Silveringot, "Silver Ingot");
ModLoader.addSmelting(Silverore.blockID, new ItemStack(Silveringot, 1), 1);
}
}
public String getVersion()
{
return "1.3.1";
}
}
And My "Silveringot.java"
package net.minecraft.src;
public class Silveringot extends Item
{
public Silveringot(int i)
{
super(i);
maxStackSize = 64;
}
}
Thanks!
*Edit: Now It worked once, I found an error in a different code, but now if I generate a world it just overrides /gui/items.png with both /copperingot.png and /silveringot.png over and over until there is no spots left then crashes.
All my classes. (Look at the above ones, too!)
package net.minecraft.src;
import java.util.Random;
public class mod_Copper extends BaseMod
{
public static final Item Copperingot = new Copperingot(389).setItemName("Copperingot");
public static final Block Copperore = new Copperore(165, 0).setBlockName("Copperore").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
Copperore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Copperore.png");
ModLoader.registerBlock(Copperore);
ModLoader.addName(Copperore, "Copper Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 4; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Copperore.blockID, 17)).generate(world, random, randPosX, randPosY, randPosZ);
Copperingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Copperingot.png");
ModLoader.addName(Copperingot, "Copper Ingot");
ModLoader.addSmelting(Copperore.blockID, new ItemStack(Copperingot, 1), 1);
}
}
public String getVersion()
{
return "1.3.1";
}
}
mod_Copper.java.
package net.minecraft.src;
public class Copperingot extends Item
{
public Copperingot(int i)
{
super(i);
maxStackSize = 64;
}
}
Copperingot.java.
package net.minecraft.src;
import java.util.Random;
public class Copperore extends Block
{
public Copperore(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Copper.Copperore.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Copperore.java.
package net.minecraft.src;
import java.util.Random;
public class Silverore extends Block
{
public Silverore(int i, int j)
{
super(i, j, Material.rock);
setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Silver.Silverore.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
go to minecraft.net and download their minecraft_server.jar file (not exe) and place it in the folder you placed the bin and resources folder in. that should fix that error.
cant ask for everyone to think logically, lol. ANYWAYS, i have a question that still hasnt been answered exactly just yet.
For some reason the half slabs wount stack? Ive followed the tutorial, but when i do so it fails to compile because of the "true" statement in the mod_namehere file.
package net.minecraft.src; public class mod_Slab extends BaseMod { public static final Block nameHereSingleSlab = new BlockNameHereSlab(250, false).setBlockName("anyNameHereSlabSingle").setHardness(3F).setResistance(4F); public static final Block nameHereDoubleSlab = new BlockNameHereSlab(251, true).setBlockName("anyNameHereSlabDouble").setHardness(3F).setResistance(4F); public void load() { nameHereSingleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab2.png"); ModLoader.registerBlock(nameHereSingleSlab); ModLoader.addName(nameHereSingleSlab, "In-Game Name Here"); ModLoader.addRecipe(new ItemStack(nameHereSingleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone}); nameHereDoubleSlab.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/imageslab.png"); ModLoader.registerBlock(nameHereDoubleSlab); ModLoader.addName(nameHereDoubleSlab, "In-Game Name Here"); ModLoader.addRecipe(new ItemStack(nameHereDoubleSlab, 1), new Object [] {"#", Character.valueOf('#'), Block.cobblestone}); } public String getVersion() { return "1.3.1"; } }the "true" statement causes a compile error. here is MY code and not the code from the tutorial.
mod_namehere
package net.minecraft.src; public class mod_Pslab extends BaseMod { public static final Block Pslab1 = new Blockmod_Pslab(250,false).setBlockName("Pavement Slab").setHardness(4.5F).setResistance(20F); public static final Block PslabD = new Blockmod_PslabD(251,0).setBlockName("Pavement Double Slab").setHardness(4.5F).setResistance(20F); public void load() { Pslab1.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/Pavement/Pavement.png"); ModLoader.registerBlock(Pslab1); ModLoader.addName(Pslab1, "Pavement Slab"); ModLoader.addRecipe(new ItemStack(Pslab1,18), new Object [] { "##","CC",Character.valueOf('#'),Block.sand,('C'),Block.cobblestone }); } public String getVersion() { return "1.3.1"; } }Blockmod_Pslab
package net.minecraft.src; import java.util.List; import java.util.Random; public class Blockmod_Pslab extends BlockHalfSlab { public Blockmod_Pslab(int par1, boolean par2) { super(par1, par2, Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); setLightOpacity(0); } public int getBlockTextureFromSide(int par1) { return blockIndexInTexture; } public int idDropped(int par1, Random par2Random, int par3) { return mod_Pslab.Pslab1.blockID; } public void onBlockPacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { if(par1World.getBlockId(par2, par3 - 1, par4) == mod_Pslab.Pslab1.blockID) { par1World.setBlockWithNotify(par2, par3, par4, 0); par1World.setBlockWithNotify(par2, par3 -1, par4, mod_Pslab.PslabD.blockID); } } protected ItemStack createStackedBlock(int par1) { return new ItemStack(mod_Pslab.PslabD.blockID, 2, par1 & 7); } public String getFullSlabName(int var1) { return null; } }package net.minecraft.src; import java.util.Random; public class Blockmod_PslabD extends Block { public Blockmod_PslabD(int i, int j) { super(i,j,Material.rock); this.setCreativeTab(CreativeTabs.tabBlock); } public int idDropped(int i, Random random, int j) { return mod_Pslab.PslabD.blockID; } public int quantityDropped(Random random) { return 1; } }anyone have any clue?
EDIT: i changed the true to a zero. which causes it to compile without hitch, just doesnt stack.
EDIT: Alright, got items to place blocks. Just copied the code for flint & steel, works now.
srs\ minecraft\net\minecraft\src\mod_block.java:3: error: class mod_block is public,
should be declared in a file named mod_block.java
public class mod_block extends BaseMod
if you can help this is my code
package net.minecraft.src; public class mod_Block extends BaseMod { public static final Block crate = new BlockCrate(160, 0).setBlockName("Crate").setHardness(5F).setResistance(5F).setCreativeTab(CreativeTabs.tabBlock); public void load() { crate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/crate.png"); ModLoader.registerBlock(crate); ModLoader.addName(crate, "Crate"); } public String getVersion() { return "1.3.1"; } }package net.minecraft.src; import java.util.Random; public class BlockCrate extends Block { public BlockCrate(int i, int j) { super(i, j, Material.wood); } public int idDropped(int i, Random random, int j) { return mod_Block.crate.blockID; } public int quantityDropped(Random random) { return 1; } }-
View User Profile
-
View Posts
-
Send Message
Curse Premiumhttp://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
EDIT: Oh, and could you add tutorials for armor, special item powers (like enchantments or flint and steel, but in the coding), villages, and custom mob animations? That would be very nice.
Crash report
Here is the mod_ file, if it'll help:
package net.minecraft.src; public class mod_NomNom extends BaseMod { public static final Item Candy = new ItemFood(600, 2, 1F, false).setItemName("Candy"); public static final Item Wrapper = new ItemWrapper(601).setItemName("Wrapper"); public static final Item EggSoup = new ItemFood(602, 8, 3F, true).setItemName("EggSoup"); public static final Item Jar = new ItemJar(603).setItemName("Jar"); public static final Item ShroomSpread = new ItemFood(604, 2, 1F, true).setItemName("ShroomSpread"); public void load() { Candy.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/candy.png"); ModLoader.addName(Candy, "Candy"); ModLoader.addRecipe(new ItemStack(Candy, 3), new Object [] {"C", "W", Character.valueOf('C'), Item.dyePowder, 1, 3, Character.valueOf('C'), mod_NomNom.Wrapper.shiftedIndex}); Wrapper.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/wrapper.png"); ModLoader.addName(Wrapper, "Wrapper"); ModLoader.addRecipe(new ItemStack(Wrapper, 3), new Object [] {"P", Character.valueOf('P'), Item.paper}); EggSoup.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/eggsoup.png"); ModLoader.addName(EggSoup, "EggSoup"); ModLoader.addRecipe(new ItemStack(EggSoup, 1), new Object [] {"E", "B", Character.valueOf('E'), Item.egg, Character.valueOf('B'), Item.bowlEmpty}); Jar.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/jar.png"); ModLoader.addName(Jar, "Jar"); ModLoader.addRecipe(new ItemStack(Jar, 4), new Object [] {"P", Character.valueOf('P'), Block.glass}); ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png"); ModLoader.addName(ShroomSpread, "'shroom Spread"); ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomRed, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex}); ShroomSpread.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/shroomspread.png"); ModLoader.addName(ShroomSpread, "'shroom Spread"); ModLoader.addRecipe(new ItemStack(ShroomSpread, 1), new Object [] {"S", "J", Character.valueOf('S'), Block.mushroomBrown, Character.valueOf('J'), mod_NomNom.Jar.shiftedIndex}); } public String getVersion() { return "1.3.1"; } }Any fixes/ideas what's wrong? (Using Tech's Tutorials).
Only thing I saw was this, and I'm not sure if it was causing it. Your code:
ModLoader.addRecipe(new ItemStack(Candy, 3), new Object [] {"C", "W", Character.valueOf('C'), Item.dyePowder, 1, 3, Character.valueOf('C'), mod_NomNom.Wrapper.shiftedIndex});Character.valueOf('C')twice.http://www.planetminecraft.com/blog/125-halo-3-weapons---custom-content-for-flans-mods/
Wow. Respect, thank you, and **** you.
You see, it's not really that easy when you're given basic coding, as an example, and nothing much really told other than parts of the coding being changed.
Put in an example from a bit of coding that works, and it makes it so much easier because it helps pin point what is wrong.
know what, I have given you THREE examples of what is wrong and you chose to ignore all three of them. So what do you expect from others?
EDIT: Did I mention they were full examples, I even gave you one that had it already compiled with the source code! What more in hell do you want?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffDude, you can go to one of the thousands of other mod tutorial threads, because if you "talk" to people like that they're not going to help you.
If you want, I could help if you would calm down.
There is no point in even trying man, I've corrected his code 3 times and even gave him a working copy ready to install into minecraft. All the corrections gave explanation as to why it was wrong and it was full code. I even tested it in game to make sure there was no problems. I don't know what more else can be done.
-
View User Profile
-
View Posts
-
Send Message
Retired StaffOh, should've read farther back, haha.
And what changes are there for making it a server mod?
-
View User Profile
-
View Posts
-
Send Message
Retired Staffgetchangedsrc.bat/sh
Copy and paste it in to the newer MCP's SRC after decompiling
I'm still waiting for a tip or some sort of guidance on this issue, any takers?
I'm not too good at this stuff and whatnot, but try setting max stack size? Sorry if this doesn't work, I'm not an expert at it.
if you modify these lines HERE:
to THIS:
it will give you twice the images to work with. if you need even MORE you can double the 512 to 1024 or even quadruple it to 2048 (theoretically).
this may or may not be a good idea, please feel free to tell me to fu** off with my suggestion, just something I stumbled upon and thought might be convenient.
EDIT: Think I know why it was set at 256, lol. Have some minor texture bugs, it may just be me missing some textures however, some are replaced with the biomeless grass side texture (and the grass top texture)
Hey Techguy, I made a mod file, and the entire game loads up in eclipse with no errors, but when I try to smelt "Silver Ore" In a furnace into my "Silver Ingot" Nothing happens! Here is my Code for "mod_Silveringot.java"import java.util.Random;
public class mod_Silveringot extends BaseMod
{
public static final Item Silveringot = new Silveringot(5000).setItemName("Silveringot");
public static final Block Silverore = new Silverore(166, 0).setBlockName("Silverore").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
Silverore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Silverore.png");
ModLoader.registerBlock(Silverore);
ModLoader.addName(Silverore, "Silver Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 4; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(28);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Silverore.blockID, 11)).generate(world, random, randPosX, randPosY, randPosZ);
Silveringot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Silveringot.png");
ModLoader.addName(Silveringot, "Silver Ingot");
ModLoader.addSmelting(Silverore.blockID, new ItemStack(Silveringot, 1), 1);
}
}
public String getVersion()
{
return "1.3.1";
}
}
And My "Silveringot.java"public class Silveringot extends Item
{
public Silveringot(int i)
{
super(i);
maxStackSize = 64;
}
}
Thanks!*Edit: Now It worked once, I found an error in a different code, but now if I generate a world it just overrides /gui/items.png with both /copperingot.png and /silveringot.png over and over until there is no spots left then crashes.
All my classes. (Look at the above ones, too!)
import java.util.Random;
public class mod_Copper extends BaseMod
{
public static final Item Copperingot = new Copperingot(389).setItemName("Copperingot");
public static final Block Copperore = new Copperore(165, 0).setBlockName("Copperore").setHardness(3F).setResistance(4F).setLightValue(1F).setCreativeTab(CreativeTabs.tabBlock);
public void load()
{
Copperore.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Copperore.png");
ModLoader.registerBlock(Copperore);
ModLoader.addName(Copperore, "Copper Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 4; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Copperore.blockID, 17)).generate(world, random, randPosX, randPosY, randPosZ);
Copperingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Copperingot.png");
ModLoader.addName(Copperingot, "Copper Ingot");
ModLoader.addSmelting(Copperore.blockID, new ItemStack(Copperingot, 1), 1);
}
}
public String getVersion()
{
return "1.3.1";
}
}
public class Copperingot extends Item
{
public Copperingot(int i)
{
super(i);
maxStackSize = 64;
}
}
import java.util.Random;
public class Copperore extends Block
{
public Copperore(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Copper.Copperore.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
import java.util.Random;
public class Silverore extends Block
{
public Silverore(int i, int j)
{
super(i, j, Material.rock);
setCreativeTab(CreativeTabs.tabBlock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Silver.Silverore.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
I also changed "mod_Silveringot" to "mod_Silver"