Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how can i get a player's damager? is there someting like getDamager()?

Comments in 'Plugin Development' started by CoolGuyPL, Nov 7, 2014.

  1. CoolGuyPL
    Offline

    CoolGuyPL New Member

    Joined:
    Sep 24, 2014
    Posts:
    43
    Minecraft User:
    CoolGuyPlays
    Is there something like that?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What do you mean by "damager"? When does the damager damage?
  3. ProjectInfinity
    Offline

    ProjectInfinity Active Member Plugin Developer

    Joined:
    Sep 7, 2014
    Posts:
    112
    Plugins:
    3
    Minecraft User:
    ProjectInfinity
    It depends on why you want the cause of the damage. There's two events that you can use, EntityDamageEvent that will occur whenever an entity is damaged or EntityDamageByEntityEvent that will occur when a entity is damaged by another entity.

    For Damage By Entity Event you can do getDamager() or for Entity Damage Event you can do getCause().
  4. GlaciercreepsMC
    Offline

    GlaciercreepsMC Active Member Plugin Developer

    Joined:
    Jan 21, 2014
    Posts:
    91
    Plugins:
    1
    Minecraft User:
    GlaciercreepsMC
    Hey, but why don't you try looking at the API for a bit? You've made quite a bit of threads here. Here's a couple links you should try looking at:
    Since you're from bukkit, it'll be easier for you to learn it; a lot of it and its events act pretty much exactly like the bukkit API.
    PEMapModder likes this.

Share This Page

Advertisement