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

Vampire plugin

Comments in 'Plugin Development' started by Primus, May 11, 2015.

  1. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    This plugin will mirror back damage as health to attacker. But i can't find any damage event. And how to get an amount of damage that attacker did?
    64FF00 and LDX like this.
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    PHP:
    public function onDamage(EntityDamageEvent $event){
    $player $event->getEntity();
    $damage $event->getDamage();
    if(
    $event instanceof EntityDamageByEntityEvent){
    $vampire $event->getDamager();
    if(
    $player instanceof Player){
    if(
    $vampire instanceof Player){
    if(
    $vampire->hasPermission("Vampire.vampire")){
    $vampire->setHealth($killer->getHealth() + $damage));
    }}}}}
    Should work but I'm not sure
  3. wolfdale
    Offline

    wolfdale Active Member Plugin Developer

    Joined:
    Dec 3, 2014
    Posts:
    276
    Plugins:
    1
    Minecraft User:
    ace
    At last line $killer is undefined,use $vampire instead
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    where is it defined at? o_O
    HotFireyDeath likes this.
  5. 64FF00
    Offline

    64FF00 Active Member Plugin Developer

    Joined:
    May 11, 2014
    Posts:
    298
    Plugins:
    2
    Minecraft User:
    64FF00
    Over there!
  6. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Yea sorry, it was a copied code and I didn't see that one!

Share This Page

Advertisement