I Recently started adding another item to my mod, which is based on the code for the egg, and when I wanted to apply my own texture to the projectile entity, I couldn't figure out how to do it. When I test this in game using the default egg code, no sprite shows up but the entity still exists, and I cant find a reference to the texture anywhere on the code. Any suggestions?
Here is my code for the projectile entity that I want to apply a sprite to.
package net.minecraft.entity.projectile;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityEgg extends EntityThrowable
{
public EntityEgg(World par1World)
{
super(par1World);
}
public EntityEgg(World par1World, EntityLivingBase par2EntityLivingBase)
{
super(par1World, par2EntityLivingBase);
}
public EntityEgg(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
}
if (!this.worldObj.isRemote && this.rand.nextInt( == 0)
{
byte b0 = 1;
if (this.rand.nextInt(32) == 0)
{
b0 = 4;
}
for (int i = 0; i < b0; ++i)
{
EntityChicken entitychicken = new EntityChicken(this.worldObj);
entitychicken.setGrowingAge(-24000);
entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
this.worldObj.spawnEntityInWorld(entitychicken);
}
}
for (int j = 0; j < 8; ++j)
{
this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
}
if (!this.worldObj.isRemote)
{
this.setDead();
}
}
}