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

[1.14.2] Trouble with onArmorTick


kwpugh
 Share

Recommended Posts

Hi,

 

Looking for some help with this.

 

package com.kwpugh.gobber2.items.armor;

 

import com.kwpugh.gobber2.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.world.World;

 

public class ItemCustomBoots extends ArmorItem

{

public ItemCustomBoots(IArmorMaterial materialIn, EquipmentSlotType slots, Properties builder)

{

super(materialIn, slots, builder);

}

 

public void onArmorTick(World world, LivingEntity entity, ItemStack itemStack)

{

ItemStack boots = entity.getItemStackFromSlot(EquipmentSlotType.FEET);

 

if(boots.getItem() == ItemList.gobber2_boots)

{

entity.stepHeight = 3.0F;

    }

else

    {

entity.stepHeight = 0.0F;

    }

}

}

The step height does not appear to be kicking in, any suggestions to what I am doing wrong?

 

I thought you normally have to @Override it, but that creates an error:  "The method onArmorTick(World, LivingEntity, ItemStack) of type ItemCustomBoots must override or implement a supertype method"

 

Thank you in advance.

 

Link to comment
Share on other sites

13 minutes ago, kwpugh said:

I thought you normally have to @Override it, but that creates an error:  "The method onArmorTick(World, LivingEntity, ItemStack) of type ItemCustomBoots must override or implement a supertype method"

Yes, that exactly is the point of @Override: It tells you that you are not actually overriding anything! Removing @Override fixes nothing. You need to make sure you are actually overriding something, use your IDE if you need to.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

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