how to make it so that after killing a player, an effect would be given for a certain time?

Discussion in 'Plugin Development' started by Borisenkoff, Mar 23, 2022.

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

    Borisenkoff

    Greetings, can you tell me how to make it so that after killing a player, an effect would be given for a certain time?

    Code:
    package org.borisenkoff.healplug;
    
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.potion.PotionEffect;
    
    public final class Healplug extends JavaPlugin {
    
        // Definition
    
        @EventHandler
        public void onkill(PlayerDeathEvent e)
        {
            String k = e.getEntity().getKiller().getName();
    
            k.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 5, 1));
        }
    }
     
    Last edited by a moderator: Mar 23, 2022
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Borisenkoff

    Sorry for wasting your time, how can this be done?
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    Borisenkoff

Thread Status:
Not open for further replies.

Share This Page