invisible nickname when killed under an invisibility potion

Discussion in 'Bukkit Help' started by m1has1k, Dec 23, 2023.

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

    m1has1k

    Hello!I would like to make it so that when a player drinks an invisibility potion and kills someone, his nickname in the chat will not be visible.When a player kills another player in the chat there is a message “Player1 was killed by Player2”, I need to make it look something like this “Player1 was killed [???]” or the nickname is not visible at all.Tell me, maybe there is a plugin or something like that!
     
  2. Offline

    Dogged

    If you know how to make a plugin, the code to implement this would be something like this:
    Code:
    @EventHandler
    public void onPlayerDeath (PlayerDeathEvent e) {
        Player p = e.getPlayer();
        if (p.getKiller() != null) {
            if (p.getKiller().hasPotionEffect(PotionEffectType.INVISIBILITY)) {
                e.setDeathMessage(p.getName() + " was killed [???]");
            }
        }
    }
    
     
Thread Status:
Not open for further replies.

Share This Page