O'Reilly logo

Minecraft™ Mod Development in 24 Hours, Sams Teach Yourself by Jimmy Koene

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making EntitySamMob a Mob

So far, EntitySamMob has gotten a render, a model, spawning, and many other things. However, EntitySamMob is nothing more than an empty entity now. The previous spawn code also contained an error mentioning EntitySamMob isn’t an EntityLiving. To make EntitySamMob both an EntityLiving as well as a mob, it should extend EntityMob. When you add this, you can then remove the three empty methods in EntitySamMob, at which point it looks like Listing 19.6.

LISTING 19.6 EntitySamMob Extending EntityMob

package com.wuppy.samsmod;import net.minecraft.entity.monster.EntityMob;import net.minecraft.world.World;public class EntitySamMob extends EntityMob{       public EntitySamMob(World par1World)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required