Published May 12th, 2012, 5/12/12 10:16 pm
- 1,705 views • 2 today
- 4
- 2
- 26
158
Hey everyone I have another tutorial for you. In this one I will teach you how to make a new mob.
In this one we need 2 classes
mod_waterskier.class
waterskier.class
mod_waterskier
of course we need make it extend basemod
then like always we need load, and getversion
but in this one we need to add 2 lines in load
ModLoader.registerEntityID(waterskier.class, "waterskier", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(waterskier.class, 12, 14, 18, EnumCreatureType.creature);
what this is saying is that we are registering a new entity and its called waterskier.
and also it needs to get a new entity id so it doesn't take one that has already been used.
then it will add spawning for it 12,14,18 says how much it spawns you can play around with this but put them in increasing order for example this wouldn't work 3,2,1
the we are saying that it is non-hostile, if you want it hostile replace the creature with monster
IMPORTANT PLEASE READ
you NEED to put waterskier.class not just waterskier
after you finish that put
public void addRenderer(Map map)
{
map.put(waterskier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
after this your mod_waterskier is done and should look like this
package net.minecraft.src;
import java.util.Map;
public class mod_waterskier extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(waterskier.class, "waterskier", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(waterskier.class, 12, 14, 18, EnumCreatureType.monster);
}
public void addRenderer(Map map)
{
map.put(waterskier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
waterskier.class
in this class we need it to extend EntityMob to be hostile, and EntityCreature to be peacful
then we need this method and everything there is self explanitory exept attack strength.
Take attack strength out if you want a peacful mob
public waterskier(World world)
{
super(world);
texture = "/waterskier.png";
moveSpeed = 0.5F;
attackStrength = 4;
}
then we need all of these. Also self explanitory. If you don't understand any of it comment on witch one
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.pickaxeDiamond.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
after that you are done with your waterskier.class, here is what it should look like
package net.minecraft.src;
import java.util.Random;
public class waterskier extends EntityCreature
{
public waterskier(World world)
{
super(world);
texture = "/waterskier.png";
moveSpeed = 0.5F;
attackStrength = 4; //take this line out if this class doesn't extend EntityMob.
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.pickaxeDiamond.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
thanks for reading! Leave any error code in the comments along with suggestions for future tutorials,and as always diamond and subscribe!
In this one we need 2 classes
mod_waterskier.class
waterskier.class
mod_waterskier
of course we need make it extend basemod
then like always we need load, and getversion
but in this one we need to add 2 lines in load
ModLoader.registerEntityID(waterskier.class, "waterskier", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(waterskier.class, 12, 14, 18, EnumCreatureType.creature);
what this is saying is that we are registering a new entity and its called waterskier.
and also it needs to get a new entity id so it doesn't take one that has already been used.
then it will add spawning for it 12,14,18 says how much it spawns you can play around with this but put them in increasing order for example this wouldn't work 3,2,1
the we are saying that it is non-hostile, if you want it hostile replace the creature with monster
IMPORTANT PLEASE READ
you NEED to put waterskier.class not just waterskier
after you finish that put
public void addRenderer(Map map)
{
map.put(waterskier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
after this your mod_waterskier is done and should look like this
mod_waterskier finished
package net.minecraft.src;
import java.util.Map;
public class mod_waterskier extends BaseMod
{
public void load()
{
ModLoader.registerEntityID(waterskier.class, "waterskier", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(waterskier.class, 12, 14, 18, EnumCreatureType.monster);
}
public void addRenderer(Map map)
{
map.put(waterskier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public String getVersion()
{
return "1.2.5";
}
}
waterskier.class
in this class we need it to extend EntityMob to be hostile, and EntityCreature to be peacful
then we need this method and everything there is self explanitory exept attack strength.
Take attack strength out if you want a peacful mob
public waterskier(World world)
{
super(world);
texture = "/waterskier.png";
moveSpeed = 0.5F;
attackStrength = 4;
}
then we need all of these. Also self explanitory. If you don't understand any of it comment on witch one
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.pickaxeDiamond.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
after that you are done with your waterskier.class, here is what it should look like
waterskier finished
package net.minecraft.src;
import java.util.Random;
public class waterskier extends EntityCreature
{
public waterskier(World world)
{
super(world);
texture = "/waterskier.png";
moveSpeed = 0.5F;
attackStrength = 4; //take this line out if this class doesn't extend EntityMob.
}
public int getMaxHealth()
{
return 20;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Item.pickaxeDiamond.shiftedIndex;
}
protected boolean canDespawn()
{
return false;
}
}
thanks for reading! Leave any error code in the comments along with suggestions for future tutorials,and as always diamond and subscribe!
| Tags |
882679
6


Have something to say?
when i do reobfuscate...
How do you do it i did all of the classes should i do anithing else befor reobfuscate? Please answer quick. Thanks, by the way epic tut. diamond for you.
public void addRenderer(Map map)
{
map.put(waterskier.class, new RenderBiped(new ModelBiped(), 0.5F));
}
can someone tell me it's it right????
this is the mod_ file
1 you didn't change waterskier on that to your mobs name.
2 you havent made the other class for your mob yet (errors will be resolved when you make it.
3 possibly an error that I just didn't see, what line is the error on?
http://www.youtube.com/user/waterskier420?feature=guide