OldCombatMechanics

OldCombatMechanics

46.1k Downloads

1 click equals 1 hit

MAXOUXAX opened this issue ยท 10 comments

commented

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

commented

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?

commented

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.

commented

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

commented

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.

commented

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

commented

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.

commented

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.

commented

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

commented

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

commented

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