kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics from 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
168 stars 71 forks source link

1 click equals 1 hit #554

Closed MAXOUXAX closed 2 years ago

MAXOUXAX commented 3 years ago

Information

Problem Description

As the title states, one click (and not one HIT) deals one damage to the armor durability, and all clicks seems to be dealing some damages. Please check the video to see what's happening.

To Reproduce

Steps to reproduce the behavior:

  1. Install OldCombatMechanics
  2. Use the same config.yml
  3. Put an armor on and ask a friend to kill you
  4. Watch your armor durability

Expected Behaviour

One HIT = one durability and damage hit

Actual Behaviour

One CLICK = one durability and damage hit

kernitus commented 3 years ago

This may just be a visual effect caused by the workings of some modules - can you, separately, try disabling the attack-frequency and old-armour-durability modules and seeing if the same thing happens? Can you also please have debug mode enabled and collect the logs?

MAXOUXAX commented 3 years ago

This may just be a visual effect caused by the workings of some modules - can you, separately, try disabling the attack-frequency and old-armour-durability modules and seeing if the same thing happens? Can you also please have debug mode enabled and collect the logs?

How is this a "visual effect"? Have you watched the attached video? I also tried to change the two configuration options you gave me, and the problem persists.

The durability of the armor takes damage as soon as someone clicks on me, it is not a "visual effect". As for the health bar, it's not a "visual effect" either, in a few minutes of testing, I was able to notice quite regularly that double hits were being taken by both of the players.

Something somewhere is not working as expected.

Here's the footage with debug logs turned on.

MAXOUXAX commented 3 years ago

As shown in my videos and more specifically explained in issue #558, a click inflicts damage.

kernitus commented 3 years ago

This seems to have had to do with the way the last damage was set after an attack. It was setting the final damage instead of the attack damage before armour is taken into account, which meant that many subsequent attacks were being considered as overdamage attacks and overrode the invulnerability timeout. I have now fixed this, please try this test build and let me know if the problem is still there.

ElFlyGod commented 3 years ago

@kernitus Tested it and its not fixed, its exactly the same

SamB440 commented 3 years ago

Setting the attack-frequency playerDelay to 20 in the config.yml fixes this.

Note: even when we had attack-frequency module disabled, it would still impact gameplay and setting that value to 20 fixed it.

MAXOUXAX commented 3 years ago

During my tests, the main problems seem to have been solved. The delay between attacks is well restored, and the armor durability drops as it should.

However, I don't know if the behavior is normal, but when I listen for the EntityDamageByEntityEvent with a priority of HIGHEST (to make sure the changes were made), the event is triggered every time an entity is clicked, and the damage from the event is always equal to the damage normally applied by my weapon, which results in about ten events per second, with the damage my weapon does posing a problem for my event system, having to listen to this event in order to inflict damage on an entity whose life is stored in a variable rather than directly using the entity health.

ElFlyGod commented 3 years ago

During my tests, the main problems seem to have been solved. The delay between attacks is well restored, and the armor durability drops as it should.

However, I don't know if the behavior is normal, but when I listen for the EntityDamageByEntityEvent with a priority of HIGHEST (to make sure the changes were made), the event is triggered every time an entity is clicked, and the damage from the event is always equal to the damage normally applied by my weapon, which results in about ten events per second, with the damage my weapon does posing a problem for my event system, having to listen to this event in order to inflict damage on an entity whose life is stored in a variable rather than directly using the entity health.

Thats probably happening for me too, i have a plugin for custom damages, when i unload it old combatmechanics works fine but with it enabled it makes each click do damage

ElFlyGod commented 2 years ago

@kernitus On its own it works fine but OldCombatMechanics has something that breaks other plugins that change damage

instaaftereffects commented 2 years ago

This seemed to fix my issue, but critting is still broken. Meaning when the attacker is critting the victim, the hits cam be spammed.