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!
Reply
Delete
Sellotaper
Level 40
Master Skinner
September 26, 2012, 3:43 am
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.
Reply
Delete
mathiasrocker
Level 10
Journeyman Architect
July 22, 2012, 8:21 am
i get errors when i maked this
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
Reply
Delete
waterskier
Level 49
Master Pony
July 23, 2012, 5:33 pm
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?
Reply
Delete
iCraftedYou
Level 37
Artisan Bunny
June 2, 2012, 1:49 am
Reply
Delete
waterskier
Level 49
Master Pony
June 2, 2012, 10:52 am
Reply
Delete
iCraftedYou
Level 37
Artisan Bunny
June 2, 2012, 1:25 am
Reply
Delete
waterskier
Level 49
Master Pony
June 2, 2012, 1:34 am
Reply
Delete
iCraftedYou
Level 37
Artisan Bunny
June 2, 2012, 1:43 am
Reply
Delete
waterskier
Level 49
Master Pony
June 2, 2012, 1:47 am
http://www.youtube.com/user/waterskier420?feature=guide
Reply
Delete
felixmc
Level 69
High Grandmaster Programmer
May 19, 2012, 9:07 pm
Reply
Delete
sed11
Forum Moderator
Level 57
Grandmaster Creeper
May 16, 2012, 6:47 pm
*The hurt sound is mob.endermen.scream1. Did I write it wrong?I also got audio mod.....*
Reply
Delete
waterskier
Level 49
Master Pony
May 16, 2012, 7:49 pm
and you would only need adiomod if you were going to use custom sounds
Reply
Delete
sed11
Forum Moderator
Level 57
Grandmaster Creeper
May 16, 2012, 8:44 pm
I got audio mod because I post a thread about it and someone thought I need a sound mod enabler.
OK I'll try..
Reply
Delete
waterskier
Level 49
Master Pony
May 16, 2012, 8:44 pm
Reply
Delete
waterskier
Level 49
Master Pony
May 16, 2012, 8:54 pm
http://www.planetminecraft.com/mod/more-tools-125/
and here is mine
http://www.planetminecraft.com/mod/mo-weapons-adds-knives-and-battleaxes-so-far/
Reply
Delete
sed11
Forum Moderator
Level 57
Grandmaster Creeper
May 16, 2012, 8:53 pm
And the sounds are working now
Reply
Delete
waterskier
Level 49
Master Pony
May 16, 2012, 8:54 pm
Reply
Delete
sed11
Forum Moderator
Level 57
Grandmaster Creeper
May 16, 2012, 8:58 pm
Reply
Delete
sed11
Forum Moderator
Level 57
Grandmaster Creeper
May 16, 2012, 5:37 pm
Reply
Delete
waterskier
Level 49
Master Pony
May 16, 2012, 5:43 pm
Reply
Delete
Sellotaper
Level 40
Master Skinner
May 15, 2012, 7:46 am
Reply
Delete
Fraggles
Level 14
Journeyman Mountaineer
May 13, 2012, 10:06 pm
Reply
Delete
waterskier
Level 49
Master Pony
May 13, 2012, 10:13 pm
Reply
Delete
felixmc
Level 69
High Grandmaster Programmer
May 12, 2012, 10:09 pm
Reply
Delete
waterskier
Level 49
Master Pony
May 12, 2012, 10:46 pm
ModLoader.getUniqueEntityId());
this is a cool thing modloader has where it looks at all entity id's and chooses one that hasn't been taken yet