Jonathon594
New Member
So I have my own plugin which I have been working on for a while and everything is working pretty flawlessly. However; I have it so that doing damage with bending levels the respective bending skills. This works perfectly fine with the BendingAbilityDamageEvent I believe its called. Something like that. The problem is that my other skills like Swords, Axes, Unarmed etc are leveled up on the EntityDamageByEntityEvent. The way ProjectKorra does its damage is by LivingEntity.damage() I believe which calls an EntityDamageByEntityEvent. So the issue I am having is that for example if I shoot a fireblast, and then switch my hotbar to a sword. When the skill impacts the server believes that I damaged the target via melee and because I am currently holding a sword it levels the sword skill. My current fix is to add a cooldown on melee experience everytime the player does a bending move. It works but its not as clean as I'd like. Is there a way to tell the difference between Bending and Melee on the EntityDamageByEntityEvent? I see in the source code that the entities last damage reason is being set, and I was checking that but it seems to be unreliable.