help me on this please.

Started by techno381978 on Sat, 03/23/2019 - 21:47

Topic category: Help with modding

Last seen on 17:18, 4. Aug 2019
Joined Mar 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
help me on this please.
Sat, 03/23/2019 - 21:47

I am having problems with my mod.  It works in test but won't be transparent like it should.  Also it will not run normally.

 

package mod.mcreator;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.util.EnumHelper;

import net.minecraft.item.ItemArmor;
import net.minecraft.item.Item;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;

public class mcreator_invisiblearmor extends armor_texture.ModElement {

    public static Item helmet;
    public static Item body;
    public static Item legs;
    public static Item boots;
    static {
        ItemArmor.ArmorMaterial enuma = EnumHelper
                .addArmorMaterial("INVISIBLEARMOR", "armor", 1024, new int[]{1024, 1024, 1024, 1024}, 100, null, 5f);
        helmet = (new ItemArmor(enuma, 0, EntityEquipmentSlot.HEAD)).setUnlocalizedName("invisiblearmorhelmet");
        helmet.setMaxStackSize(1);
        body = (new ItemArmor(enuma, 0, EntityEquipmentSlot.CHEST)).setUnlocalizedName("invisiblearmorbody");
        body.setMaxStackSize(1);
        legs = (new ItemArmor(enuma, 0, EntityEquipmentSlot.LEGS)).setUnlocalizedName("invisiblearmorlegs");
        legs.setMaxStackSize(1);
        boots = (new ItemArmor(enuma, 0, EntityEquipmentSlot.FEET)).setUnlocalizedName("invisiblearmorboots");
        boots.setMaxStackSize(1);
        helmet.setRegistryName("invisiblearmorhelmet");
        ForgeRegistries.ITEMS.register(helmet);
        body.setRegistryName("invisiblearmorbody");
        ForgeRegistries.ITEMS.register(body);
        legs.setRegistryName("invisiblearmorlegs");
        ForgeRegistries.ITEMS.register(legs);
        boots.setRegistryName("invisiblearmorboots");
        ForgeRegistries.ITEMS.register(boots);
    }

    @Override
    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT) {
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(helmet, 0, new ModelResourceLocation("armor_texture:invisiblearmorhelmet", "inventory"));
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(body, 0, new ModelResourceLocation("armor_texture:invisiblearmorbody", "inventory"));
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(legs, 0, new ModelResourceLocation("armor_texture:invisiblearmorlegs", "inventory"));
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(boots, 0, new ModelResourceLocation("armor_texture:invisiblearmorboots", "inventory"));
        }
        helmet.setCreativeTab(CreativeTabs.COMBAT);
        body.setCreativeTab(CreativeTabs.COMBAT);
        legs.setCreativeTab(CreativeTabs.COMBAT);
        boots.setCreativeTab(CreativeTabs.COMBAT);
    }
}
 

Last seen on 15:12, 21. Oct 2019
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
So can you tell me what this…
Mon, 10/07/2019 - 21:17

So can you tell me what this is? Is it transparent armor?

Last seen on 15:04, 22. May 2020
Joined Feb 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Yes, i think, because of the…
Tue, 10/15/2019 - 17:28

Yes, i think, because of the name in the "text". There was the Name: "InvisibleArmorBody"

Last seen on 15:12, 21. Oct 2019
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Perhaps I can help create…
Thu, 10/17/2019 - 12:34

Perhaps I can help create one for you.

 

Last seen on 15:12, 21. Oct 2019
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
Okay so I did it. Do this…
Thu, 10/17/2019 - 12:51

Okay so I did it. Do this step by step

  • Navigate to resources
  • Create new Texture
  • Create Armor Texture
  • Do any color
  • Click save this armor
  • give it any name without spaces. Use underscore for spacing
  • The Armor textures are created
  • Now seperately open each armor texture
  • erase the entire texture and save it. repeat this step on the rest of the armor textures

you now have a transparent armor ready to use! I tried this just now and i was pleased with the results. It runs just fine too! They will be however invisible just as intended. If you want it to be visible for you to find in your inventory tab, leave the seperate textures alone. Just use the eraser on the Textures for armor textures. Hope this helps you!