Jump to content

[1.14.2] Override Item class methods, but it doesn't work


kaiser_

Recommended Posts

I'am trying to override the getUseAction method in the Item class, but it doesn't work somehow.

I tried to get my item to use the Drink animation when used.

 

Can someone point the issue out for me, or provide me some info on how to do this in the right way? I would be really happy.

I also have the item registered as well and it's perfectly visible in the game, however I didn't bother using a texture for it yet, is it an issue in any way?

 

 

Here is the class:

public class ItemDrink extends Item {

	public ItemDrink(Properties properties) {
		super(properties);
	}
	
	@Override
	public UseAction getUseAction(ItemStack stack) {
	      return UseAction.DRINK;
	   }

}

 

Also, can anyone provide me with a useful guide on how to properly work with this stuff?

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.