Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangedAttack not always called when damaging Players #158

Open
YourCoal opened this issue Jan 12, 2018 · 1 comment
Open

RangedAttack not always called when damaging Players #158

YourCoal opened this issue Jan 12, 2018 · 1 comment

Comments

@YourCoal
Copy link
Collaborator

The RangedAttack method for bows is only called when a player is holding a bow and an arrow the player shot hit a player. This actually isn't the best since during WarTime or any PvP a player might need to switch to a sword to defend them-self, so if the arrow hits the player when this happens the damage is set to the default minecraft arrow damage.

(A possible fix is getting the damage when the arrow is fired, then setting the entity's metadata to have that damage, so when a player is hit by an entity and the metadata "damage" != null then they will take damage that way.)

@TheLegionCrazy
Copy link

TheLegionCrazy commented Jan 12, 2018

maybe queue instead metadata ? it's faster

class RangedAttackQueue extends BukkitRunnable {
    
   static HashMap<String, Long> ranged = new HashMap<>();

   public static void addAttack(...);

    .....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants