. Then you have to write an if statement that checks whether you are holding the item, then inside that if statement you have the code that "evolves" the mob
if (item.itemID == mod_XXX.evolutionItem.shiftedIndex)
evolutionItem can be any item, as long as it's inside your mod_XXX file. If you want a different item/block just use
Item.item.shiftedIndex;
Block.block.blockId;
respectively. Inside that if block comes this block of code
All you need to worry about here is the mob that it becomes (here it's EntityZombie). You can change the mob to anything you want (just rename accordingly).
If you want your mob to require, say, 3 of the item to evolve then you would need to add a integer variable to hold the amount taken. This variable should be private unless you want to access it from outside the entity file, then it should be public or protected. 1 is added to that variable every the the mob is given one so the code to look like this:
Do you have any idea how I can change the world generation of dungeons? I mean like they should spawn next to a specific block, not next to a solid block. How can I do this without having too much changed?
Rollback Post to RevisionRollBack
Somebody drew a **** on the wall! But who did it? It was old chuckleberrybum, doing the kind of "draw-****-on-wall-thing". It was all he ever did. He drew his first phallic object when he was just 4 months old! You see, some people don't find a purpose in life, they just draw dicks. Now, kids get a job and a watermill, so you don't have to draw penises for a living!
i got 50 instead of 32 and at EnumCreatureType.monster it's EnumCreatureType.creature
Well, I'm having some trouble with one of my mobs spawning and I also have it at EnumCreatureType.creature as the spawn rate I even put 1000 and it doesn't spawn. It's very strange. You'd have to look through the ModLoader.AddSpawn method and maybe through EnumCreatureType to figure out the problem.
Do you have any idea how I can change the world generation of dungeons? I mean like they should spawn next to a specific block, not next to a solid block. How can I do this without having too much changed?
Look through WorldGenCactus to see how to only make it spawn on a specific block then add that code to WorldGenDungeons. You should only have to change WorldGenDungeons.
Look through WorldGenCactus to see how to only make it spawn on a specific block then add that code to WorldGenDungeons. You should only have to change WorldGenDungeons.
First of all, worldgencactus doesn't spawn cacti on a specific block. And I already tried something like that and I failed. That's why I'm asking this here
Rollback Post to RevisionRollBack
Somebody drew a **** on the wall! But who did it? It was old chuckleberrybum, doing the kind of "draw-****-on-wall-thing". It was all he ever did. He drew his first phallic object when he was just 4 months old! You see, some people don't find a purpose in life, they just draw dicks. Now, kids get a job and a watermill, so you don't have to draw penises for a living!
First of all, worldgencactus doesn't spawn cacti on a specific block. And I already tried something like that and I failed. That's why I'm asking this here
In the worldgen file for the dungeons you have to make a new variable that holds the block right underneath where the dungeon would spawn and if then you can specify whether the dungeon will be allowed to spawn depending which block it is. That would look something like this
public boolean generate(World var1, Random var2, int var3, int var4, int var5)
{
int var6 = var1.getBlockID(var3,var4 - 1,var5);//checks the block underneath
if (var6 == Block.whatever.blockID)
{
//generation code
If you are reading this tutorial I assume you already have your block finished.
This will be a small tutorial, because it is not very hard to do. Basically, all you need to do is add the onBlockActivated method, wich means "on right click", with a small, not confusing, tidbit of code.
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(!world.multiplayerWorld)
{
EntityPigZombie pigz = new EntityPigZombie(world);
pigz.setLocationAndAngles(i, j, k, 5, 6);
world.entityJoinedWorld(pigz);
return true;
}
return false;
}
I only used pigmen for demonstration purposes the mob could be any mob you want it to be. This bit of code
pigz.setLocationAndAngles(i, j, k, 5, 6);
should only be used if the entity you are spawning is a mob. i, j, and k are the location where it is spawned and 5 and 6 is the direction the mob is angled.
If you wanted to spawn a lightning you bolt the code would look like this:
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(!world.multiplayerWorld)
{
EntityLightningBolt lightning = new EntityLightningBolt(world);
world.entityJoinedWorld(lghtning);
return true;
}
return false;
}
Finished code:
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// Block, Material
public class BlockSpawnBlock extends Block
{
protected BlockSpawnBlock(int i)
{
super(i, Material.ground);
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(!world.multiplayerWorld)
{
EntityPigZombie pigz = new EntityPigZombie(world);
pigz.setLocationAndAngles(i, j, k, 5, 6);
world.entityJoinedWorld(pigz);
return true;
}
return false;
}
}
Man a new furnace isnt advanced :/ all your doing is changing names, show us how to add another slot with its own recipes THEN call it advanced :smile.gif:
Thanks!
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Check out my Minecraft Modding Tutorials!
If you are following this tutorial, I assume you already have your mob finished.
This is a lot simpler then I thought at first. All you have to do is add this method Then you have to find the player's current equipped item doing this . Then you have to write an if statement that checks whether you are holding the item, then inside that if statement you have the code that "evolves" the mob evolutionItem can be any item, as long as it's inside your mod_XXX file. If you want a different item/block just use respectively. Inside that if block comes this block of code All you need to worry about here is the mob that it becomes (here it's EntityZombie). You can change the mob to anything you want (just rename accordingly).
Finished code:
If you want your mob to require, say, 3 of the item to evolve then you would need to add a integer variable to hold the amount taken. This variable should be private unless you want to access it from outside the entity file, then it should be public or protected. 1 is added to that variable every the the mob is given one so the code to look like this:
Finished Code:
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
EDIT: Could you possibly teach how to tame a mob?
That's a good idea!
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Do you have ? The 32 is the number that decides the spawn rate.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Well I cant crop it any smaller its being stupid... but here you go :tongue.gif: Great tutorials.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
That's amazing!
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Well, I'm having some trouble with one of my mobs spawning and I also have it at EnumCreatureType.creature as the spawn rate I even put 1000 and it doesn't spawn. It's very strange. You'd have to look through the ModLoader.AddSpawn method and maybe through EnumCreatureType to figure out the problem.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Look through WorldGenCactus to see how to only make it spawn on a specific block then add that code to WorldGenDungeons. You should only have to change WorldGenDungeons.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
First of all, worldgencactus doesn't spawn cacti on a specific block. And I already tried something like that and I failed. That's why I'm asking this here
In the worldgen file for the dungeons you have to make a new variable that holds the block right underneath where the dungeon would spawn and if then you can specify whether the dungeon will be allowed to spawn depending which block it is. That would look something like this
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
There already is an api for that: http://www.minecraftforum.net/topic/228940-173scokeev9-premiumwood-v144-12-more-thanks-for-250000-dls/#items
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
If you are reading this tutorial I assume you already have your block finished.
This will be a small tutorial, because it is not very hard to do. Basically, all you need to do is add the onBlockActivated method, wich means "on right click", with a small, not confusing, tidbit of code.
I only used pigmen for demonstration purposes the mob could be any mob you want it to be. This bit of code should only be used if the entity you are spawning is a mob. i, j, and k are the location where it is spawned and 5 and 6 is the direction the mob is angled.
If you wanted to spawn a lightning you bolt the code would look like this:
Finished code:
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua