Posted July 28, 201510 yr hi i have a problem, i've made an entity and it works fine. the problem is i need to give it more than one texture, like the horse has 4-5 ish diffrent textures. public class EntityButtMob extends EntityAnimal{ private int r; public ResourceLocation texture1, texture2, texture3, texture4, texture5, texture6, texture7, texture8, texture9; public static ResourceLocation TE; public EntityButtMob(World par1World) { super(par1World); this.setSize(0.5F, 0.4F); this.tasks.addTask(0, new EntityAIWander(this, 0.5D)); this.tasks.addTask(1, new EntityAIPanic(this, 1.0D)); this.tasks.addTask(2, new EntityAITempt(this, 0.7D, Items.beef, false)); this.tasks.addTask(4, new EntityAIFollowParent(this, 1.1D)); this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); Random rand = new Random(); r = rand.nextInt(; switch®{ case 1: TE = texture1; break; case 2: TE = texture2; break; case 3: TE = texture3; break; case 4: TE = texture4; break; case 5: TE = texture5; break; case 6: TE = texture6; break; case 7: TE = texture7; break; case 8: TE = texture8; break; default: TE = texture9; } } public boolean isAIEnabled(){ return true; } protected void applyEntityAttributes(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(16.0F); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D); } @Override public EntityAgeable createChild(EntityAgeable age) { return new EntityButtMob(worldObj); } public boolean isBreedingItem(ItemStack item) { return item != null && item.getItem() == ItemReg.RainbowPowder; } } public class RenderButtMob extends RenderLiving { private static ResourceLocation texture1 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_blue.png"); private static ResourceLocation texture2 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_gray.png"); private static ResourceLocation texture3 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_green.png"); private static ResourceLocation texture4 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_lime.png"); private static ResourceLocation texture5 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_orange.png"); private static ResourceLocation texture6 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_pink.png"); private static ResourceLocation texture7 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_purple.png"); private static ResourceLocation texture8 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_red.png"); private static ResourceLocation texture9 = new ResourceLocation(Strings.MODID + ":" + "textures/model/numse_yellow.png"); protected ModelButtMob modelEntity; public RenderButtMob(ModelBase par1ModelBase, float par2) { super(par1ModelBase, par2); modelEntity = ((ModelButtMob) mainModel); } public void renderButt(EntityButtMob entity, double x, double y, double z, float u, float v) { super.doRender(entity, x, y, z, u, v); } public void doRenderLiving(EntityLiving entityliving, double x, double y, double z, float u, float v) { renderButt((EntityButtMob) entityliving, x, y, z, u, v); } public void doRender(Entity entity, double x, double y, double z, float u, float v) { renderButt((EntityButtMob) entity, x, y, z, u, v); } int l = 1; private ResourceLocation p; @Override protected ResourceLocation getEntityTexture(Entity var1) { return EntityButtMob.TE; } }
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.