supreme marshal Posted April 14, 2018 Posted April 14, 2018 (edited) So I have no idea why this is not working when it should. I just want to add Resistance III when full dragon armor is equipped. package com.SupremeMarshal.MoreToolsTierMod.objects.armor; import com.SupremeMarshal.MoreToolsTierMod.Main; import com.SupremeMarshal.MoreToolsTierMod.init.ModItems; import com.SupremeMarshal.MoreToolsTierMod.util.interfaces.IHasModel; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class DragonArmorBase extends ItemArmor implements IHasModel { public DragonArmorBase(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.COMBAT); ModItems.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } ///add potion effect to full set of armor @Override public void onArmorTick(World world, EntityPlayer player, ItemStack item) { if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ModItems.DRAGON_BODY && player.inventory.armorItemInSlot(1).getItem() == ModItems.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ModItems.DRAGON_BOOTS && player.inventory.armorItemInSlot(3).getItem() == ModItems.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 2, 0)); } } } } I had also a problem about giving health and regeneration when full armor set is equipped but now it's all solved. Here is my final codes: package com.SupremeMarshal.MoreToolsTierMod.objects.armor; import java.util.UUID; import com.SupremeMarshal.MoreToolsTierMod.Main; import com.SupremeMarshal.MoreToolsTierMod.init.ItemInit; import com.SupremeMarshal.MoreToolsTierMod.util.interfaces.IHasModel; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.BaseAttribute; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionType; import net.minecraft.world.World; public class DragonArmorBase extends ItemArmor implements IHasModel { public DragonArmorBase(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.COMBAT); ItemInit.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } //////UUID////// //DRAGON ARMOR// //HEALTH// -- Total = 40 Health protected static final UUID MAX_HEALTH_DFULL_UUID = UUID.fromString("fdd721e0-bcb0-4963-9c03-ace14c6ceae4"); private static final AttributeModifier HEALTH_BOOST_DFULL = new AttributeModifier (MAX_HEALTH_DFULL_UUID, "MAX_HEALTH_DFULL_UUID", 10, 0); protected static final UUID MAX_HEALTH_DHELM_UUID = UUID.fromString("cfb80931-3fc9-4e5a-9760-213aee2dce98"); private static final AttributeModifier HEALTH_BOOST_DHELM = new AttributeModifier (MAX_HEALTH_DHELM_UUID, "MAX_HEALTH_DHELM_UUID", 5, 0); protected static final UUID MAX_HEALTH_DBODY_UUID = UUID.fromString("122785ee-9867-4ace-af8b-745932039e73"); private static final AttributeModifier HEALTH_BOOST_DBODY = new AttributeModifier (MAX_HEALTH_DBODY_UUID, "MAX_HEALTH_DBODY_UUID", 10, 0); protected static final UUID MAX_HEALTH_DLEGS_UUID = UUID.fromString("a5c77a84-5a15-4752-9f07-599a3a2e4c9f"); private static final AttributeModifier HEALTH_BOOST_DLEGS = new AttributeModifier (MAX_HEALTH_DLEGS_UUID, "MAX_HEALTH_DLEGS_UUID", 10, 0); protected static final UUID MAX_HEALTH_DBOOTS_UUID = UUID.fromString("f3fb329d-4923-4aa1-bef8-d0728f4b7abd"); private static final AttributeModifier HEALTH_BOOST_DBOOTS = new AttributeModifier (MAX_HEALTH_DBOOTS_UUID, "MAX_HEALTH_DBOOTS_UUID", 5, 0); //KNOCKBACK RESISTANCE -- Total = 80% protected static final UUID KNOCKBACK_RESISTANCE_DFULL_UUID = UUID.fromString("a5f4ce17-c5b7-4791-979c-b55018c2e89c"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DFULL = new AttributeModifier (KNOCKBACK_RESISTANCE_DFULL_UUID, "KNOCKBACK_RESISTANCE_DFULL_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DHELM_UUID = UUID.fromString("5619ab81-25e6-43e1-85e8-0a11be2b0bcd"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DHELM = new AttributeModifier (KNOCKBACK_RESISTANCE_DHELM_UUID, "KNOCKBACK_RESISTANCE_DHELM_UUID", 10, 0); protected static final UUID KNOCKBACK_RESISTANCE_DBODY_UUID = UUID.fromString("ecec32f1-c5b5-4921-98ba-e1717a3befa4"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DBODY = new AttributeModifier (KNOCKBACK_RESISTANCE_DBODY_UUID, "KNOCKBACK_RESISTANCE_DBODY_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DLEGS_UUID = UUID.fromString("1726437a-2fba-42b9-a3f7-56a777740037"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DLEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_DLEGS_UUID, "KNOCKBACK_RESISTANCE_DLEGS_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DBOOTS_UUID = UUID.fromString("7ffe2d12-c540-407b-8df6-101450ab8a5b"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DBOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_DBOOTS_UUID, "KNOCKBACK_RESISTANCE_DBOOTS_UUID", 10, 0); //RUNE ARMOR// //HEALTH// == Total = 30 Health protected static final UUID MAX_HEALTH_RFULL_UUID = UUID.fromString("a0e262b5-076c-44c8-bb79-f78a6d534f91"); private static final AttributeModifier HEALTH_BOOST_RFULL = new AttributeModifier (MAX_HEALTH_RFULL_UUID, "MAX_HEALTH_RFULL_UUID", 7, 0); protected static final UUID MAX_HEALTH_RHELM_UUID = UUID.fromString("0a1676a7-3214-4f76-8c4e-7534c8f13941"); private static final AttributeModifier HEALTH_BOOST_RHELM = new AttributeModifier (MAX_HEALTH_RHELM_UUID, "MAX_HEALTH_RHELM_UUID", 4, 0); protected static final UUID MAX_HEALTH_RBODY_UUID = UUID.fromString("55d9df5c-62e7-4723-906f-fb1a71082ffa"); private static final AttributeModifier HEALTH_BOOST_RBODY = new AttributeModifier (MAX_HEALTH_RBODY_UUID, "MAX_HEALTH_RBODY_UUID", 8, 0); protected static final UUID MAX_HEALTH_RLEGS_UUID = UUID.fromString("fac0ccb6-401a-4a81-b32d-697e63c60635"); private static final AttributeModifier HEALTH_BOOST_RLEGS = new AttributeModifier (MAX_HEALTH_RLEGS_UUID, "MAX_HEALTH_RLEGS_UUID", 7, 0); protected static final UUID MAX_HEALTH_RBOOTS_UUID = UUID.fromString("6a92e0f4-900f-45c8-811c-2f9331a988ae"); private static final AttributeModifier HEALTH_BOOST_RBOOTS = new AttributeModifier (MAX_HEALTH_RBOOTS_UUID, "MAX_HEALTH_RBOOTS_UUID", 4, 0); //KNOCKBACK RESISTANCE -- Total = 60% protected static final UUID KNOCKBACK_RESISTANCE_RFULL_UUID = UUID.fromString("f8c6fea8-0722-4995-ab3a-dac616080b0b"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_RFULL = new AttributeModifier (KNOCKBACK_RESISTANCE_RFULL_UUID, "KNOCKBACK_RESISTANCE_RFULL_UUID", 15, 0); protected static final UUID KNOCKBACK_RESISTANCE_RHELM_UUID = UUID.fromString("f8215f0e-c22a-4c66-af66-94d50b8ed73c"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_RHELM = new AttributeModifier (KNOCKBACK_RESISTANCE_RHELM_UUID, "KNOCKBACK_RESISTANCE_RHELM_UUID", 8, 0); protected static final UUID KNOCKBACK_RESISTANCE_RBODY_UUID = UUID.fromString("743d9294-493d-4741-85b0-b469cbd7f5fa"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_RBODY = new AttributeModifier (KNOCKBACK_RESISTANCE_RBODY_UUID, "KNOCKBACK_RESISTANCE_RBODY_UUID", 15, 0); protected static final UUID KNOCKBACK_RESISTANCE_RLEGS_UUID = UUID.fromString("448ac581-0bf5-41ac-99ff-152a173cb66c"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_RLEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_RLEGS_UUID, "KNOCKBACK_RESISTANCE_RLEGS_UUID", 14, 0); protected static final UUID KNOCKBACK_RESISTANCE_RBOOTS_UUID = UUID.fromString("d084a93a-1d56-4460-92e4-2982ecc0070a"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_RBOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_RBOOTS_UUID, "KNOCKBACK_RESISTANCE_RBOOTS_UUID", 8, 0); //ADAMANT ARMOR// //HEALTH// == Total = 20 Health protected static final UUID MAX_HEALTH_AFULL_UUID = UUID.fromString("d06e64c4-2828-4fde-bef2-7165b566fbe5"); private static final AttributeModifier HEALTH_BOOST_AFULL = new AttributeModifier (MAX_HEALTH_AFULL_UUID, "MAX_HEALTH_AFULL_UUID", 5, 0); protected static final UUID MAX_HEALTH_AHELM_UUID = UUID.fromString("911368e8-e5bd-46ff-a3d3-13685d1493da"); private static final AttributeModifier HEALTH_BOOST_AHELM = new AttributeModifier (MAX_HEALTH_AHELM_UUID, "MAX_HEALTH_AHELM_UUID", 3, 0); protected static final UUID MAX_HEALTH_ABODY_UUID = UUID.fromString("8addf34c-882f-4c94-88aa-04e5c78ff2f3"); private static final AttributeModifier HEALTH_BOOST_ABODY = new AttributeModifier (MAX_HEALTH_ABODY_UUID, "MAX_HEALTH_ABODY_UUID", 5, 0); protected static final UUID MAX_HEALTH_ALEGS_UUID = UUID.fromString("0a16b40e-aa4a-4be3-abb9-3ea38d7c8c35"); private static final AttributeModifier HEALTH_BOOST_ALEGS = new AttributeModifier (MAX_HEALTH_ALEGS_UUID, "MAX_HEALTH_ALEGS_UUID", 4, 0); protected static final UUID MAX_HEALTH_ABOOTS_UUID = UUID.fromString("c3a3b300-d7ad-4bc4-87b6-8cd788975261"); private static final AttributeModifier HEALTH_BOOST_ABOOTS = new AttributeModifier (MAX_HEALTH_ABOOTS_UUID, "MAX_HEALTH_ABOOTS_UUID", 3, 0); //KNOCKBACK RESISTANCE -- Total = 40% protected static final UUID KNOCKBACK_RESISTANCE_AFULL_UUID = UUID.fromString("772d851e-71cf-4021-9f99-17ae650a230f"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_AFULL = new AttributeModifier (KNOCKBACK_RESISTANCE_AFULL_UUID, "KNOCKBACK_RESISTANCE_AFULL_UUID", 9, 0); protected static final UUID KNOCKBACK_RESISTANCE_AHELM_UUID = UUID.fromString("6ffbd625-2a36-49b8-b752-b3c267f63577"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_AHELM = new AttributeModifier (KNOCKBACK_RESISTANCE_AHELM_UUID, "KNOCKBACK_RESISTANCE_AHELM_UUID", 6, 0); protected static final UUID KNOCKBACK_RESISTANCE_ABODY_UUID = UUID.fromString("08a7a3d4-456b-482b-ae5c-e832d8749eb0"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_ABODY = new AttributeModifier (KNOCKBACK_RESISTANCE_ABODY_UUID, "KNOCKBACK_RESISTANCE_ABODY_UUID", 10, 0); protected static final UUID KNOCKBACK_RESISTANCE_ALEGS_UUID = UUID.fromString("d10b9e4b-0712-4d07-9000-89896b9c8b9d"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_ALEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_ALEGS_UUID, "KNOCKBACK_RESISTANCE_ALEGS_UUID", 9, 0); protected static final UUID KNOCKBACK_RESISTANCE_ABOOTS_UUID = UUID.fromString("385650fc-a5c6-4223-8338-ef04ebbfcdd0"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_ABOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_ABOOTS_UUID, "KNOCKBACK_RESISTANCE_ABOOTS_UUID", 6, 0); //MITHRIL ARMOR// //HEALTH// == Total = 10 Health protected static final UUID MAX_HEALTH_MFULL_UUID = UUID.fromString("c089b172-9445-4a3f-b1a9-72ead6d595bb"); private static final AttributeModifier HEALTH_BOOST_MFULL = new AttributeModifier (MAX_HEALTH_MFULL_UUID, "MAX_HEALTH_MFULL_UUID", 3, 0); protected static final UUID MAX_HEALTH_MHELM_UUID = UUID.fromString("fede80f4-36f0-4d6b-aa9b-f19a14562e1f"); private static final AttributeModifier HEALTH_BOOST_MHELM = new AttributeModifier (MAX_HEALTH_MHELM_UUID, "MAX_HEALTH_MHELM_UUID", 1, 0); protected static final UUID MAX_HEALTH_MBODY_UUID = UUID.fromString("6e0a9314-c2ea-43af-a186-275001c96c6c"); private static final AttributeModifier HEALTH_BOOST_MBODY = new AttributeModifier (MAX_HEALTH_MBODY_UUID, "MAX_HEALTH_MBODY_UUID", 3, 0); protected static final UUID MAX_HEALTH_MLEGS_UUID = UUID.fromString("e65314f2-5b22-4906-8f6e-78e537e63fa6"); private static final AttributeModifier HEALTH_BOOST_MLEGS = new AttributeModifier (MAX_HEALTH_MLEGS_UUID, "MAX_HEALTH_MLEGS_UUID", 2, 0); protected static final UUID MAX_HEALTH_MBOOTS_UUID = UUID.fromString("c74f0334-f073-41f2-bfbe-381a8e778278"); private static final AttributeModifier HEALTH_BOOST_MBOOTS = new AttributeModifier (MAX_HEALTH_MBOOTS_UUID, "MAX_HEALTH_MBOOTS_UUID", 1, 0); //KNOCKBACK RESISTANCE -- Total = 20% protected static final UUID KNOCKBACK_RESISTANCE_MFULL_UUID = UUID.fromString("8a374b9a-cd6b-4945-8e1b-1e7654ea3205"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_MFULL = new AttributeModifier (KNOCKBACK_RESISTANCE_MFULL_UUID, "KNOCKBACK_RESISTANCE_MFULL_UUID", 5, 0); protected static final UUID KNOCKBACK_RESISTANCE_MHELM_UUID = UUID.fromString("551c19fb-99ed-4bfd-88dc-b627f83fe3fa"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_MHELM = new AttributeModifier (KNOCKBACK_RESISTANCE_MHELM_UUID, "KNOCKBACK_RESISTANCE_MHELM_UUID", 3, 0); protected static final UUID KNOCKBACK_RESISTANCE_MBODY_UUID = UUID.fromString("8b86e5c0-94ba-44ec-9a60-637e7e8380e0"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_MBODY = new AttributeModifier (KNOCKBACK_RESISTANCE_MBODY_UUID, "KNOCKBACK_RESISTANCE_MBODY_UUID", 5, 0); protected static final UUID KNOCKBACK_RESISTANCE_MLEGS_UUID = UUID.fromString("807f3922-1511-40ed-a458-f3b6c57d2718"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_MLEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_MLEGS_UUID, "KNOCKBACK_RESISTANCE_MLEGS_UUID", 4, 0); protected static final UUID KNOCKBACK_RESISTANCE_MBOOTS_UUID = UUID.fromString("7a19419a-9c07-4b9b-947c-e87a9a93a627"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_MBOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_MBOOTS_UUID, "KNOCKBACK_RESISTANCE_MBOOTS_UUID", 3, 0); //THIRD AGE ARMOR// //HEALTH// == Total = 80 Health protected static final UUID MAX_HEALTH_3FULL_UUID = UUID.fromString("c089b172-9445-4a3f-b1a9-72ead6d595bb"); private static final AttributeModifier HEALTH_BOOST_3FULL = new AttributeModifier (MAX_HEALTH_3FULL_UUID, "MAX_HEALTH_3FULL_UUID", 20, 0); protected static final UUID MAX_HEALTH_3HELM_UUID = UUID.fromString("fede80f4-36f0-4d6b-aa9b-f19a14562e1f"); private static final AttributeModifier HEALTH_BOOST_3HELM = new AttributeModifier (MAX_HEALTH_3HELM_UUID, "MAX_HEALTH_3HELM_UUID", 10, 0); protected static final UUID MAX_HEALTH_3BODY_UUID = UUID.fromString("6e0a9314-c2ea-43af-a186-275001c96c6c"); private static final AttributeModifier HEALTH_BOOST_3BODY = new AttributeModifier (MAX_HEALTH_3BODY_UUID, "MAX_HEALTH_3BODY_UUID", 20, 0); protected static final UUID MAX_HEALTH_3LEGS_UUID = UUID.fromString("e65314f2-5b22-4906-8f6e-78e537e63fa6"); private static final AttributeModifier HEALTH_BOOST_3LEGS = new AttributeModifier (MAX_HEALTH_3LEGS_UUID, "MAX_HEALTH_3LEGS_UUID", 20, 0); protected static final UUID MAX_HEALTH_3BOOTS_UUID = UUID.fromString("c74f0334-f073-41f2-bfbe-381a8e778278"); private static final AttributeModifier HEALTH_BOOST_3BOOTS = new AttributeModifier (MAX_HEALTH_3BOOTS_UUID, "MAX_HEALTH_3BOOTS_UUID", 10, 0); //KNOCKBACK RESISTANCE -- Total = 90% protected static final UUID KNOCKBACK_RESISTANCE_3FULL_UUID = UUID.fromString("8a374b9a-cd6b-4945-8e1b-1e7654ea3205"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_3FULL = new AttributeModifier (KNOCKBACK_RESISTANCE_3FULL_UUID, "KNOCKBACK_RESISTANCE_3FULL_UUID", 21, 0); protected static final UUID KNOCKBACK_RESISTANCE_3HELM_UUID = UUID.fromString("551c19fb-99ed-4bfd-88dc-b627f83fe3fa"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_3HELM = new AttributeModifier (KNOCKBACK_RESISTANCE_3HELM_UUID, "KNOCKBACK_RESISTANCE_3HELM_UUID", 13, 0); protected static final UUID KNOCKBACK_RESISTANCE_3BODY_UUID = UUID.fromString("8b86e5c0-94ba-44ec-9a60-637e7e8380e0"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_3BODY = new AttributeModifier (KNOCKBACK_RESISTANCE_3BODY_UUID, "KNOCKBACK_RESISTANCE_3BODY_UUID", 22, 0); protected static final UUID KNOCKBACK_RESISTANCE_3LEGS_UUID = UUID.fromString("807f3922-1511-40ed-a458-f3b6c57d2718"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_3LEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_3LEGS_UUID, "KNOCKBACK_RESISTANCE_3LEGS_UUID", 22, 0); protected static final UUID KNOCKBACK_RESISTANCE_3BOOTS_UUID = UUID.fromString("7a19419a-9c07-4b9b-947c-e87a9a93a627"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_3BOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_3BOOTS_UUID, "KNOCKBACK_RESISTANCE_3BOOTS_UUID", 12, 0); public static String playerKey(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; } ///add effect to set of armor @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DFULL); if (player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DFULL); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if dragon boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DBOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DBOOTS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 0)); } } //check if dragon legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DLEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DLEGS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if dragon body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DBODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DBODY); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if dragon helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DHELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DHELM); } } //check if boots and legs is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if legs and body is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if legs and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if body and helm is equipped if(player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots, legs and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if legs, body and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if boots, body and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if boots, legs and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } ////// THIRD AGE /////// if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3FULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3FULL); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3FULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3FULL); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 3)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 25 , 1)); } if (world.getWorldTime() % 25 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 25 , 1)); } } } //check if boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3BOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3BOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3BOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3BOOTS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3LEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3LEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3LEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3LEGS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 0)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3BODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3BODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3BODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3BODY); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 0)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3HELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3HELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3HELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3HELM); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if boots and legs is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_3BOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_3BOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_3BOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_3BOOTS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); } } //check if boots and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); } } //check if boots and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); } } //check if legs and body is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); } } //check if legs and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); } } //check if body and helm is equipped if(player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 2)); } } //check if boots, legs and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 3)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); } } //check if legs, body and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 2)); } } //check if boots, body and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.THIRD_AGE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.LUCK, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 2)); } } //check if boots, legs and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.THIRD_AGE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.THIRD_AGE_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.THIRD_AGE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.NIGHT_VISION, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 0, 3)); } } //// RUNE //// if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_RFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_RFULL); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_RFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_RFULL); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 0)); } } //check if boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_RBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_RBOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_RBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_RBOOTS); } } //check if legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_RLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_RLEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_RBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_RBOOTS); } } //check if body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_RBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_RBODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_RBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_RBODY); } } //check if helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_RHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_RHELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_RHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_RHELM); } } //check if boots and legs is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if boots and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if boots and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if legs and body is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if legs and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if body and helm is equipped if(player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if boots, legs and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if legs, body and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if boots, body and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.RUNE_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } //check if boots, legs and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.RUNE_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.RUNE_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.RUNE_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); } } ///// ADAMANT ///// if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_AFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_AFULL); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.ADAMANT_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.ADAMANT_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.ADAMANT_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.ADAMANT_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 0)); player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_AFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_AFULL); } } //check if boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_ABOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_ABOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.ADAMANT_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_ABOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_ABOOTS); } } //check if legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_ALEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_ALEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.ADAMANT_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_ABOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_ABOOTS); } } //check if body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_ABODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_ABODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.ADAMANT_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_ABODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_ABODY); } } //check if helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_AHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_AHELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.ADAMANT_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_AHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_AHELM); } } ///// MITHRIL ///// if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_MFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_MFULL); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.MITHRIL_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.MITHRIL_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.MITHRIL_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.MITHRIL_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_MFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_MFULL); } } //check if boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_MBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_MBOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.MITHRIL_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_MBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_MBOOTS); } } //check if legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_MLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_MLEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.MITHRIL_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_MBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_MBOOTS); } } //check if body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_MBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_MBODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.MITHRIL_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_MBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_MBODY); } } //check if helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_MHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_MHELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.MITHRIL_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_MHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_MHELM); } } } } Holy shit... Edited April 18, 2018 by supreme marshal Quote
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 Ok I solved my problem already. I only needed to put the Head, body, legs and boots in the correct slot. Slot (0) is for Boots, (1) is for legs, (2) for body and (3) for helm. Now it work. Quote
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 (edited) Well now I have a problem with Health Boost potion effect. It is a very weird problem. It give me empty hearth bonus but my health always go back to 10 hearts maximum. When I try to eat food to restore my health, it's trying to restore the missing health that is over 10 hearts but it's always going back to 10 hearts as if I'm taking damages when I get past 10 hearts. Anyone know of this problem? Edited April 14, 2018 by supreme marshal Quote
Draco18s Posted April 14, 2018 Posted April 14, 2018 1 hour ago, supreme marshal said: 10 hearths Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 corrected my spelling, thanks. Quote
Draco18s Posted April 14, 2018 Posted April 14, 2018 Show your code. I'm not sure what the problem might be Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 (edited) package com.SupremeMarshal.MoreToolsTierMod.objects.armor; import com.SupremeMarshal.MoreToolsTierMod.Main; import com.SupremeMarshal.MoreToolsTierMod.init.ModItems; import com.SupremeMarshal.MoreToolsTierMod.util.interfaces.IHasModel; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; public class DragonArmorBase extends ItemArmor implements IHasModel { public DragonArmorBase(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.COMBAT); ModItems.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } ///add potion effect to full set of armor @Override public void onArmorTick(World world, EntityPlayer player, ItemStack item) { if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ModItems.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ModItems.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ModItems.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ModItems.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.HEALTH_BOOST,0,3)); } } } } Edited April 14, 2018 by supreme marshal Quote
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 It show in game that I have all of the effect. It just the Health boost effect seem to be glitched or something. Quote
Draco18s Posted April 14, 2018 Posted April 14, 2018 It's because you're passing a duration of 0. Instead pass in a larger value. You can use getActivePotionEffect and getDuration to determine if the potion is already active, and only apply the duration if either the potion is not active or the duration is <2 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 (edited) I put 5 seconds instead, it still do the same thing. But now I can see the particle of the effect. Edited April 14, 2018 by supreme marshal Quote
Draco18s Posted April 14, 2018 Posted April 14, 2018 22 minutes ago, supreme marshal said: I put 5 seconds instead, it still do the same thing. But now I can see the particle of the effect. The only way to not have particles is to prevent them from being rendered. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 yes by putting the time of the potion effect to zero, it remove the particle effect. The effect of the potion is still suppose to work, the problem was not the time set too low. I wonder if it's going to work if I try my mod on the original minecraft launcher. Anyways, I don't really need the Health bonus since I can still make my armor powerful. Here a picture of what is actually happening. You can see the Hearts won't go above the normal maximum limit. Quote
Draco18s Posted April 14, 2018 Posted April 14, 2018 Time 0 -> Potion ticks -> Potion expires -> Max health set to 10 Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
supreme marshal Posted April 14, 2018 Author Posted April 14, 2018 1 minute ago, Draco18s said: Time 0 -> Potion ticks -> Potion expires -> Max health set to 10 I tested with different time setting, there was no difference. Quote
Draco18s Posted April 15, 2018 Posted April 15, 2018 45 minutes ago, diesieben07 said: The PotionEffect constructor has a parameter to hide the particles. Oh? Is that new (relative to about 1.10)? Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
TheRPGAdventurer Posted April 15, 2018 Posted April 15, 2018 14 hours ago, diesieben07 said: It is relatively new, but I am not sure when exactly it was added. Yeah it was used with 1.13 turtle shell helmet. now players dont have "fart" particles when having water breathing when wearing it Quote
supreme marshal Posted April 17, 2018 Author Posted April 17, 2018 So I am still trying to solve this issue. The problem that I am applying the health_boost potion effect for every armor ticks, which mean it will be reset every single tick. This conflict the effect because it's always reset to a new effect. This method work for boost speed, strength, vision and some more but for Health boost or Regeneration, it isn't. Quote
supreme marshal Posted April 17, 2018 Author Posted April 17, 2018 (edited) Ok I solved the issue for the Regeneration, here is the codes on Armor tick after checking if full set is equipped: if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); Basically, regeneration 1 regen every 50 ticks so with this method, it won't reset regeneration 1 until 50 ticks is completed. So then it can regenerate one health after 50 ticks and reset the Regeneration effect. But unfortunately I haven't got a solution for Health Boost yet. I tried the same method as regeneration, but my health actually reset to normal every 50 ticks so this method is not working. In other word, every time my health boost effect is being reset, my health is also getting reset. I'm thinking about just editing player's max health when armor is equipped and resetting it when he get it off. I want this method to be compatible with other mod that modify player's health. So maybe if I check player current health and add (for exemple) 5 health. When I remove my armor, it check player current health again (because if other mod modify player health, it won't be the same as when he equipped the armor) and remove 5 health. I'm just not sure how to put this in codes yet. Edited April 17, 2018 by supreme marshal Quote
supreme marshal Posted April 17, 2018 Author Posted April 17, 2018 (edited) Good news, I have learned about Attribute modifier and now I managed to increase my health when wearing my full armor set. Everything seem to work well. HELL YEAH!!!! Until I get another issue... I'll show my codes when I'm done. Edited April 18, 2018 by supreme marshal Quote
supreme marshal Posted April 18, 2018 Author Posted April 18, 2018 (edited) public class DragonArmorBase extends ItemArmor implements IHasModel { public DragonArmorBase(String name, ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.COMBAT); ItemInit.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } //////UUID////// //DRAGON ARMOR// //HEALTH// -- Total = 40 Health protected static final UUID MAX_HEALTH_DFULL_UUID = UUID.fromString("fdd721e0-bcb0-4963-9c03-ace14c6ceae4"); private static final AttributeModifier HEALTH_BOOST_DFULL = new AttributeModifier (MAX_HEALTH_DFULL_UUID, "MAX_HEALTH_DFULL_UUID", 10, 0); protected static final UUID MAX_HEALTH_DHELM_UUID = UUID.fromString("cfb80931-3fc9-4e5a-9760-213aee2dce98"); private static final AttributeModifier HEALTH_BOOST_DHELM = new AttributeModifier (MAX_HEALTH_DHELM_UUID, "MAX_HEALTH_DHELM_UUID", 5, 0); protected static final UUID MAX_HEALTH_DBODY_UUID = UUID.fromString("122785ee-9867-4ace-af8b-745932039e73"); private static final AttributeModifier HEALTH_BOOST_DBODY = new AttributeModifier (MAX_HEALTH_DBODY_UUID, "MAX_HEALTH_DBODY_UUID", 10, 0); protected static final UUID MAX_HEALTH_DLEGS_UUID = UUID.fromString("a5c77a84-5a15-4752-9f07-599a3a2e4c9f"); private static final AttributeModifier HEALTH_BOOST_DLEGS = new AttributeModifier (MAX_HEALTH_DLEGS_UUID, "MAX_HEALTH_DLEGS_UUID", 10, 0); protected static final UUID MAX_HEALTH_DBOOTS_UUID = UUID.fromString("f3fb329d-4923-4aa1-bef8-d0728f4b7abd"); private static final AttributeModifier HEALTH_BOOST_DBOOTS = new AttributeModifier (MAX_HEALTH_DBOOTS_UUID, "MAX_HEALTH_DBOOTS_UUID", 5, 0); //KNOCKBACK RESISTANCE -- Total = 80% protected static final UUID KNOCKBACK_RESISTANCE_DFULL_UUID = UUID.fromString("a5f4ce17-c5b7-4791-979c-b55018c2e89c"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DFULL = new AttributeModifier (KNOCKBACK_RESISTANCE_DFULL_UUID, "KNOCKBACK_RESISTANCE_DFULL_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DHELM_UUID = UUID.fromString("5619ab81-25e6-43e1-85e8-0a11be2b0bcd"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DHELM = new AttributeModifier (KNOCKBACK_RESISTANCE_DHELM_UUID, "KNOCKBACK_RESISTANCE_DHELM_UUID", 10, 0); protected static final UUID KNOCKBACK_RESISTANCE_DBODY_UUID = UUID.fromString("ecec32f1-c5b5-4921-98ba-e1717a3befa4"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DBODY = new AttributeModifier (KNOCKBACK_RESISTANCE_DBODY_UUID, "KNOCKBACK_RESISTANCE_DBODY_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DLEGS_UUID = UUID.fromString("1726437a-2fba-42b9-a3f7-56a777740037"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DLEGS = new AttributeModifier (KNOCKBACK_RESISTANCE_DLEGS_UUID, "KNOCKBACK_RESISTANCE_DLEGS_UUID", 20, 0); protected static final UUID KNOCKBACK_RESISTANCE_DBOOTS_UUID = UUID.fromString("7ffe2d12-c540-407b-8df6-101450ab8a5b"); private static final AttributeModifier KNOCKBACK_RESISTANCE_BOOST_DBOOTS = new AttributeModifier (KNOCKBACK_RESISTANCE_DBOOTS_UUID, "KNOCKBACK_RESISTANCE_DBOOTS_UUID", 10, 0); //RUNE ARMOR// //HEALTH// == Total = 30 Health //KNOCKBACK RESISTANCE -- Total = 60% //ADAMANT ARMOR// //HEALTH// == Total = 20 Health //KNOCKBACK RESISTANCE -- Total = 40% //MITHRIL ARMOR// //HEALTH// == Total = 10 Health //KNOCKBACK RESISTANCE -- Total = 20% //THIRD AGE ARMOR// //HEALTH// == Total = 50 Health //KNOCKBACK RESISTANCE -- Total = 90% public static String playerKey(EntityPlayer player) { return player.getGameProfile().getName() + ":" + player.world.isRemote; } ///add effect to set of armor @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DFULL); if (player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DFULL); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DFULL); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 1)); { if (player.getActivePotionEffect(MobEffects.REGENERATION) == null) { player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } if (world.getWorldTime() % 50 > 0) { return; } player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 50 , 0)); } } } //check if dragon boots is equipped if(player.inventory.armorItemInSlot(0) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DBOOTS); if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DBOOTS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DBOOTS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); player.addPotionEffect(new PotionEffect(MobEffects.STRENGTH, 0, 0)); } } //check if dragon legs is equipped if(player.inventory.armorItemInSlot(1) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DLEGS); if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DLEGS); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DLEGS); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if dragon body is equipped if(player.inventory.armorItemInSlot(2) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DBODY); if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DBODY); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DBODY); player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if dragon helm is equipped if(player.inventory.armorItemInSlot(3) != null) { player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).removeModifier(HEALTH_BOOST_DHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).removeModifier(KNOCKBACK_RESISTANCE_BOOST_DHELM); if(player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(HEALTH_BOOST_DHELM); player.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(KNOCKBACK_RESISTANCE_BOOST_DHELM); } } //check if boots and legs is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if legs and body is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if legs and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if body and helm is equipped if(player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 1)); } } //check if boots, legs and body is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if legs, body and helm is equipped if(player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if boots, body and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(2).getItem() == ItemInit.DRAGON_BODY && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } //check if boots, legs and helm is equipped if(player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(3) != null) { if(player.inventory.armorItemInSlot(0).getItem() == ItemInit.DRAGON_BOOTS && player.inventory.armorItemInSlot(1).getItem() == ItemInit.DRAGON_LEGS && player.inventory.armorItemInSlot(3).getItem() == ItemInit.DRAGON_HELM) { player.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 0, 2)); player.addPotionEffect(new PotionEffect(MobEffects.FIRE_RESISTANCE, 0, 0)); } } ////// THIRD AGE /////// //ect.. I won't show the rest because it's pretty much copy-paste for every armor. So when I equip a dragon helm, it give me 5 Health and 10% knockback resistance + some potion effect. Body = 10 health and 20% knockback resistance. Full set give me 10 extra health and 20% extra knockback resist with Resistance 3, Fire resistance 2 and strength 2. I tested it and it work 100%. My mod is almost ready to be published but I still want to add more things in it. Edited April 18, 2018 by supreme marshal Quote
Recommended Posts
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.