Need help with Bukkit

Discussion in 'Plugin Development' started by jasonderlo22, Jul 11, 2013.

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

    jasonderlo22

    I have been learning programming with bukkit for quite a while now. I have been watching the BCbros tutorials to help me, but unfortunately, they are out dated. I have looked at the bukkit wiki plugin tutorial, but I am looking for something more advanced. I also wanted to know about this, If I wanted my plugin to do this how would I do it: When any player is killed to make it say: Player {PlayerName} was killed by {Killer}. I just wanted to see how you would do that and what methods you would use to do so. So if you could you link some advanced up to date bukkit tutorial that would be nice and also answering my question would also be fantastic.

    Thanks, jasonderlo22
     
  2. Offline

    Drkmaster83

    Code:
    @EventHandler
        public void onPlayerDeath(PlayerDeathEvent event)
        {
            if(event.getEntity().getKiller() instanceof Player)
            {
                Player died = (Player) event.getEntity();
                Player killer = (Player) died.getKiller();
                event.setDeathMessage(ChatColor.RED + "Player {PlayerName} was killed by {Killer}".replace("{PlayerName}", died.getName()).replace("{Killer}", killer.getName()) + ChatColor.RED + ".");
            }
        }
    
     
  3. Offline

    Chinwe



    That, but why that really long setDeathMessage() when you can simply

    Code:
    event.setDeathMessage(died.getName()  + " was killed by " + killer.getName());
     
  4. Offline

    jasonderlo22


    Thanks, That seemed to have worked I haven't ran it yet but I'm pretty sure it would have worked. Do you know any advanced plugin tutorials?
     
  5. jasonderlo22 Unforntunately I only ever seem to find old and outdated bukkit tutorial now-a-days but you can still look. If you understand javadocs documentation then try looking at this: http://jd.bukkit.org/rb/apidocs/
     
  6. Offline

    jasonderlo22

    Yes, I have looked at the javadocs, however I fail to understand. That is why I like video tutorials :s
     
  7. Offline

    Drkmaster83

    I only used that format because he used those specific variables. {PlayerName} and {Killer}... xD
     
  8. Offline

    LinearLogic

    There is a vast quantity of "advanced" aspects of plugin development and no one topic to rule them all, so search for tutorials by topic.
     
Thread Status:
Not open for further replies.

Share This Page