Simple Deathban Plugin

Discussion in 'Plugin Development' started by TheNoobiestCrafters, Dec 12, 2012.

Thread Status:
Not open for further replies.
  1. How can I make a simple plugin to ban a player when they die (unless they have a certain permission, ie: hardcore.noban) with the reason "You Died! Donate to get another life at www.example.com".

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  2. Offline

    ZeusAllMighty11

    You bumped in the first 12 minutes.. wow.
    You should only bump every 12 hours if you HAVE to.


    http://lmgtfy.com/?q=site:bukkit.org+ban+player+on+death

    Source code all over there.



    Code:
    @EventHandler
    public void onDeathBan(PlayerDeathEvent e){
    Entity ent = e.getEntity();
     
    if(ent instanceof Player){
        Player player = (Player) ent;
        
        if(!player.hasPermission("hardcore.noban)){
                getServer().dispatchCommand(getServer().getConsoleSender(), "ban " + player.getName() + " Purchase another life at URL");
            }
        }
    }
     
    chasechocolate likes this.
Thread Status:
Not open for further replies.

Share This Page