KitPvP Plugin, Show UsedKit and health for the killer!

Discussion in 'Plugin Development' started by ImVaargen, Mar 14, 2015.

Thread Status:
Not open for further replies.
  1. Hello! I need help with a code. It is when someone kill a player it will shows the player that died off the killer a message, it will shows what kit the person had to kill and how much health he had.

    My code. This code is not working.
    Code:
    @EventHandler
        public void onPlayerDeath1(PlayerDeathEvent e){
            Player p = e.getEntity().getPlayer();
            Player k = e.getEntity().getKiller();
            Damageable d = (Damageable) p;
            k.sendMessage("§7You killed §3" + p.getName());
            p.sendMessage("§7You got killed by §3" + k.getName());
            p.sendMessage("§7HP: §a" + d.getHealth());
            p.sendMessage("§7Using the kit: §a" + kit that the person used to kill the player here );
        }
     
  2. @ImVaargen Firstly, you should use § you should use ChatColor.
    Secondly, did you make the kit plugin?
    Lastly, Why are you getting a damageable? Why not use k.getHealth()?
     
  3. 1. okay, i can use ChatColor....
    2. Yes, this is just the killed bit.
    3. the k.getHealth(); is not working. I got errors on getHealth.
     
  4. Offline

    Regablith

    Off-Topic: Why is ChatColor better to use over the section symbol?
     
  5. Offline

    Skionz

    In the event that the symbol is changed, you are going to have to go back through your plugin and change each symbol; however, if you are using ChatColor instead you will be fine. It is also easier to read.
     
  6. @ImVaargen Well since you made the kit plugin just track what player has what kit and then check what kit that player has.
     
  7. Offline

    Regablith

    Ah okay
     
Thread Status:
Not open for further replies.

Share This Page