onKillNDeath

Discussion in 'Plugin Requests' started by 4lmutairi, Aug 10, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    4lmutairi

    i want a plugin that gives the killer speed 3 for 5 seconds and gives the died player a msg "You Died!!! OMG :]"
     
  2. So just a simple event. I'm sure you can make that. You only need a few lines of code.

    Code:
    @EventHandler
    public void onDeath(PlayerDeathEvent e){
        //Create a potion effect with speed 3 for 5 seconds. 2 amplifier because 1+2=3 and 100 duration becuase 5*20=100
        PotionEffect pe = new PotionEffect(PotionEffectType.SPEED, 100, 2);
        //Add the potion effect to the killer
        e.getEntity().getKiller().addPotionEffect(pe);
        //Send the player a message
        e.getEntity().sendMessage("You Died!!! OMG :]");
    }
    That's all you need. Very simple plugin.
     
  3. Offline

    bryansolis13

Thread Status:
Not open for further replies.

Share This Page