Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

GAVINSIGHT

Members
  • Posts

    5
  • Joined

  • Last visited

GAVINSIGHT's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Issue solved! In the code I added "PeridotArmor peridotBoots = ItemListOld.peridot_boots" and in the ItemListOld class I referred to peridot_boots as "PeridotArmor" rather than "ArmorItem". Solved the issue! Thank you for your help. Crazy, I dreamed the solution when I fell asleep last night.
  2. No, I have ItemList which uses deferred registry and ItemListOld which doesn’t. I switched to deferred registries for a majority of my items but found it much easier to keep my armor and tools within ItemListOld.
  3. public class PeridotArmor extends ArmorItem{ public PeridotArmor(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack itemStack, World world, PlayerEntity player) { ItemStack boots = player.getItemStackFromSlot(EquipmentSlotType.FEET); if(boots.getItem() == ItemListOld.peridot_boots) { if(!world.isRemote) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 5, 4, false, false, true)); } } } } I updated my code, but it seemed to unfortunately have no effect. I tried swapping the order of the IF statements and adding/removing the booleans
  4. How would I go about adding potion effects on the server side?
  5. public class PeridotArmor extends ArmorItem{ public PeridotArmor(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack itemStack, World world, PlayerEntity player) { ItemStack boots = player.getItemStackFromSlot(EquipmentSlotType.FEET); if(boots.getItem() == ItemListOld.peridot_boots) { player.addPotionEffect(new EffectInstance(Effects.SPEED, 100, 4)); } else player.removePotionEffect(Effects.SPEED); } } I tried writing a class that allowed the player to move faster when wearing the armor. I'm getting no errors but when I apply the piece of armor in game it gives no effect. I've tried rewriting a few things and changing a few things here and there but nothing really seems to work
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.