package net.minecraft.src;
public class mod_Redstoneblock extends BaseMod {
public static final Block redstoneBlock = new BlockRedstoneBlock(201, 0).setHardness(5.0F).setResistance(2.0F).setBlockName("redstoneBlock");
public void load() {
ModLoader.registerBlock(redstoneBlock);
redstoneBlock.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Redstone/Block.png");
ModLoader.addName(redstoneBlock, "Redstone Block");
}
ModLoader.addRecipe(new ItemStack(Redstoneblock, 1), new Object [] {"UUU", "UUU", "UUU", Character.valueOf('U'), Item.redstone });
public String getVersion() {
return "1.2.5";
}
}
It says that the dot after ModLoader (Recipe part) is wront, Also the ")" after (Redstoneblock, 1 ")" is wrong
that is because you have it outside the load method, if you look at this line:
public void load() {
the " { " thing is what tells it to start the method, and if you look the first " } " is where that method ends. So to fix this just put your recipe inside the " { } "
Sorry to post again but it seems like minecraft isn't recognising my mod any more.
Here is my code to see if their is something wrong.
package net.minecraft.src;
import java.util.Random;
public class mod_ElderCraft
{
public static final Block Orichalcum = new BlockOrichalcum(130, 0).setBlockName("Orichalcum Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Ebony = new BlockEbony(131, 0).setBlockName("Ebony Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block MoonStone = new BlockMoonStone(132, 0).setBlockName("MoonStone Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Malachite = new BlockMalachite(133, 0).setBlockName("Malachite Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block QuickSilver = new BlockQuickSilver(134, 0).setBlockName("QuickSilver Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Silver = new BlockSilver(135, 0).setBlockName("Silver Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Corundum = new BlockCorundum(136, 0).setBlockName("Corundum Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public void load()
{
Orichalcum.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Orichalcu.png");
Ebony.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Ebony.png");
MoonStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/MoonStone.png");
Malachite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Malachite.png");
QuickSilver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/QuickSilver.png");
Silver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Silver.png");
Corundum.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Corundum.png");
ModLoader.registerBlock(Orichalcum);
ModLoader.registerBlock(Ebony);
ModLoader.registerBlock(MoonStone);
ModLoader.registerBlock(Malachite);
ModLoader.registerBlock(QuickSilver);
ModLoader.registerBlock(Silver);
ModLoader.registerBlock(Corundum);
ModLoader.addName(Orichalcum, "Orichalcum Ore");
ModLoader.addName(Ebony, "Ebony Ore");
ModLoader.addName(MoonStone, "MoonStone Ore");
ModLoader.addName(Malachite, "Malachite Ore");
ModLoader.addName(QuickSilver, "QuickSilver Ore");
ModLoader.addName(Silver, "Silver Ore");
ModLoader.addName(Corundum, "Corundum Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 100000; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Orichalcum.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
Also the block gen won't work... In Eclipse, World and Random won't go blue... I don't think it recognises the World.java class. As you can see I changed the spawn rate very high so its not that I just Can't find them....
I have a simple question again Anyone can answer, but how would I make it so zombies (or anything for that matter) spawn in the daylight, and not burn. Again, preferably without editing files. But it will be fine if I have to
Rollback Post to RevisionRollBack
My old signature was stupid and outdated. It's gone now.
package net.minecraft.src;
public class ConcreteBlock extends Block
{
public ConcreteBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int , Random random, int j)
{
return mod_Block.Namehere.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
I don't quite understand what to put in the public int idDropped and public in quantityDropped. Do I need to replace the numbers? Or the random?
Sorry to post again but it seems like minecraft isn't recognising my mod any more.
Here is my code to see if their is something wrong.
package net.minecraft.src;
import java.util.Random;
public class mod_ElderCraft
{
public static final Block Orichalcum = new BlockOrichalcum(130, 0).setBlockName("Orichalcum Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Ebony = new BlockEbony(131, 0).setBlockName("Ebony Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block MoonStone = new BlockMoonStone(132, 0).setBlockName("MoonStone Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Malachite = new BlockMalachite(133, 0).setBlockName("Malachite Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block QuickSilver = new BlockQuickSilver(134, 0).setBlockName("QuickSilver Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Silver = new BlockSilver(135, 0).setBlockName("Silver Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public static final Block Corundum = new BlockCorundum(136, 0).setBlockName("Corundum Ore").setHardness(3F).setResistance(5F).setLightValue(0F);
public void load()
{
Orichalcum.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Orichalcu.png");
Ebony.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Ebony.png");
MoonStone.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/MoonStone.png");
Malachite.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Malachite.png");
QuickSilver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/QuickSilver.png");
Silver.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Silver.png");
Corundum.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Images/Corundum.png");
ModLoader.registerBlock(Orichalcum);
ModLoader.registerBlock(Ebony);
ModLoader.registerBlock(MoonStone);
ModLoader.registerBlock(Malachite);
ModLoader.registerBlock(QuickSilver);
ModLoader.registerBlock(Silver);
ModLoader.registerBlock(Corundum);
ModLoader.addName(Orichalcum, "Orichalcum Ore");
ModLoader.addName(Ebony, "Ebony Ore");
ModLoader.addName(MoonStone, "MoonStone Ore");
ModLoader.addName(Malachite, "Malachite Ore");
ModLoader.addName(QuickSilver, "QuickSilver Ore");
ModLoader.addName(Silver, "Silver Ore");
ModLoader.addName(Corundum, "Corundum Ore");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 100000; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Orichalcum.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
Also the block gen won't work... In Eclipse, World and Random won't go blue... I don't think it recognises the World.java class. As you can see I changed the spawn rate very high so its not that I just Can't find them....
Thanks again.
~ChillyConCarnage
Try importing this at the beginning just replace it with the "Random" imported utility.
import java.util.*;
I think your problem is you don't have the "world" imported but just use the code above and you should be fine.
Well, here. I may see a problem... You do need to switch out "mod_Block" with your mod_ file name, and "Namehere" with the block name. I'm not sure about the "blockID"
But other than that, can you tell me where it errors?
Well, here. I may see a problem... You do need to switch out "mod_Block" with your mod_ file name, and "Namehere" with the block name. I'm not sure about the "blockID"
But other than that, can you tell me where it errors?
Okay, I did that. I replaced them already. Here are some remaining errors:
In line 13, it says that Random cannot be resolved to as a type.
In line 9, it says there is a Syntax error on token "int", VariableDeclaratorId expected after this token.
With the second error, I think you might need to add a letter after the first "int" in the parentheses. With the first, you need some word after "Random"
Sorry, I can't help much more :l I'm not too hotshot of a coder myself
EDIT:
Try this, just change the things like the "mod_Block"
package net.minecraft.src;
import java.util.Random;
public class ConcreteBlock extends Block
{
public ConcreteBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Namehere.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
With the second error, I think you might need to add a letter after the first "int" in the parentheses. With the first, you need some word after "Random"
Sorry, I can't help much more :l I'm not too hotshot of a coder myself
EDIT:
Try this, just change the things like the "mod_Block"
package net.minecraft.src;
import java.util.Random;
public class ConcreteBlock extends Block
{
public ConcreteBlock(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Namehere.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
}
Thanks! No more errors! I want to test out this before continuing so, how do I save it? Where do I get the .class files? I already have a texture and what will I do with it? Thanks thanks.
Edit: And btw, what does import java.util.Random; do?
It's what stopped the Random error from happening It defined the Random... So anyway, you have MCP installed? You now just recompile, then reobfuscate the code. When you open the folder entitled "reobf" the class files will be in there.
Rollback Post to RevisionRollBack
My old signature was stupid and outdated. It's gone now.
It's what stopped the Random error from happening It defined the Random... So anyway, you have MCP installed? You now just recompile, then reobfuscate the code. When you open the folder entitled "reobf" the class files will be in there.
Thanks! Where do I need to put my custom textures before reobfscating?
Okay missed that one in the OP. Sorry for too many questions, but I have another one. I tested everything and it ran good with the custom textures and such. The block exists now, but it doesn't show up in the items screen in Creative Mode. How to make it show?
I have a simple question again Anyone can answer, but how would I make it so zombies (or anything for that matter) spawn in the daylight, and not burn. Again, preferably without editing files. But it will be fine if I have to
If you are making your own mob then you can do it without editing base classes. But if you just want to make the default mobs not burn you can go to EntityZombie (or EntitySkeliton or whatever) and make if so that it extends something like EntityNoSun then just make a new file named EntityNoSun, copy the code from EntityMob, and take out the chunk of code that tells it not to spawn in the daytime, and the chunk that tells it to burn. Or you could just take all that code out of EntityMob.
This looks great! Thanks so much for taking the time to make these. The entity tutorials look SO helpful, and I can't wait until I get my laptop back so I can test them out
OK. Currently, I'm trying to make an Entity of mine spawn structures. I have the structure file ready to go but I am getting errors when I try to get the entity to spawn it. Could there maybe be a tutorial on this?
nice tutorial, but with the custom npc there spawn like 20 of the custom mobs on the same place how to decrease it to 1/2? so I mean how to decrease there spawn rate when generating. hope someone can answer this
If you look in the mob tutorial in the "understanding the code" part, it tells you how to adjust the spawn rate.
Hello, I have a question. I have a mob working and appearing. It attacks me and jumps and everything. I have a few questions though:
1. How to make some of the body parts to move? I know it's somewhere in model****.java, but I don't know what exactly.
2. How to make them like wolves who are neutral then becomes hostile when provoked?
3. Final question, how to make the mob act like the wolves in packs, when once a wolf is hurt, all of them will attack.
Thanks!
BTW, thanks MICHAELNESS for the help.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumthat is because you have it outside the load method, if you look at this line:
public void load() {the " { " thing is what tells it to start the method, and if you look the first " } " is where that method ends. So to fix this just put your recipe inside the " { } "
package net.minecraft.src; public class ConcreteBlock extends Block { public ConcreteBlock(int i, int j) { super(i, j, Material.rock); } public int idDropped(int , Random random, int j) { return mod_Block.Namehere.blockID; } public int quantityDropped(Random random) { return 1; }}I don't quite understand what to put in the public int idDropped and public in quantityDropped. Do I need to replace the numbers? Or the random?
Try importing this at the beginning just replace it with the "Random" imported utility.
import java.util.*;
I think your problem is you don't have the "world" imported but just use the code above and you should be fine.
Well, here. I may see a problem... You do need to switch out "mod_Block" with your mod_ file name, and "Namehere" with the block name. I'm not sure about the "blockID"
But other than that, can you tell me where it errors?
Okay, I did that. I replaced them already. Here are some remaining errors:
In line 13, it says that Random cannot be resolved to as a type.
In line 9, it says there is a Syntax error on token "int", VariableDeclaratorId expected after this token.
Sorry, I can't help much more :l I'm not too hotshot of a coder myself
EDIT:
Try this, just change the things like the "mod_Block"
package net.minecraft.src; import java.util.Random; public class ConcreteBlock extends Block { public ConcreteBlock(int i, int j) { super(i, j, Material.rock); } public int idDropped(int i, Random random, int j) { return mod_Block.Namehere.blockID; } public int quantityDropped(Random random) { return 1; } }Thanks! No more errors! I want to test out this before continuing so, how do I save it? Where do I get the .class files? I already have a texture and what will I do with it? Thanks thanks.
Edit: And btw, what does import java.util.Random; do?
Thanks! Where do I need to put my custom textures before reobfscating?
Also, if anyone can answer my question last page, that would be great
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf you are making your own mob then you can do it without editing base classes. But if you just want to make the default mobs not burn you can go to EntityZombie (or EntitySkeliton or whatever) and make if so that it extends something like EntityNoSun then just make a new file named EntityNoSun, copy the code from EntityMob, and take out the chunk of code that tells it not to spawn in the daytime, and the chunk that tells it to burn. Or you could just take all that code out of EntityMob.
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse PremiumIf you look in the mob tutorial in the "understanding the code" part, it tells you how to adjust the spawn rate.
1. How to make some of the body parts to move? I know it's somewhere in model****.java, but I don't know what exactly.
2. How to make them like wolves who are neutral then becomes hostile when provoked?
3. Final question, how to make the mob act like the wolves in packs, when once a wolf is hurt, all of them will attack.
Thanks!
BTW, thanks MICHAELNESS for the help.