Topic category: Help with Minecraft modding (Java Edition)
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);
}
}
So can you tell me what this is? Is it transparent armor?
Yes, i think, because of the name in the "text". There was the Name: "InvisibleArmorBody"
Perhaps I can help create one for you.
Okay so I did it. Do this step by step
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!