1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

I need a plugin that will give you Diamonds for kill Player

Discussion in 'Requests' started by Screamking1337, Mar 4, 2017.

  1. Screamking1337

    Screamking1337 Creeper

    Messages:
    2
    I need a plugin that will give you Diamonds for kill Player

    The best that was in the extension zip
     
  2. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    How many diamonds do you want it to give a player when they die?
     
  3. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Suggestion: Generate a config file so users could configure the number of diamonds giving the killer.
     
    HimbeersaftLP likes this.
  4. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Oh i didnt even think of that! Having one of those dumb days i think .
     
  5. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Last edited: Mar 5, 2017
    InspectorGadget likes this.
  6. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    TheDiamondYT likes this.
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Undefined method PlayerDeathEvent::getDamager() on line 25 :-1:
     
  8. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Idek i havent done pocketmine in a while and dont have another client to test.

    EDIT: Hopefully fixed it now thanks to @corytortoise
     
    Last edited: Mar 5, 2017
  9. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    @TheDiamondYT @SOFe
    PHP:
    public function onEntityDamage(EntityDamageEvent $event){
        if(
    $event->getEntity() instanceof pocketmine\Player
        
    && $entity->getHealth() - $event->getDamage() <= 0
        
    && $event instanceof EntityDamageByEntityEvent){
            
    $damager $event->getDamager();
            
    //Award $damager diamonds
        
    }
    }
     
    SOFe and Thunder33345 like this.
  10. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Ohhh thanks thats gonna help me with a different plugin im making.
     
  11. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Just got a nose a bit too sensitive to code smell.
     
  12. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.