Hello, I am a bit stuck on the coding of something I'm doing. What I am attempting to achieve is 'doubling' the damage dealt if player is facing away (so if I'm looking North and I get attacked from South) that damage is doubled. Not sure how to go about it, thanks in advance.
Konkz Listen to the player damage event. Check if the damager is facing the same direction as the player, and there you go.
You need to check the Yaw, if the Attacker's Yaw is between a certain range(Id recommend -45º and +45º [that gives you a 90º angle]) double the damage
Would this work? I can't check, no friends. Code:java if (attacker.getLocation().getDirection() == victim.getLocation().getDirection()) { //code }
I think so ... Then simply: Code:java e.getDamage().multiply(2); or something like that, sorry don't tested in eclpise...
Nah it wouldn't. First you need to get the yaw of attacker and yaw of attackED. check if their difference is within a value(recommended before) and if it is double. If you don't have friends just do it like me. Cracked client and offline-mode to server :3