Solved getKiller().toString(); doesnt work

Discussion in 'Plugin Development' started by DerSanyar, Mar 27, 2021.

  1. Offline

    DerSanyar

    Hey,
    When i register the Killer without toString() (Player killer = event.getEntitiy().getKiller), in the chat is:
    CraftPlayer(name=theNameOfTheKiller).
    How can i fix it?

    Code:
    @EventHandler
        public void onDeath(PlayerDeathEvent event){
            Player player = event.getEntity();
            event.setDeathMessage(null);
    
            Player killer = event.getEntity().getKiller();
     
  2. Offline

    timtower Administrator Administrator Moderator

    DerSanyar likes this.
  3. Offline

    DerSanyar

    Well, thanks.
     

Share This Page