Posted August 23, 20169 yr hi i write on my mod and add armor but if i wrote this and "0,1,2,3" is red (Type mismatch:Cannot convert from int to EntityEquipmentSlot") what do i wrong?: package com.PlasticMod.items; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemArmor; public class ItemPlasticArmor<IconRegister> extends ItemArmor{ public ItemPlasticArmor(ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); switch(armorType){ case 0:setUnlocalizedName("plastichelmet"); break; case 1:setUnlocalizedName("plasticchest"); break; case 2:setUnlocalizedName("plasticlegs"); break; case 3:setUnlocalizedName("plasticboots"); break; } } }
August 23, 20169 yr It now takes a EntityEquipmentType... VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 23, 20169 yr First: put it in a code field Second: It should look a little like this public class ItemPlasticArmor extends ItemArmor { public ItemPlasticArmor(ArmorMaterial materialIn, EntityEquipmentSlot equipmentSlotIn, String name) { super(materialIn, 0, equipmentSlotIn); this.setUnlocalizedName(name); this.setRegistryName(name); } public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { if (slot == EntityEquipmentSlot.HEAD || slot == EntityEquipmentSlot.CHEST || slot == EntityEquipmentSlot.FEET) { return "ID:textures/models/armor/armor_layer_1.png"; } else if (slot == EntityEquipmentSlot.LEGS) { return "ID:textures/models/armor/armor_layer_2.png"; } else { return null; } } } http://i.imgur.com/J4rrGt6.png[/img]
August 23, 20169 yr And then in your items class it would be something like this: public class PlasticItems { public static ArmorMaterial plastic_armor_material; public static Item PLASTIC_HELMET; public static Item PLASTIC_CHESTPLATE; public static Item PLASTIC_LEGGINGS; public static Item PLASTIC_BOOTS; public static void init() { plastic_armor_material = EnumHelper.addArmorMaterial("plastic_armor_material", "", 473, new int[] {3, 6, 8, 3}, 17, SoundEvents.ENTITY_EGG_THROW, 3); PLASTIC_HELMET = new ItemPlasticArmor(plastic_armor_material, EntityEquipmentSlot.HEAD, "plastic_helmet").setCreativeTab(CreativeTabs.COMBAT); PLASTIC_CHESTPLATE = new ItemPlasticArmor(plastic_armor_material, EntityEquipmentSlot.CHEST, "plastic_chestplate").setCreativeTab(CreativeTabs.COMBAT); PLASTIC_LEGGINGS = new ItemPlasticArmor(plastic_armor_material, EntityEquipmentSlot.LEGS, "plastic_leggings").setCreativeTab(CreativeTabs.COMBAT); PLASTIC_BOOTS = new ItemPlasticArmor(plastic_armor_material, EntityEquipmentSlot.FEET, "plastic_boots").setCreativeTab(CreativeTabs.COMBAT); } public static void register() { GameRegistry.register(PLASTIC_HELMET); GameRegistry.register(PLASTIC_CHESTPLATE); GameRegistry.register(PLASTIC_LEGGINGS); GameRegistry.register(PLASTIC_BOOTS); } } http://i.imgur.com/J4rrGt6.png[/img]
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.