Make someone and their armour invisible

Started by FerretWithACatHatYT on Thu, 09/24/2020 - 20:56

Topic category: Help with modding (Java Edition)

Last seen on 19:17, 14. Jun 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make someone and their armour invisible
Thu, 09/24/2020 - 20:56

I am making a ninja mod with an armour that makes you invisible. Using the potion effect has the problem of your armour still showing up.

Is there a solution?

Last seen on 02:50, 20. Jun 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
go into your textures and…
Thu, 10/01/2020 - 23:51

go into your textures and edit your armor, select white and turn the opacity to 0, use the fill tool and boom, invisible armor 

Last seen on 19:17, 14. Jun 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It should only be invisible…
Sun, 10/18/2020 - 09:38

It should only be invisible when the full set is on and on a cooldown thing

Last seen on 17:22, 8. Jun 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
making armor invisible…
Sun, 10/18/2020 - 17:18

making armor invisible requires a tiny bit of coding.

first make a blank 64x32 texture. then lock and edit the armor element, find the lines:

protected ResourceLocation getEntityTexture(Entity entity) {
    return new ResourceLocation("yourmodid:textures/your_helmet.png");
}

and edit it like this:

protected ResourceLocation getEntityTexture(Entity entity) {
    if (entity.isInvisible()) {
        return new ResourceLocation("yourmodid:textures/blank.png");
    }
    return new ResourceLocation("yourmodid:textures/your_helmet.png");
}

kind of like that.

Last seen on 03:41, 24. Mar 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
So I'm trying to do this…
Mon, 02/01/2021 - 05:02

So I'm trying to do this whole invisible armor thing as well that's tied to the boots. So far I have it so that the boots give the invisibility potion effect to the player if they're in a light level that's less than 5. I want to be able to make the entire player invisible (including the armor) when the conditions are met. Here's the thing though, I made a blank 64 x 32 texture, I locked the armor set element then went to edit it's code but I'm not seeing either of those lines of code. There's some similarities but nothing completely matching, and by that I mean "protected" and "return new" aren't showing up at all among some other differences.

Last seen on 17:22, 8. Jun 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
what version minecraft? show…
Mon, 02/01/2021 - 09:50

what version minecraft? show me that piece of code that has getEntityTexture

Last seen on 03:41, 24. Mar 2021
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
1.15.3, it's the farthest I…
Mon, 02/01/2021 - 17:04

1.15.3, it's the farthest I can go with MCreator at the moment.

public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type) {
                return "arcson:textures/models/armor/dekruutian_layer_" + (slot == EquipmentSlotType.LEGS ? "2" : "1") + ".png";
            }

Last seen on 17:22, 8. Jun 2021
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ah, i made a mistake in the…
Tue, 02/02/2021 - 06:58

ah, i made a mistake in the previous post. should be overriding the getArmorTexture method:

@Override
public String getArmorTexture(ItemStack stack, Entity entity, EquipmentSlotType slot, String type){
    if (entity.isInvisible()) {
        return "arcson:textures/[your blank texture]";
    }
    return "arcson:textures/models/armor/dekruutian_layer_" + (slot == EquipmentSlotType.LEGS ? "2" : "1") + ".png"
}