Ok i got everythiing working perfectly right, but i need some sprites since mine are bad I need an uncooked bacon strip and a cooked bacon strip. Send them to me and I WILL make sure i remember to put u in the credits
Hi, I'm trying to make a coloured stone block (Called ScarletStone), but when I try to recompile, I get an error. Command Prompt is being dumb so I don't know if it copied all the text for the error:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_03\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_ScarletStone.java:9: error: illegal escape c
haracter
ScarletStone.blockIndexInTexture = ModLoader.add
Override("/terrain.png", "\Red.png");
^
1 error
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
Here's my code.
mod_ScarletStone:
package net.minecraft.src;
public class mod_ScarletStone extends BaseMod
{
public static final Block ScarletStone = new BlockScarletStone(170, 0).setBlockName("ScarletStone").setHardness(3F).setResistance(4F);
public void load()
{
ScarletStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "\Red.png");
ModLoader.registerBlock(ScarletStone);
ModLoader.addName(ScarletStone, "Scarlet Stone");
ModLoader.addRecipe(new ItemStack(ScarletStone, 1), new Object [] {"#", "@", Character.valueOf('@'), Block.stone, Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 1)});
}
public String getVersion()
{
return "1.2.5";
}
}
and BlockScarletStone:
package net.minecraft.src;
import java.util.Random;
public class BlockScarletStone extends Block
{
public BlockScarletStone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_ScarletStone.ScarletStone.blockID;
}
public int qualityDropped(Random random)
{
return 1;
}}
The crafting recipe is supposed to be a Red Dye and a stone block (Did I do that right?). Also, I put the texture .png file into MCP\bin.
Ok simple awnser, u used a backslash before red.png not a forward slash + you have to put the image in mcp/jars/bin/minecraft.jar (open with winrar)
Ok i got everythiing working perfectly right, but i need some sprites since mine are bad I need an uncooked bacon strip and a cooked bacon strip. Send them to me and I WILL make sure i remember to put u in the credits
Ok simple awnser, u used a backslash before red.png not a forward slash + you have to put the image in mcp/jars/bin/minecraft.jar (open with winrar)
I did both of the things you said and got 5 errors:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_03\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_ScarletStone.java:3: error: cannot find symb
ol
public class mod_ScarletStone extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_ScarletStone.java:9: error: cannot find symb
ol
ScarletStone.blockIndexInTexture = ModLoader.add
Override("/terrain.png", "/Red.png");
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:10: error: cannot find sym
bol
ModLoader.registerBlock(ScarletStone);
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:11: error: cannot find sym
bol
ModLoader.addName(ScarletStone, "Scarlet Stone")
;
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:12: error: cannot find sym
bol
ModLoader.addRecipe(new ItemStack(ScarletStone,
1), new Object [] {"#", "@", Character.valueOf('@'), Block.stone, Character.valu
eOf('#'), new ItemStack(Item.dyePowder, 1, 1)});
^
symbol: variable ModLoader
location: class mod_ScarletStone
5 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
Also, if I change it back to a backslash I only get 1 error.
how can i make a spawner egg for my entity made with your "human NPC" tutorial?I know it's name is monsterPlacer but how can i make such an egg, or atleast an item that will spawn it when i right click.
Go to MCP, run recompile.bat, run startclient.bat (to make sure everything works), the run reobfuscate.bat, and then look in the reobf folder in MCP and you will have the .class files, then you take the texture (or folder with the texture) and just put it into the same place as the .class files (then you can put them all into a zip file), and then you install them like a regular mod.
When I tried to recomple, I got this batch error:
scr\minecraft\net\minecraft\src\BlockCactus.java:16: error: ';' expected return mod_Block.SpikedPlate.160;
^
1 error
===================
!! Can not find server sources, try decompiling !!
public class BlockSpikedPlate extends Block
{
public BlockSpikedPlate(int i, int j)
{
super(i, j, Material.cactus);
}
public int idDropped(int i, Random random, int j)
{
return mod_SpikedPlate.SpikedPlate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
mod_SpikedPlate.java
package net.minecraft.src;
public class mod_SpikedPlate
{
public static final Block SpikedPlate = new BlockSpikedPlate(170,0) .setBlockName ("SpikedPlate").setHardness(2F).setResistance(1F)
public void load()
SpikedPlate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp/eclipse/Client/bin/Mods/Spiked Plate.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(SpikedPlate, "Spiked Plate");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
Both classes are in the mcp/eclipse/client/bin folder.
Thanks in Advance.
how can i make a spawner egg for my entity made with your "human NPC" tutorial?I know it's name is monsterPlacer but how can i make such an egg, or atleast an item that will spawn it when i right click.
Your Item
package net.minecraft.src;
import java.util.Random;
public class Item***** extends Item
{
public Item***** (int i)
{
super(i);
maxStackSize = 1;
setMaxDamage(200);
}
private World worldObj;
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
if(!world.isRemote)
{
ModLoader.getMinecraftInstance().thePlayer.addChatMessage("This is wat it will say wen you spawn it");
EntityLiving entityliving = (EntityLiving)EntityList.createEntityByName("Put your mobs name here like... Pig", entityplayer.worldObj);
entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F);
entityplayer.worldObj.spawnEntityInWorld(entityliving);
entityplayer.swingItem();
}
return true;
}
}
ant them just add this to your mod_FILE
public static final Item SpawnEggSteve = (new ItemSpawnEggSteve(317)).setItemName("SteveEgg");
//and from the modloder part
YOURITEM.iconIndex = ModLoader.addOverride("/gui/items.png", "/YOURITEM.png");
ModLoader.addName(YOURITEM, "YOUR ITEM IN GAME");
I did both of the things you said and got 5 errors:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_03\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_ScarletStone.java:3: error: cannot find symb
ol
public class mod_ScarletStone extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_ScarletStone.java:9: error: cannot find symb
ol
ScarletStone.blockIndexInTexture = ModLoader.add
Override("/terrain.png", "/Red.png");
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:10: error: cannot find sym
bol
ModLoader.registerBlock(ScarletStone);
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:11: error: cannot find sym
bol
ModLoader.addName(ScarletStone, "Scarlet Stone")
;
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:12: error: cannot find sym
bol
ModLoader.addRecipe(new ItemStack(ScarletStone,
1), new Object [] {"#", "@", Character.valueOf('@'), Block.stone, Character.valu
eOf('#'), new ItemStack(Item.dyePowder, 1, 1)});
^
symbol: variable ModLoader
location: class mod_ScarletStone
5 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
Also, if I change it back to a backslash I only get 1 error.
You only get one error with a backslash because the compiler list all syntax errors first, then goes into the actual code errors when there are no issues with syntax. To fix these 5 errors, copy your .java file/s out of src, run cleanup.bat/sh, put ModLoader in your jar, then run decompile.bat/sh again. Put your file/s back into src and recompile then run.
how can i make a spawner egg for my entity made with your "human NPC" tutorial?I know it's name is monsterPlacer but how can i make such an egg, or atleast an item that will spawn it when i right click.
public class BlockSpikedPlate extends Block
{
public BlockSpikedPlate(int i, int j)
{
super(i, j, Material.cactus);
}
public int idDropped(int i, Random random, int j)
{
return mod_SpikedPlate.SpikedPlate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
mod_SpikedPlate.java
package net.minecraft.src;
public class mod_SpikedPlate
{
public static final Block SpikedPlate = new BlockSpikedPlate(170,0) .setBlockName ("SpikedPlate").setHardness(2F).setResistance(1F)
public void load()
SpikedPlate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp/eclipse/Client/bin/Mods/Spiked Plate.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(SpikedPlate, "Spiked Plate");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
Both classes are in the mcp/eclipse/client/bin folder.
Thanks in Advance.
Your code looks fine. Is that the latest error report? The other thing I noticed though was this:
mcp/eclipse/Client/bin is one of the folders that are checked for the textures, so you just put the path of your texture from that directory. The correct line of code for you would be:
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You only get one error with a backslash because the compiler list all syntax errors first, then goes into the actual code errors when there are no issues with syntax. To fix these 5 errors, copy your .java file/s out of src, run cleanup.bat/sh, put ModLoader in your jar, then run decompile.bat/sh again. Put your file/s back into src and recompile then run.
Check out ThyIceCold's reply.
Your code looks fine. Is that the latest error report? The other thing I noticed though was this:
mcp/eclipse/Client/bin is one of the folders that are checked for the textures, so you just put the path of your texture from that directory. The correct line of code for you would be:
Still the same thing, no difference. However, it tells me that it can't find the client bins when I try to startclient or reobsfucate. When I reobsfucate it also tells me that it can't find 'server md5s'. I would really appreciate some guidence here.
Still the same thing, no difference. However, it tells me that it can't find the client bins when I try to startclient or reobsfucate. When I reobsfucate it also tells me that it can't find 'server md5s'. I would really appreciate some guidence here.
You need to recompile it before you run startclient or reobfuscate. The warning about server md5's isn't important. Also, you're missing a { bracket in the load() method. Your corrected code would look like this:
package net.minecraft.src;
public class mod_SpikedPlate
{
public static final Block SpikedPlate = new BlockSpikedPlate(170,0) .setBlockName ("SpikedPlate").setHardness(2F).setResistance(1F)
public void load()
{
SpikedPlate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Mods/Spiked Plate.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(SpikedPlate, "Spiked Plate");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You need to recompile it before you run startclient or reobfuscate. The warning about server md5's isn't important. Also, you're missing a { bracket in the load() method. Your corrected code would look like this:
package net.minecraft.src;
public class mod_SpikedPlate
{
public static final Block SpikedPlate = new BlockSpikedPlate(170,0) .setBlockName ("SpikedPlate").setHardness(2F).setResistance(1F)
public void load()
{
SpikedPlate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Mods/Spiked Plate.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(SpikedPlate, "Spiked Plate");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
I still get the same errors as before. When recompiling I got the same error as I did doing it last time, and the other two are still going on about how they can't find the client bins. Thanks for patching up my code BTW.
scr\minecraft\net\minecraft\src\BlockCactus.java:16: error: ';' expected return mod_Block.SpikedPlate.160;
^
1 error
===================
!! Can not find server sources, try decompiling !!
I still get the same errors as before. When recompiling I got the same error as I did doing it last time, and the other two are still going on about how they can't find the client bins. Thanks for patching up my code BTW.
I think that it is telling you that your error is in the BlockCactus file, therefor, it stands to reason that you accidentally edited something in BlockCactus, so you might need to change it back to the normal cactus code.
you know how to make a multipe ore generate i wrote
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
public class mod_OreMobs extends BaseMod{
{}
public void load(){
}
public static final Block SummonOre = new SummonOre(162,0).setBlockName("SummonOre").setHardness(3F).setResistance(3F);
public static final Block SummonOreKing = new KingSummonOre(163,0).setBlockName("SummonOreKing").setHardness(3F).setResistance(3F);
public static final Item ManSummoner = new ManSummoner(190).setItemName("ManSummoner");
public static final Item KingSummoner = new KingSummoner(191).setItemName("KingSummoner");
//registerBlocks
public void addRenderer(Map map){
map.put(EntityMan.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void addRenderer1(Map map){
map.put(EntityKing.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void generateSurface(World world,Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOre.blockID,25)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
public void generateSurface1(World world,Random random, int chunkX, int chunkZ)
{
for(int k = 0; k < 15; k++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOreKing.blockID,15)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
World world;
this is what i wrote and its didnt work(i mean the multipe ore generate)
How can i make an achiviment like when i kill my self made mob?
I have deleted everything i have tried, because it didn't work, so please don't ask about what i have done.
Sorry if i could sound angry
I still get the same errors as before. When recompiling I got the same error as I did doing it last time, and the other two are still going on about how they can't find the client bins. Thanks for patching up my code BTW.
Look at KoadMaster's reply. He found the problem, that I overlooked.
you know how to make a multipe ore generate i wrote
package net.minecraft.src;
import java.util.Map;
import java.util.Random;
public class mod_OreMobs extends BaseMod{
{}
public void load(){
}
public static final Block SummonOre = new SummonOre(162,0).setBlockName("SummonOre").setHardness(3F).setResistance(3F);
public static final Block SummonOreKing = new KingSummonOre(163,0).setBlockName("SummonOreKing").setHardness(3F).setResistance(3F);
public static final Item ManSummoner = new ManSummoner(190).setItemName("ManSummoner");
public static final Item KingSummoner = new KingSummoner(191).setItemName("KingSummoner");
//registerBlocks
public void addRenderer(Map map){
map.put(EntityMan.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void addRenderer1(Map map){
map.put(EntityKing.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void generateSurface(World world,Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOre.blockID,25)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
public void generateSurface1(World world,Random random, int chunkX, int chunkZ)
{
for(int k = 0; k < 15; k++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOreKing.blockID,15)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
World world;
this is what i wrote and its didnt work(i mean the multipe ore generate)
You need to have both for loops inside the generateSurface method. A method named generateSurface1 isn't called when generating the world.
public void generateSurface(World world,Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOre.blockID,25)).generate(world, random, randPosZ, randPosY, randPosX);
}
for(int k = 0; k < 15; k++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOreKing.blockID,15)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
How can i make an achiviment like when i kill my self made mob?
I have deleted everything i have tried, because it didn't work, so please don't ask about what i have done.
Sorry if i could sound angry
Try something like that in your entity class. Don't know if it will work though.
public void onDeath(DamageSource par1DamageSource)
{
super.onDeath(par1DamageSource);
if ((par1DamageSource.getSourceOfDamage() instanceof EntityPlayer))
{
EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity();
double d = entityplayer.posX - posX;
double d1 = entityplayer.posZ - posZ;
entityplayer.triggerAchievement(mod_***.achievementName);
}
}
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Look at KoadMaster's reply. He found the problem, that I overlooked.
They will be out when they're out.
Take a look into EntityPlayer and the strings and and variables in it about XP.
You need to have both for loops inside the generateSurface method. A method named generateSurface1 isn't called when generating the world.
public void generateSurface(World world,Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOre.blockID,25)).generate(world, random, randPosZ, randPosY, randPosX);
}
for(int k = 0; k < 15; k++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOreKing.blockID,15)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
Try something like that in your entity class. Don't know if it will work though.
public void onDeath(DamageSource par1DamageSource)
{
super.onDeath(par1DamageSource);
if ((par1DamageSource.getSourceOfDamage() instanceof EntityPlayer))
{
EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity();
double d = entityplayer.posX - posX;
double d1 = entityplayer.posZ - posZ;
entityplayer.triggerAchievement(mod_***.achievementName);
}
}
I'm trying to fix my BlockCactus file, but I don't know where it is. I think I removed Client from the list. I don't know how to revert the cactus back to it's original code anyway, so can I have some help with that too?
I'm trying to fix my BlockCactus file, but I don't know where it is. I think I removed Client from the list. I don't know how to revert the cactus back to it's original code anyway, so can I have some help with that too?
the BlockCactus code:
package net.minecraft.src;
import java.util.Random;
public class BlockCactus extends Block
{
protected BlockCactus(int par1, int par2)
{
super(par1, par2, Material.cactus);
setTickRandomly(true);
}
/**
* Ticks the block if it's been scheduled
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
if (par1World.isAirBlock(par2, par3 + 1, par4))
{
int i;
for (i = 1; par1World.getBlockId(par2, par3 - i, par4) == blockID; i++) { }
if (i < 3)
{
int j = par1World.getBlockMetadata(par2, par3, par4);
if (j == 15)
{
par1World.setBlockWithNotify(par2, par3 + 1, par4, blockID);
par1World.setBlockMetadataWithNotify(par2, par3, par4, 0);
}
else
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, j + 1);
}
}
}
}
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float f = 0.0625F;
return AxisAlignedBB.getBoundingBoxFromPool((float)par2 + f, par3, (float)par4 + f, (float)(par2 + 1) - f, (float)(par3 + 1) - f, (float)(par4 + 1) - f);
}
/**
* Returns the bounding box of the wired rectangular prism to render.
*/
public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
float f = 0.0625F;
return AxisAlignedBB.getBoundingBoxFromPool((float)par2 + f, par3, (float)par4 + f, (float)(par2 + 1) - f, par3 + 1, (float)(par4 + 1) - f);
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
public int getBlockTextureFromSide(int par1)
{
if (par1 == 1)
{
return blockIndexInTexture - 1;
}
if (par1 == 0)
{
return blockIndexInTexture + 1;
}
else
{
return blockIndexInTexture;
}
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* The type of render function that is called for this block
*/
public int getRenderType()
{
return 13;
}
/**
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
if (!super.canPlaceBlockAt(par1World, par2, par3, par4))
{
return false;
}
else
{
return canBlockStay(par1World, par2, par3, par4);
}
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (!canBlockStay(par1World, par2, par3, par4))
{
dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants.
*/
public boolean canBlockStay(World par1World, int par2, int par3, int par4)
{
if (par1World.getBlockMaterial(par2 - 1, par3, par4).isSolid())
{
return false;
}
if (par1World.getBlockMaterial(par2 + 1, par3, par4).isSolid())
{
return false;
}
if (par1World.getBlockMaterial(par2, par3, par4 - 1).isSolid())
{
return false;
}
if (par1World.getBlockMaterial(par2, par3, par4 + 1).isSolid())
{
return false;
}
else
{
int i = par1World.getBlockId(par2, par3 - 1, par4);
return i == Block.cactus.blockID || i == Block.sand.blockID;
}
}
/**
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
*/
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
{
par5Entity.attackEntityFrom(DamageSource.cactus, 1);
}
}
and it is the same place as the rest of the .java files
package net.minecraft.src; import java.util.Random; public class Item***** extends Item { public Item***** (int i) { super(i); maxStackSize = 1; setMaxDamage(200); } private World worldObj; public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) { if(!world.isRemote) { ModLoader.getMinecraftInstance().thePlayer.addChatMessage("This is wat it will say wen you spawn it"); EntityLiving entityliving = (EntityLiving)EntityList.createEntityByName("Put your mobs name here like... Pig", entityplayer.worldObj); entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F); entityplayer.worldObj.spawnEntityInWorld(entityliving); entityplayer.swingItem(); } return true; } }
ant them just add this to your mod_FILE
public static final Item SpawnEggSteve = (new ItemSpawnEggSteve(317)).setItemName("SteveEgg"); //and from the modloder part YOURITEM.iconIndex = ModLoader.addOverride("/gui/items.png", "/YOURITEM.png"); ModLoader.addName(YOURITEM, "YOUR ITEM IN GAME");
thars all!
****, didn't work, I got a NullPointerExeption:
Mods loaded: 2
ModLoader 1.2.5
mod_Diego for 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 3fb4371 --------
Generated 4/9/12 11:55 PM
Minecraft: Minecraft 1.2.5
OS: Mac OS X (x86_64) version 10.7.3
Java: 1.6.0_31, Apple Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Apple Inc.
LWJGL: 2.4.2
OpenGL: NVIDIA GeForce 9400 OpenGL Engine version 2.1 NVIDIA-7.18.11, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.ItemPigMan.onItemUse(ItemPigMan.java:18)
at net.minecraft.src.ItemStack.useItem(ItemStack.java:112)
at net.minecraft.src.PlayerControllerCreative.onPlayerRightClick(PlayerControllerCreative.java:78)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1282)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1631)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:809)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Thread.java:680)
--- END ERROR REPORT 9f3a8a ----------
Ok simple awnser, u used a backslash before red.png not a forward slash + you have to put the image in mcp/jars/bin/minecraft.jar (open with winrar)
Thanks Nightara excellent signature and banner
I did both of the things you said and got 5 errors:
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_03\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_ScarletStone.java:3: error: cannot find symb
ol
public class mod_ScarletStone extends BaseMod
^
symbol: class BaseMod
src\minecraft\net\minecraft\src\mod_ScarletStone.java:9: error: cannot find symb
ol
ScarletStone.blockIndexInTexture = ModLoader.add
Override("/terrain.png", "/Red.png");
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:10: error: cannot find sym
bol
ModLoader.registerBlock(ScarletStone);
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:11: error: cannot find sym
bol
ModLoader.addName(ScarletStone, "Scarlet Stone")
;
^
symbol: variable ModLoader
location: class mod_ScarletStone
src\minecraft\net\minecraft\src\mod_ScarletStone.java:12: error: cannot find sym
bol
ModLoader.addRecipe(new ItemStack(ScarletStone,
1), new Object [] {"#", "@", Character.valueOf('@'), Block.stone, Character.valu
eOf('#'), new ItemStack(Item.dyePowder, 1, 1)});
^
symbol: variable ModLoader
location: class mod_ScarletStone
5 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
Also, if I change it back to a backslash I only get 1 error.
When I tried to recomple, I got this batch error:
^
1 error
===================
!! Can not find server sources, try decompiling !!
Here is my code now;
BlockSpikedPlate.java
package net.minecraft.src;
import java.util.Random;
public class BlockSpikedPlate extends Block
{
public BlockSpikedPlate(int i, int j)
{
super(i, j, Material.cactus);
}
public int idDropped(int i, Random random, int j)
{
return mod_SpikedPlate.SpikedPlate.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
mod_SpikedPlate.java
public class mod_SpikedPlate
{
public static final Block SpikedPlate = new BlockSpikedPlate(170,0) .setBlockName ("SpikedPlate").setHardness(2F).setResistance(1F)
public void load()
SpikedPlate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/mcp/eclipse/Client/bin/Mods/Spiked Plate.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(SpikedPlate, "Spiked Plate");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
Both classes are in the mcp/eclipse/client/bin folder.
Thanks in Advance.
Your Item
ant them just add this to your mod_FILE
thars all!
You only get one error with a backslash because the compiler list all syntax errors first, then goes into the actual code errors when there are no issues with syntax. To fix these 5 errors, copy your .java file/s out of src, run cleanup.bat/sh, put ModLoader in your jar, then run decompile.bat/sh again. Put your file/s back into src and recompile then run.
Check out ThyIceCold's reply.
Your code looks fine. Is that the latest error report? The other thing I noticed though was this:
mcp/eclipse/Client/bin is one of the folders that are checked for the textures, so you just put the path of your texture from that directory. The correct line of code for you would be:
together they are powerful beyond imagination."
Still the same thing, no difference. However, it tells me that it can't find the client bins when I try to startclient or reobsfucate. When I reobsfucate it also tells me that it can't find 'server md5s'. I would really appreciate some guidence here.
You need to recompile it before you run startclient or reobfuscate. The warning about server md5's isn't important. Also, you're missing a { bracket in the load() method. Your corrected code would look like this:
together they are powerful beyond imagination."
I still get the same errors as before. When recompiling I got the same error as I did doing it last time, and the other two are still going on about how they can't find the client bins. Thanks for patching up my code BTW.
I think that it is telling you that your error is in the BlockCactus file, therefor, it stands to reason that you accidentally edited something in BlockCactus, so you might need to change it back to the normal cactus code.
import java.util.Map;
import java.util.Random;
public class mod_OreMobs extends BaseMod{
{}
public void load(){
}
public static final Block SummonOre = new SummonOre(162,0).setBlockName("SummonOre").setHardness(3F).setResistance(3F);
public static final Block SummonOreKing = new KingSummonOre(163,0).setBlockName("SummonOreKing").setHardness(3F).setResistance(3F);
public static final Item ManSummoner = new ManSummoner(190).setItemName("ManSummoner");
public static final Item KingSummoner = new KingSummoner(191).setItemName("KingSummoner");
//registerBlocks
{}
public mod_OreMobs()
{
ManSummoner.iconIndex = ModLoader.addOverride("/gui/items.png", "/OreMobs/ManSpawner.png");
SummonOre.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/OreMobs/OreMan.png");
SummonOreKing.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/OreMobs/OreKing.png");
KingSummoner.iconIndex = ModLoader.addOverride("/gui/items.png", "/OreMobs/KingSpawner.png");
}
{
//Names
ModLoader.addName(ManSummoner, "ManEgg");
ModLoader.addName(KingSummoner, "KingEgg");
//Recipes
ModLoader.addRecipe(new ItemStack(KingSummoner, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
//Render Mob
public void addRenderer(Map map){
map.put(EntityMan.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void addRenderer1(Map map){
map.put(EntityKing.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void generateSurface(World world,Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 15; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOre.blockID,25)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
public void generateSurface1(World world,Random random, int chunkX, int chunkZ)
{
for(int k = 0; k < 15; k++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(64) + 0;
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(SummonOreKing.blockID,15)).generate(world, random, randPosZ, randPosY, randPosX);
}
}
World world;
I have deleted everything i have tried, because it didn't work, so please don't ask about what i have done.
Sorry if i could sound angry
Look at KoadMaster's reply. He found the problem, that I overlooked.
They will be out when they're out.
Take a look into EntityPlayer and the strings and and variables in it about XP.
You need to have both for loops inside the generateSurface method. A method named generateSurface1 isn't called when generating the world.
Try something like that in your entity class. Don't know if it will work though.
together they are powerful beyond imagination."
I'm trying to fix my BlockCactus file, but I don't know where it is. I think I removed Client from the list. I don't know how to revert the cactus back to it's original code anyway, so can I have some help with that too?
the BlockCactus code:
http://s1077.photobucket.com/albums/w473/AussieMUDKIP/?action=view¤t=Error.png