Techguy, how do I get my generating structure to generate on only the surface (not floating in the air or underground)? Also, how can I get a structure to generate when I right click on a placed block?
Sorry if this is a really stupid question, but I can't figure this out from here or from Google. I made my mod using MCP and Eclipse, and it works while testing it through Eclipse, but when I recompile\reobfuscate it to work with my real Minecraft, it gives me this error:
java.lang.RuntimeException: java.lang.Exception: Image not found: /mods/redstoneBlock.png
Thanks in advance... This is probably really stupid but I can't figure it out... sorry =\
Stop being so impatient, the reason that you don't get a reply is because none of the people who are just trying to give techguy a little help know how to fix your problem, if you are not content to wait please go and post a topic in mod development, otherwise, try to be more patient please.
-Thank You-
Note: the reason that I reply to the following is because I know (or a least think I know) how to fix this persons problem, but I don't know how to fix yours, so I can't help you (Sorry)
I only kept posting because nobody even bothered to act like I was there, and it seemed I kept being covered up by other help posts..had someone said idk (like you), I wouldn't have kept posting.
I have a question, how do you make the modloader mod compatible with forge?
Rollback Post to RevisionRollBack
The twilight warrior.
Master of darkness and light, bound to no element, this entity is ruthless, cruel, but fair, when he looks at you he sees your whole soul, and if your heart is tipped to the darkness, or to the light, run, and hope he doesn't think you're worthy....
You install ModLoader on a minecraft.jar, put it in the jars folder of a fresh MCP, download the "source" from this page, put the "forge" folder you just downloaded in MCP, open the forge folder and run install.cmd. That will decompile the minecraft.jar and install forge. You can then copy your mod's class files to the new MCP.
hmmmm, and how do you use forge to make mods?
Rollback Post to RevisionRollBack
The twilight warrior.
Master of darkness and light, bound to no element, this entity is ruthless, cruel, but fair, when he looks at you he sees your whole soul, and if your heart is tipped to the darkness, or to the light, run, and hope he doesn't think you're worthy....
Stop being so impatient, the reason that you don't get a reply is because none of the people who are just trying to give techguy a little help know how to fix your problem, if you are not content to wait please go and post a topic in mod development, otherwise, try to be more patient please.
-Thank You-
Note: the reason that I reply to the following is because I know (or a least think I know) how to fix this persons problem, but I don't know how to fix yours, so I can't help you (Sorry)
Although, after looking closely at your code, I believe that you need to make your own render file instead of just having a render snowball, I believe that render files are very specific, but I could be wrong.
You need to have the following stuff in the load() method:
I always think of Forge as a way to do hard things the easy way. It gives you a whole lot of new methods that would be very hard to use without Forge. Take a look at this page.
I actually have some questions myself.
1. My NPC won't hold an item, here's the code.
package net.minecraft.src;
import java.util.Random;
public class EntityElf extends EntityMob
{
private static final ItemStack defaultHeldItem;
public EntityElf(World par1World)
{
super(par1World);
moveSpeed = 0.5F;
setSize(0.3F, 0.3F);
attackStrength = 4;
texture = "/elf.png";
}
public int getMaxHealth()
{
return 5;
}
protected String getLivingSound()
{
return "mob.silverfish.say";
}
protected String getHurtSound()
{
return "mob.silverfish.hit";
}
protected String getDeathSound()
{
return "mob.silverfish.kill";
}
protected int getDropItemId()
{
return Item.ingotIron.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.swordStone, 1);
}
}
2. How do you make your crop thinner? I want mine to be like a pumpkin stem in size, but when I change the block bounds, only the hitbox of the crop changes.
3. I have made a house spawn randomly. But if it spawns on a hill, the whole house is filled with grass. How can you change that?
4. Can you make a mob only spawn at a certain block? Like villagers spawn by doors, I've heard ghasts spawn by glowstone.
5. Why won't this block give me a Potion Effect by stepping on it?
package net.minecraft.src;
import java.util.Random;
public class BlockPotion extends Block
{
public BlockPotion(int i, int j)
{
super (i, j, Material.wood);
setTickRandomly(true);
}
public int idDropped(int i, Random rand, int j)
{
return blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
public void onEntityWalking(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
par5EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 10 * 30, 1));
super.onEntityWalking(par1World, par2, par3, par4, par5EntityPlayer);
}
}
Thank y'all very much!
1) I don't know
2) I might know, but i don't have time right now
3) make it generate air blocks inside the house (I think this will work)
4) I don't really know
5) Because your block has to have set "bounds" you can look at the soul sand code
I don't know if this has been posted before but I'm not going to look through 140 pages to find out. I'm trying to create a biome but this error message appears when I try to recompile:
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Wool.java:2: error: cannot find symbol
public class mod_Wool extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_Wool.java:8: error: cannot find symbol
ModLoader.addBiome(Wool);
^
symbol: variable ModLoader
location: class mod_Wool
2 errors
==================
Any help appreciated.
I'm trying to create a human NPC for a mod but after creating those two files that you put in the Human NPC section, i changed them to .class from .java and put it in minecraft.jar, and I have this error report:
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 80c9db54 --------
Generated 6/26/12 5:09 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_31, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: Intel HD Graphics 3000 OpenGL Engine version 2.1 APPLE-1.6.42, Intel Inc.
java.lang.ClassFormatError: Incompatible magic value 1885430635 in class file mod_SaxtonHale
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ModLoader.addMod(ModLoader.java:289)
at ModLoader.readFromClassPath(ModLoader.java:1225)
at ModLoader.init(ModLoader.java:886)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(Minecraft.java:394)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 630ab5f4 ----------
PLEASE HELP, I really want this to work and I want to be able to create my mod!!
I don't know if this has been posted before but I'm not going to look through 140 pages to find out. I'm trying to create a biome but this error message appears when I try to recompile:
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Wool.java:2: error: cannot find symbol
public class mod_Wool extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_Wool.java:8: error: cannot find symbol
ModLoader.addBiome(Wool);
^
symbol: variable ModLoader
location: class mod_Wool
2 errors
==================
Any help appreciated.
You didn't have ModLoader in your jar when decompiling.
I'm trying to create a human NPC for a mod but after creating those two files that you put in the Human NPC section, i changed them to .class from .java and put it in minecraft.jar, and I have this error report:
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 80c9db54 --------
Generated 6/26/12 5:09 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_31, Apple Inc.
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: Intel HD Graphics 3000 OpenGL Engine version 2.1 APPLE-1.6.42, Intel Inc.
java.lang.ClassFormatError: Incompatible magic value 1885430635 in class file mod_SaxtonHale
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ModLoader.addMod(ModLoader.java:289)
at ModLoader.readFromClassPath(ModLoader.java:1225)
at ModLoader.init(ModLoader.java:886)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(Minecraft.java:394)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 630ab5f4 ----------
PLEASE HELP, I really want this to work and I want to be able to create my mod!!
Post your code. How did you reobfuscate the code into classes? I am thinking that the way you did that may be your problem.
package net.minecraft.src;
import java.util.Random;
public class EntityElf extends EntityMob
{
private static final ItemStack defaultHeldItem;
public EntityElf(World par1World)
{
super(par1World);
moveSpeed = 0.5F;
setSize(0.3F, 0.3F);
attackStrength = 4;
texture = "/elf.png";
}
public int getMaxHealth()
{
return 5;
}
protected String getLivingSound()
{
return "mob.silverfish.say";
}
protected String getHurtSound()
{
return "mob.silverfish.hit";
}
protected String getDeathSound()
{
return "mob.silverfish.kill";
}
protected int getDropItemId()
{
return Item.ingotIron.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
public ItemStack getHeldItem()
{
return defaultHeldItem;
}
static
{
defaultHeldItem = new ItemStack(Item.swordStone, 1);
}
}
2. How do you make your crop thinner? I want mine to be like a pumpkin stem in size, but when I change the block bounds, only the hitbox of the crop changes.
3. I have made a house spawn randomly. But if it spawns on a hill, the whole house is filled with grass. How can you change that?
4. Can you make a mob only spawn at a certain block? Like villagers spawn by doors, I've heard ghasts spawn by glowstone.
5. Why won't this block give me a Potion Effect by stepping on it?
package net.minecraft.src;
import java.util.Random;
public class BlockPotion extends Block
{
public BlockPotion(int i, int j)
{
super (i, j, Material.wood);
setTickRandomly(true);
}
public int idDropped(int i, Random rand, int j)
{
return blockID;
}
public int quantityDropped(Random rand)
{
return 1;
}
public void onEntityWalking(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
par5EntityPlayer.addPotionEffect(new PotionEffect(Potion.blindness.id, 10 * 30, 1));
super.onEntityWalking(par1World, par2, par3, par4, par5EntityPlayer);
}
}
Thank y'all very much!
1. Post your render code.
2. I don't know.
3. Do what Koadmaster suggested or what you told someone else except change the or statement to an and statement.
if(world.getBlockId(x, y, z)!= Block.grass.blockID && world.getBlockId(x, y + 1, z)!= 0)
{
return false;
}
4. There is a method called getCanSpawnHere. I believe it is what you want but I'm not sure how to add what you want to do.
/**
* Checks if the entity's current position is a valid location to spawn this entity.
*/
public boolean getCanSpawnHere()
{
return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0;
}
That is from the Ghast code in case you're wondering.
5. Koadmaster is correct.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Thanks for the response, but I'm very new at this and don't know what you mean by putting modloader in my jar. I tried putting the class files from my modloader file into my minecraft.jar, but nothing changed.
Fantastic tutorials! Thanks for doing this; you have the only good crop tutorial out there.
I have a question though. I'm making a new crop, corn. In the BlockCorn file, I have
public int idDropped(int i, Random random, int j)
{
if (i == 8)
{
return Item.wheat.shiftedIndex;
}
else
{
return -1;
}
}
I want it to drop an item called "cornRaw" instead of wheat when it is harvested. I didn't do cornRaw as a separate class, but did it short way. In my mod_ file I have
public static final Item cornRaw = new Item(960).setItemName("cornRaw");
public void load1()
{
cornRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/cornRaw.png");
ModLoader.addName(cornRaw, "Raw Corn");
ModLoader.addRecipe(new ItemStack(cornRaw, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
So, my question is what do I change "Item.wheat" to in BlockCorn to drop have Corn drop cornRaw? When I just change it to cornRaw, Eclipse tells me:
cornRaw cannot be resolved or is not a field.
3 quick fixes available:
Create field 'cornRaw' in type 'Item'
Create constant 'cornRaw' in type 'Item'
Change to chickenRaw
My guess is it says that because there isn't an Item.cornRaw, but it isn't really a problem since the mod_ file adds it. Am I thinking incorrectly?
Sorry if this sort of thing has been asked before, there are a lot of replies to read through to be sure.
Fantastic tutorials! Thanks for doing this; you have the only good crop tutorial out there.
I have a question though. I'm making a new crop, corn. In the BlockCorn file, I have
public int idDropped(int i, Random random, int j)
{
if (i == 8)
{
return Item.wheat.shiftedIndex;
}
else
{
return -1;
}
}
I want it to drop an item called "cornRaw" instead of wheat when it is harvested. I didn't do cornRaw as a separate class, but did it short way. In my mod_ file I have
public static final Item cornRaw = new Item(960).setItemName("cornRaw");
public void load1()
{
cornRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/cornRaw.png");
ModLoader.addName(cornRaw, "Raw Corn");
ModLoader.addRecipe(new ItemStack(cornRaw, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
So, my question is what do I change "Item.wheat" to in BlockCorn to drop have Corn drop cornRaw? When I just change it to cornRaw, Eclipse tells me:
cornRaw cannot be resolved or is not a field.
3 quick fixes available:
Create field 'cornRaw' in type 'Item'
Create constant 'cornRaw' in type 'Item'
Change to chickenRaw
My guess is it says that because there isn't an Item.cornRaw, but it isn't really a problem since the mod_ file adds it. Am I thinking incorrectly?
Sorry if this sort of thing has been asked before, there are a lot of replies to read through to be sure.
i need help again with my electric fences. i got everything working like it should, exept that each fence has to be powered seperetly. i looked at the code for BlockRedstoneWire, but that was way to complex with decreasing power and wahtnot. my main question is 'is there a good, simple way to make a powered block spread power infinitly to other blocks of the same type only?' if you could help me my mod would finaly be done.
What I did to change them into .class files is just renaming the .java part into .class
That is probably what I did wrong but I don't know another way to change them into .class, IS there another way?
You need to use reobfuscate.bat in MCP. A class is a compiled file that cannot be edited whereas a .java file is a decompiled format that is freely editable but cannot be read by the engine. Renaming the extension will not do anything.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Be sure to check out my texture pack: Easy Ores!
Thanks in advance... This is probably really stupid but I can't figure it out... sorry =\
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI only kept posting because nobody even bothered to act like I was there, and it seemed I kept being covered up by other help posts..had someone said idk (like you), I wouldn't have kept posting.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumhmmmm, and how do you use forge to make mods?
Thanks very much - I checked again and it was a mistake with the name capitalization. Fixed it and it works!
Thanks!
i just tried this and it still doesnt accept superdiamond
-
View User Profile
-
View Posts
-
Send Message
Curse Premium1) I don't know
2) I might know, but i don't have time right now
3) make it generate air blocks inside the house (I think this will work)
4) I don't really know
5) Because your block has to have set "bounds" you can look at the soul sand code
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_Wool.java:2: error: cannot find symbol
public class mod_Wool extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_Wool.java:8: error: cannot find symbol
ModLoader.addBiome(Wool);
^
symbol: variable ModLoader
location: class mod_Wool
2 errors
==================
Any help appreciated.
Mods loaded: 13
ModLoader 1.2.5
mod_Archer 1.0.0
mod_Archer2 1.0.0
mod_ArcherE 1.0.0
mod_castle2 1.0.0
mod_Guard 1.0.0
mod_Guard2 1.0.0
mod_Knight 1.0.0
mod_Knight2 1.2.3
mod_KnightE 1.0.0
mod_Mage 1.0.0
mod_MinecraftForge 3.1.2.94
mod_ModLoaderMp 1.2.5v1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 80c9db54 --------
Generated 6/26/12 5:09 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.6.8
Java: 1.6.0_31, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: Intel HD Graphics 3000 OpenGL Engine version 2.1 APPLE-1.6.42, Intel Inc.
java.lang.ClassFormatError: Incompatible magic value 1885430635 in class file mod_SaxtonHale
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ModLoader.addMod(ModLoader.java:289)
at ModLoader.readFromClassPath(ModLoader.java:1225)
at ModLoader.init(ModLoader.java:886)
at ModLoader.addAllRenderers(ModLoader.java:189)
at ahu.<init>(ahu.java:77)
at ahu.<clinit>(ahu.java:8)
at net.minecraft.client.Minecraft.a(Minecraft.java:394)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 630ab5f4 ----------
PLEASE HELP, I really want this to work and I want to be able to create my mod!!
I am working on doing it with Forge at the moment. I have tried to do it without Forge but haven't succeeded.
You didn't have ModLoader in your jar when decompiling.
Post your code. How did you reobfuscate the code into classes? I am thinking that the way you did that may be your problem.
1. Post your render code.
2. I don't know.
3. Do what Koadmaster suggested or what you told someone else except change the or statement to an and statement.
if(world.getBlockId(x, y, z)!= Block.grass.blockID && world.getBlockId(x, y + 1, z)!= 0) { return false; }4. There is a method called getCanSpawnHere. I believe it is what you want but I'm not sure how to add what you want to do.
/** * Checks if the entity's current position is a valid location to spawn this entity. */ public boolean getCanSpawnHere() { return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0; }That is from the Ghast code in case you're wondering.
5. Koadmaster is correct.
together they are powerful beyond imagination."
That is probably what I did wrong but I don't know another way to change them into .class, IS there another way?
I have a question though. I'm making a new crop, corn. In the BlockCorn file, I have
public int idDropped(int i, Random random, int j) { if (i == 8) { return Item.wheat.shiftedIndex; } else { return -1; } }I want it to drop an item called "cornRaw" instead of wheat when it is harvested. I didn't do cornRaw as a separate class, but did it short way. In my mod_ file I have
public static final Item cornRaw = new Item(960).setItemName("cornRaw"); public void load1() { cornRaw.iconIndex = ModLoader.addOverride("/gui/items.png", "/cornRaw.png"); ModLoader.addName(cornRaw, "Raw Corn"); ModLoader.addRecipe(new ItemStack(cornRaw, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); }So, my question is what do I change "Item.wheat" to in BlockCorn to drop have Corn drop cornRaw? When I just change it to cornRaw, Eclipse tells me:
3 quick fixes available:
Create field 'cornRaw' in type 'Item'
Create constant 'cornRaw' in type 'Item'
Change to chickenRaw
Sorry if this sort of thing has been asked before, there are a lot of replies to read through to be sure.
Be sure to check out my texture pack: Easy Ores!
That did it, thank you
Abomination
You need to use reobfuscate.bat in MCP. A class is a compiled file that cannot be edited whereas a .java file is a decompiled format that is freely editable but cannot be read by the engine. Renaming the extension will not do anything.
together they are powerful beyond imagination."
Be sure to check out my texture pack: Easy Ores!