Jump to content

Recommended Posts

Posted

So im working on a mod where a full set of the same type of armor should become invisible when the player is invisible.

Im only interested in how i make the armor invisible

 

Helmet.class

 

  Reveal hidden contents

 

Posted

Can you give me an example of the basics?

 

I also have an update on the Helmet.class

 

  Reveal hidden contents

 

Posted

A real simple solution is this:

 

@Override
@SideOnly(Side.CLIENT) 
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { 
return new InvisibleArmorRender();
}

public class InvisibleArmorRender extends ModelBiped{
      public InvisibleArmorRender(){
            super();
      }

      public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float  par6, float par7){
      }
}

 

Put that in your armor class.

Not all things in the world are red, there are round objects too!

Posted

The armor is now invisible, but it is invisible even when i'm not invisible

 

 

  Reveal hidden contents

 

 

I need to make it so it only runs through the getModelArmor when i'm invisible, but i thought that this would do the trick :/

 

 

  Reveal hidden contents

 

 

But it looks like it runs through the getArmorModel even without this

Posted
  On 2/3/2016 at 11:22 PM, skyfir3 said:

The armor is now invisible, but it is invisible even when i'm not invisible

 

 

  Reveal hidden contents

 

 

I need to make it so it only runs through the getModelArmor when i'm invisible, but i thought that this would do the trick :/

 

 

  Reveal hidden contents

 

 

But it looks like it runs through the getArmorModel even without this

 

try to add an if-statement at:

@Override
@SideOnly(Side.CLIENT) 
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { 
return new InvisibleArmorRender();
}

 

do something like this:

 

public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { 

if(player.isInvisible){	
return new InvisibleArmorRender();
}
else { return //and here the normal renderer }
}

"My Crew is World Wide." 「ヤング • エルトウ」

Posted

yeah, the getArmorModel is always called. its an override.

 

You must check in this if the player is invisible, if the the player is not, then just return.

public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {

return new InvisibleArmorRender();
  }

 

So maybe you vill have to set an boolean in onArmorTick

Not all things in the world are red, there are round objects too!

Posted

Thank you so much!

The solution was right in front of meh, but i put the if(player.isInvisible()) the wrong place.

 

 

  Reveal hidden contents

 

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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