Question Getting Killers to display in a list?

Discussion in 'Plugin Help/Development/Requests' started by PENGUllN, Aug 17, 2015.

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

    PENGUllN

    Hello to who ever is reading this
    I have been trying to use an event "PlayerDeathEvent"
    to get the "Player Only" name that killed the player
    then using the .getKiller().getName()
    To put them on a command that when a player types the command
    it displays a list with the killer / killers if multiple names on
    but i have not even got it to display there name in chat
    I Mean I'm just asking for some examples ? pointers of where to look how to do this anything that can help me please ?
     
  2. Offline

    SuperGamesBros

    .getKiller().getName(%player%)
    try this XD
    if not try this
    .getKiller(%player%).getName(%player%)
    and try also use display after it

    If you need more help send me the file ill fix it for ya

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 11, 2016
  3. Offline

    Scorpionvssub

    Code:
            PlayerStorage storage = getPlayer(e.getEntity());
            if (storage != null) {
                if (e.getEntity().getKiller() != null) {
                    PlayerStorage killer = getPlayer(e.getEntity().getKiller());
    Took this from a kitpvp code but you can just remove storage and playerStorage and replace them, like String killer = e.getEntitity.getkiller adding the () ofcourse. Then if u want a list you can do a List<String> players and add them to it first checking if they arent already on the list.
     
Thread Status:
Not open for further replies.

Share This Page