(Bug) preventknockback true on damage, damagepercent, basedamage mechanics cause damage event to have unknown damager
Summary
In damage
, damagepercent
, and basedamage
mechanics, there is an option preventknockback
. This option is intended to prevent the damage event from causing any knockback for the target. However, if you set preventknockback
to true in a damage
/damagepercent
/basedamage
mechanic, the damage event has an unknown damager.
Steps to reproduce
- Create a test mob:
TestMob:
Template: TemplateSkills
Type: IRON_GOLEM
Display: "Test Mob"
Health: 3000000
Damage: 0
Options:
NoAI: True
Skills:
- actionmessage{m="&7Damager<&co> &c<trigger.name>"} @PIR{r=100} ~onDamaged
- Create two skills:
Damage1:
Skills:
- damage{amount=1;preventknockback=false} @EIR{r=5}
Damage2:
Skills:
- damage{amount=1;preventknockback=true} @EIR{r=5}
- Spawn
TestMob
, move within5
blocks of the mob, and cast the two damage skills.
The issue
Damage1
works as intended. The action message displays Damager: <your username>
. However, Damage2
does not work as intended. The actionbar message displays Damager: Unknown
.
Why is this significant?
Firstly, if you use preventknockback=true
in your damage skill, this disables the @Trigger
targeter for mobs. In other words, you cannot get the damager/cast skills on the damager.
Secondly, this causes issues with other plugins. For example, many party plugins (tested: McMMO, Parties and Friends) disable PVP in the party. However, that won't work if the damager is unknown.