CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
589 stars 313 forks source link

EAT_FOOD Animation Not Working #2786

Closed kalebbroo closed 2 years ago

kalebbroo commented 2 years ago

/version output

git-Paper-268 (MC: 1.18.2)

/version Citizens output

version citizens
[09:14:42 INFO]: Citizens version 2.0.29-SNAPSHOT (build 2513)
[09:14:42 INFO]: Website: http://www.citizensnpcs.co
[09:14:42 INFO]: Author: fullwall

Log file

https://paste.denizenscript.com/View/95377

config.yml

https://paste.denizenscript.com/View/95378

saves.yml

https://paste.denizenscript.com/View/95379

Profiler report

No response

Description

I was trying to run the EAT_FOOD animation using Denizen but it seems it plays the fade in and out animation that happens after you sleep. To replicate just run /ex animate animation:EAT_FOOD

Video: https://cdn.discordapp.com/attachments/347878337483505666/963300920463081502/2022-04-12_00-52-12.mp4

mcmonkey4eva commented 2 years ago

Presumably indicates that the value 2 at: https://github.com/CitizensDev/Citizens2/blob/2a5b62aae06740fe09a0a53a8b41ee93697639fd/v1_18_R2/src/main/java/net/citizensnpcs/nms/v1_18_R2/util/PlayerAnimationImpl.java#L135 is incorrect

Which is corroborated by https://wiki.vg/Protocol:

I'm not sure what the correct modern option would be - it might just not be a triggerable animation? or it might be related to the Player Digging packet which has 5 | Shoot arrow / finish eating | Indicates that the currently held item should have its state updated such as eating food, pulling back bows, using buckets, etc. Location is always set to 0/0/0, Face is always set to -Y. That seems like it'd be something else though.

fullwall commented 2 years ago

Perhaps use item?

mcmonkey4eva commented 2 years ago

Relevant commit https://github.com/CitizensDev/Citizens2/commit/b0f1290b58839e8f97bfac9345ba5192d8edd2aa Doesn't reimplement eat_food but does deimplement it and add leave_bed

fullwall commented 2 years ago

I think use item is the replacement for this.