BukkitOldCombatMechanics icon indicating copy to clipboard operation
BukkitOldCombatMechanics copied to clipboard

Eat event cancelled when damaged

Open poloaudmo opened this issue 4 years ago • 17 comments

Whenever a player takes damage from another player, the eat event resets. Can an option be added to disable this feature?

poloaudmo avatar Jun 14 '20 19:06 poloaudmo

Do you mean that the eating animation is reset and the item is not consumed?

kernitus avatar Jun 16 '20 12:06 kernitus

Yes, the eating animation is reset and the item is not consumed. Moreover, it's not only just by player damage but any type of damage whatsoever.

poloaudmo avatar Jun 18 '20 16:06 poloaudmo

Alright, and is that not what it's meant to do? Surely, if you're damaged while eating you shouldn't be able to continue eating?

kernitus avatar Jun 19 '20 09:06 kernitus

This was a combat mechanic of version 1.7 (as far as I remember) and was changed later such that a player could be able to eat even if they are taking damage. Thank you for your quick responses!

poloaudmo avatar Jun 19 '20 16:06 poloaudmo

I am also having this issue, any damaging event cancels eating

IPv5 avatar Jun 20 '20 22:06 IPv5

This was a combat mechanic of version 1.7 (as far as I remember) and was changed later such that a player could be able to eat even if they are taking damage. Thank you for your quick responses!

So, when was this changed, and from what functionality?

kernitus avatar Jun 23 '20 13:06 kernitus

Okay, tbh I tested it out on 1.6-1.12 and the eat even doesn't cancel. But when using this plugin, the eat even cancels. I'm not sure if this might be a bug/introduced in a specific MC update or something. So, the eat even shouldn't reset upon taking damage but with this plugin it does reset. I think having an option which gives the players the ability to enable/disable this feature would be great.

poloaudmo avatar Jun 25 '20 17:06 poloaudmo

Hey, if a user has all permissions, i.e, ' * '. Then upon eating while taking damage the eating action does seem to reset visually on screen but the item does get consumed. On average it take 1.61 seconds to eat most foods. For example, if a player is eating steak and taking damage then visually the eating animation would keep cancelling on his screen but if the right mouse button is held for 1.61 seconds then the item does get consumed. This only happens when the player has ' * ' permission though. I'm not sure if this is happening because having all permissions bypasses some features of the plugin or if there is some hidden permission specific to this.

poloaudmo avatar Jul 15 '20 09:07 poloaudmo

Hey, if a user has all permissions, i.e, ' * '. Then upon eating while taking damage the eating action does seem to reset visually on screen but the item does get consumed. On average it take 1.61 seconds to eat most foods. For example, if a player is eating steak and taking damage then visually the eating animation would keep cancelling on his screen but if the right mouse button is held for 1.61 seconds then the item does get consumed. This only happens when the player has ' * ' permission though. I'm not sure if this is happening because having all permissions bypasses some features of the plugin or if there is some hidden permission specific to this.

I don't see how that's relevant at all, unless there's some other plugin conflicting. What other plugins do you have installed?

kernitus avatar Jul 19 '20 16:07 kernitus

I do not have any plugins that affect combat mechanics, just this one. But still if it helps then this is my plugins list : https://gyazo.com/74c13c40015fbfa3f044f32159273bf1

poloaudmo avatar Jul 20 '20 10:07 poloaudmo

@I-Al-Istannen wasn't an issue like this fixed with a patch of yours? Or am I misremembering?

kernitus avatar Jan 04 '21 11:01 kernitus

I was trying to fix a bug where you could not hold down right click to consume apples (it would continuously show the animation but not do anything), but I never solved that one IIRC. After digging around in spigot / nms code for a few hours I got bored enough to stop it...

I don't think I have looked at this issue but maybe it is also related to cancelling some consume / right click event.

I-Al-Istannen avatar Jan 05 '21 11:01 I-Al-Istannen

Would just like to remark I'm also having this issue although it only seems to be 1.8 clients (1.16 server using via version).

Kazzababe avatar Apr 05 '21 00:04 Kazzababe

i also got this issue its stops above 1.12.2. only with ocm. if there is a fix i would like to know

sjander12 avatar Jun 08 '21 10:06 sjander12

btw this only happens when i have old-armour-durability:true When i set it on false its fine

sjander12 avatar Jun 08 '21 11:06 sjander12

I cannot reproduce this bug at all. Are you saying this only happens when running Minecraft 1.12.2 and below? Is that a client of server version? Also, is it with any kind of damage, and is it with any kind of food?

kernitus avatar Jun 09 '21 10:06 kernitus

Neither the old armour durability or old armour strength actually directly modify the inventory, so I don't see what those modules could have to do with this. The gapple module cancels the eat event in order to be able to apply the desired effects, which could cause problems on the client-side if the client hasn't realised the item was technically eaten. Technically the normal gapple effects haven't changed with 1.9, so if this is really a big problem we could make a separate listener for those and just leave the effects untouched. This, however, would not be possible with enchanted golden apples.

kernitus avatar Apr 24 '22 15:04 kernitus