OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Gold apple consuming while in combat

xph11 opened this issue ยท 10 comments

commented

Information

  • Server Version: 1.19.4
  • OldCombatMechanics version: latest dev
  • Server Log File: N/A

Problem Description

Whenever a player plays on 1.8 client and gets hit by someone, they cannot consume a gold apple - the eating animation just lasts infinitely.

To Reproduce

Steps to reproduce the behavior:

  1. Fight someone with 1.8 client
  2. Try to consume gold apple after getting hit

Expected Behaviour

The gold apple should be consumed properly.

Actual Behaviour

The gold apple doesn't get consumed, just continues eating infinitely.

commented
  1. "Latest dev" doesn't mean anything to us, this could change from one day to the next. Please post the Jenkins build number of the commit hash.
  2. Why do you have 1.8 clients in first place? The plugin only supports 1.9 - 1.19, anything else can lead to undefined behaviour
commented

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

commented

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

Thank you, v151 did fix it, but partially. It seems I am able to eat it more times now, however, now the eating process gets cancelled completely if I try to eat while getting hit, so I can only hit every now and then properly, while many times the eating gets cancelled.

commented

@xph11 I have now changed the module to not cancel the event nor modify the inventory, but rather directly manipulate the potion effects that are applied to the player. Can you try dev build 152 and see if it is any better?

commented

@xph11 Taking a guess as to what could be causing the issue, I have made it so OCM doesn't cancel the item consume event but rather replaces the item with one with the custom effects. Could you try test build 151 to see if the problem is still there?

Thank you, v151 did fix it, but partially. It seems I am able to eat it more times now, however, now the eating process gets cancelled completely if I try to eat while getting hit, so I can only hit every now and then properly, while many times the eating gets cancelled.

So the initial bug is fixed now thankfully. However, now instead of adding just 2 golden hearts max, it adds up to 8 hearts max.. could you maybe fix that or add a golden heart extra limit setting?

commented

@xph11 Ok, I have resorted to just nuking all of a player's potion effects and adding only the ones they should have. This means the status effect icons will briefly flash on the screen but that is an acceptable tradeoff. Please try test build 155.

commented

@xph11 Ok, I have resorted to just nuking all of a player's potion effects and adding only the ones they should have. This means the status effect icons will briefly flash on the screen but that is an acceptable tradeoff. Please try test build 155.

So it almost works now, I just noticed however, that if I get hit and try to eat the gapple when looking at a nearby block, it still won't work. If I get hit and try to eat it while looking at a player or just the air, it does work.

commented

Can you elaborate on the sequence of actions you are taking? You get hit, then try to eat the apple? Or were you eating it already?

commented

Can you elaborate on the sequence of actions you are taking? You get hit, then try to eat the apple? Or were you eating it already?

Basically I got someone else to keep hitting me, while I eat a gapples over and over (got a stack) while getting constantly hit. The sword I get his by is a diamond sword with sharpness II and fire aspect II

commented

What do you mean by "still won't work". I just tried this with a 1.8 client on a 1.12 server and a 1.8 client on a 1.19 server, with ViaVersion, ViaBackwards, and ViaRewind. I can eat gapples and enchanted gapples just fine while being damaged.

With the newest dev build, have you tried disabling just the old-golden-apples module? Does it affect the behaviour in-game?