help me on this please.

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

Topic category: Help with MCreator modding

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

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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);
    }
}