Jump to content

Trying to make a mob, what am I missing?


kmccmk9
 Share

Recommended Posts

Hello, so I'm trying to make a mob, but I can't find a good updated tutorial on what exactly is needed. So far I have what's below, what am I missing?

 

package kmccmk9.witchCraft;

import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraft.src.*;

public class EntityBee extends EntityLiving {

public EntityBee(World par1World) {
	super(par1World);
	this.getNavigator().setAvoidsWater(true);
	this.setSize(0.5F, 0.5F);
}

protected int getDropItemId()
    {
        return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID;
    }

public int getMaxHealth() {
	return 15;
}

public String getTexture() {
	return "textures/bee.png";
}

}

Link to comment
Share on other sites

If you are on 1.6, those are useless:

public int getMaxHealth() {
	return 15;
}

public String getTexture() {
	return "textures/bee.png";
}

 

Really? Okay cause the tutorial I was following had some other things like this.texture=""; which is no longer available. What should I be using then?

 

EDIT: this.setEntityHealth(15F); I used this instead of the health one.

Link to comment
Share on other sites

entities are no longer handling their textures, so the entity does not have a texture field or any texture methods :)

 

the EntityRenderer handles the texture.

It's using the new resource pack system.

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

entities are no longer handling their textures, so the entity does not have a texture field or any texture methods :)

 

the EntityRenderer handles the texture.

It's using the new resource pack system.

 

Oh okay, so the texture code would go...where? Also, I'm having a hard time debugging my code from within eclipse. All of a sudden for some strange reason, none of my mods are working. They are causing a crash relating to proxy injectors.

 

EDIT: Sorry for the newbieness, I just started making mods. My previous mod was a crafting recipe, but for some reason now is causing the wrapped game to crash.

Link to comment
Share on other sites

Put the texture info in your entity renderer. Like RenderMob or such.

 

Okay I dont' have that, or is the same as this?

package kmccmk9.witchCraft.client;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class ModelBee extends ModelBase
{
  //fields
    ModelRenderer BeeBody;
    ModelRenderer BeeHead;
    ModelRenderer ant1;
    ModelRenderer ant2;
    ModelRenderer wing2;
    ModelRenderer wing1;
  
  public ModelBee()
  {
    textureWidth = 64;
    textureHeight = 32;
    
      BeeBody = new ModelRenderer(this, 0, 0);
      BeeBody.addBox(0F, 0F, 0F, 5, 4, ;
      BeeBody.setRotationPoint(-3F, -3F, -4F);
      BeeBody.setTextureSize(64, 32);
      BeeBody.mirror = true;
      setRotation(BeeBody, 0F, 0F, 0F);
      BeeHead = new ModelRenderer(this, 19, 2);
      BeeHead.addBox(0F, 0F, 0F, 3, 3, 2);
      BeeHead.setRotationPoint(-2F, -4F, -6F);
      BeeHead.setTextureSize(64, 32);
      BeeHead.mirror = true;
      setRotation(BeeHead, 0F, 0F, 0F);
      ant1 = new ModelRenderer(this, 0, 0);
      ant1.addBox(0F, 0F, 0F, 1, 4, 1);
      ant1.setRotationPoint(1F, -7F, -5F);
      ant1.setTextureSize(64, 32);
      ant1.mirror = true;
      setRotation(ant1, 0F, 0F, 0.2722714F);
      ant2 = new ModelRenderer(this, 0, 0);
      ant2.addBox(0F, 0F, 0F, 1, 4, 1);
      ant2.setRotationPoint(-3F, -7F, -5F);
      ant2.setTextureSize(64, 32);
      ant2.mirror = true;
      setRotation(ant2, 0F, 0F, -0.2617994F);
      wing2 = new ModelRenderer(this, 29, 0);
      wing2.addBox(0F, 0F, 0F, 4, 1, 3);
      wing2.setRotationPoint(-7F, -3F, -1F);
      wing2.setTextureSize(64, 32);
      wing2.mirror = true;
      setRotation(wing2, 0F, 0F, 0.1745329F);
      wing1 = new ModelRenderer(this, 29, 0);
      wing1.addBox(0F, 0F, 0F, 4, 1, 3);
      wing1.setRotationPoint(2F, -2F, -1F);
      wing1.setTextureSize(64, 32);
      wing1.mirror = true;
      setRotation(wing1, 0F, 0F, -0.1745329F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    BeeBody.render(f5);
    BeeHead.render(f5);
    ant1.render(f5);
    ant2.render(f5);
    wing2.render(f5);
    wing1.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.