"PROJECTILE" Damage cause attritube value doesn't work in Damage mechanic. (Stuck in ENTITY_ATTACK cause)
Summary
"PROJECTILE" damage cause attritube value doesn't work in Damage mechanic! According to the Wiki: https://git.mythiccraft.io/mythiccraft/MythicMobs/-/wikis/skills/mechanics/damage Damage mechanic supports "damagecause" attribute value for 1.17+ server and in in newer MM 5.0 builds.
When the damage cause is set to "PROJECTILE", it always result in "ENTITY_ATTACK" cause instead of "PROJECTILE". This behavior seems to only happen to "PROJECTILE" value. This bug makes it very diffucult for devs to implement cross-support (balancing). In practice, we use damage mechanic a lot instead of the mob vanilla damage type.
Server version: Purpur Version: 1.20.6-2233-0d6766e (MC: 1.20.6) MythicMobs version: 5.10.0
How do I know the damage cause is incorrect?
I use a simple plugin that listens to all java damage events and have it console log the damage cause value. Pretty confident that the printed value isn't wrong.
Other damage cause attribute values works just fine (printing expected values) in Damage mechanic but not PROJECTILE. If I spawn an vanilla skeleton and have it damage me, the printed value is "PROJECTILE", damage mechanic should be able to replicate the same thing but it didn't!
Steps to reproduce
- Create a simple mythic mob that use Damage mechanic and set the cause attribute to value PROJECTILE
DebugSkeleton:
Type: SKELETON
AIGoalSelectors:
- opendoor
- float
- goToSpawn{speed=1;max=20;min=4}
Display: '<#f9f8ea>Skeleton'
Health: 20
Damage: 0
Drops:
- exp 5
AITargetSelectors:
- clear
- players
Options:
Despawn: NEVER
AlwaysShowName: false
PreventOtherDrops: true
PreventSunburn: true
PreventVanillaDamage: true # 'false' value results in 2 damage event, one that is "PROJECTILE" (vanilla attack), other is "ENTITY_ATTACK" which is from the damage mechanic.
FollowRange: 64
Modules:
ThreatTable: true
Skills:
- damage{a=2;i=false;cause=PROJECTILE} @target ~onArrowhit
- Spawn the mob and just test it. Using 3rd plugin to print the damage cause value from java events.
Current behavior
PROJECTILE damage cause is very essential damage cause. If this doesn't work, I can't balance combat in my server (cross plugins). In example I have my enchant plugin that create an enchant that block projectiles. but the effects won't works on mythic mobs that use Damage mechanic because the server can't distinguish between melee attack and range attack which relie on damage cause value.
Intended correct behavior
Damage events generated by Damage Mechanic should have damage cause PROJECTILE instead of ENTITY_ATTACK (when the cause attribute set to PROJECTILE)
Server log file
Debug log snippet
NO RELEVANT LOG AS THIS BUG REQUIRE TESTER TO CHECK THE DAMAGE CAUSE PROGRAMMTICALLY.
- Of course I can post actual footages of me testing the bug but mythicmobs developers probably won't trust output generated by my plugin, which is fair. So I think the devs would want to test this themself. Please!
Proposed fixes
Please check the underlying implementation of Damage Mechanic to see if it is actually the cause (very likely in my opinion).