Jump to content

[FORGE 1.12.2] How to change food sound/animation?


lespucci

Recommended Posts

Hello there!

 

I just created a little mod. I got a cup of coffee and when I try to drink it, it gives me the eating sound/animation.

How do I change it so it makes the sound/animation of drinking a potion?

 

EDIT/SOLUTION (Thanks V0idWa1k3r):

I added this to my food item class:

@Override
    public EnumAction getItemUseAction(ItemStack stack) {
        return EnumAction.DRINK;
    }

 

Edited by lespucci
Solution
Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...
On 4/4/2020 at 1:09 PM, Arthur Khazbs said:

Please note that in Minecraft 1.15+ things have changed: getItemUseAction is now called getUseAction and EnumAction is now called UseAction.

In 1.15+ it should work like this: (I'm uploading this just in case someone needs it)

@Override
public UseAction getUseAction(ItemStack stack) {
    return UseAction.DRINK;
}
Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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