Hi there,
I am making some modded armour that gives the player a potion effect whilst worn. Multiple tutorials (which I imagine are outdated, unless I am making an error here) suggest using "onArmorTick". My question is, does this method still exist, and if not, how else can I implement this feature?
Here is my modded armour class;
package com.izzymandias.AttackOfTheMushroomsMod.items.armor;
import com.izzymandias.AttackOfTheMushroomsMod.lists.ItemList;
import net.minecraft.entity.LivingEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.IArmorMaterial;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.world.World;
public class spore_leather_boots extends ArmorItem {
public spore_leather_boots(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) {
super(materialIn, slot, builder);
}
public void onArmorTick(World world, LivingEntity entity, ItemStack itemStack) {
ItemStack boots = entity.getItemStackFromSlot(EquipmentSlotType.FEET);
if(boots.getItem() == ItemList.spore_leather_boots) {
EffectInstance statusEffect = new EffectInstance(Effects.SPEED, 40, 0);
entity.addPotionEffect(statusEffect);
}
}
}
Any help would be appreciated, thanks!