Jump to content

Recommended Posts

Posted

hello,

 

So I've got my mob (the Nutcracker) using its new model and is animated (more or less), so now I just need to texture it.  I've made a custom texture that I've confirmed fits it in Techne.  However, no matter where I put it, I can't seem to get the mob to use the texture, and all I end up with is a white model with the text "missing texture" on it.  Here is the EntityNutcracker class:

 

 

package tutorial.generic.entity;

 

import net.minecraft.entity.EntityAgeable;

import net.minecraft.entity.ai.EntityAIFollowParent;

import net.minecraft.entity.ai.EntityAILookIdle;

import net.minecraft.entity.ai.EntityAIMate;

import net.minecraft.entity.ai.EntityAIPanic;

import net.minecraft.entity.ai.EntityAISwimming;

import net.minecraft.entity.ai.EntityAITempt;

import net.minecraft.entity.ai.EntityAIWander;

import net.minecraft.entity.ai.EntityAIWatchClosest;

import net.minecraft.entity.passive.EntityAnimal;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.item.Item;

import net.minecraft.world.World;

 

 

 

//Your declaration. If your mob swims, change EntityAnimal to EntityWaterMob.

public class EntityNutcracker extends EntityAnimal {

       

        public EntityNutcracker(World par1World) {

                super(par1World);

                this.texture = "tutorial/generic/textures/mobs/Nutcracker.png";

                //The below means if possible, it wont walk into water

                this.getNavigator().setAvoidsWater(true);

                //This is the hitbox size. I believe it starts in the center and grows outwards

                this.setSize(1.5F, 0.9F);

                //Pretty self-explanatory.

                this.isImmuneToFire = false;

                float var2 = 0.25F;

 

                //Now, we have the AI. Each number in the addTask is a priority. 0 is the highest, the largest is lowest.

                //They should be set in the order which the mob should focus, because it can only do one thing at a time. I'll explain my choice for order below.

                //There are tonnes of tasks you can add. Look in the JavaDocs or other mob classes to find some more!

 

                //Swimming should ALWAYS be first. Otherwise if your mob falls in water, but it's running away from you or something it'll drown.

                this.tasks.addTask(0, new EntityAISwimming(this));

 

                //This code is used to get the mob to follow you (like cows with wheat). Here it's set to a custom fruit

                this.tasks.addTask(1, new EntityAITempt(this, 0.3F, Item.coal.itemID, false));

 

                //This makes the mob walk around. Without it, it'd just stand still.

                this.tasks.addTask(2, new EntityAIWander(this, var2));

 

                //This makes the mob watch the nearest player, within a range set by the float.

                this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));

 

                //Finally, this makes it look around when it's not looking at a player or wandering.

                this.tasks.addTask(4, new EntityAILookIdle(this));

        }

 

        //This is required. If it's false, none of the above takes effect.

        public boolean isAIEnabled() {

                return true;

        }

       

        //Pretty obvious, set it's health!

        public int getMaxHealth() {

                return 10;

        }

       

        //The sound effect played when it's just living, like a cow mooing.

        protected String getLivingSound() {

                return "mob.enderman.idle";

        }

       

        //The sound made when it's attacked. Often it's the same as the normal say sound, but sometimes different (such as in the ender dragon)

        protected String getHurtSound() {

                return "mob.enderman.scream";

        }

       

        //The sound made when it actually dies.

        protected String getDeathSound() {

                return "mob.enderman.death";

        }

 

        //The sound the mob plays when walking around. 

        protected void playStepSound(int par1, int par2, int par3, int par4) {

                this.worldObj.playSoundAtEntity(this, "mob.enderman.step", 0.15F,  1.0F);

        }

       

        //A basic example of what a mob should drop on death. For more advanced examples, look at code for chicken or squid.

        protected int getDropItemId() {

                return Item.coal.itemID;

        }

       

        //This is required regardless of if your animal can breed or not. Set to null if it can't breed - I wont cover breeding here.

        public EntityAgeable createChild1(EntityAgeable var1) {

                return null;

        }

 

@Override

public EntityAgeable createChild(EntityAgeable entityageable) {

// TODO Auto-generated method stub

return null;

}

protected boolean isValidLightLevel()

{

    return true; //lets it spawn during the day

}

}

 

 

I've searched many threads on the forums, but to no avail of helping me.  Any help would be greatly appreciated.

 

Greenman

 

EDIT: My bad, I actually figured it out.  Locking the topic, a mod can delete this.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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