Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

hi  ;D

 

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(8);

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.