Bad code WTF

Discussion in 'Spigot Plugin Development' started by Newpredator, Jun 20, 2015.

  1. Code (Text):
    package me.newpredator;

    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.ItemStack;

    public class Kit extends JavaPlugin implements Listener{

        public void onEnable() {

        public void PlayerJoin(PlayerJoinEvent e) {
            Player p = e.getPlayer();
             if (getConfig().getString("Enabled-World").contains(p.getLocation().getWorld().getName())) {
            p.getInventory().setItem(1, new ItemStack(Material.BOW));
            p.getInventory().setItem(0, new ItemStack(Material.IRON_SWORD));
            p.getInventory().setItem(2, new ItemStack(Material.FISHING_ROD));
            p.getInventory().setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
            p.getInventory().setHelmet(new ItemStack(Material.IRON_HELMET));
            p.getInventory().setLeggings(new ItemStack(Material.IRON_LEGGINGS));
            p.getInventory().setBoots(new ItemStack(Material.IRON_BOOTS));  


    Not found :c
  2. Register your class as a listener.
    • Agree Agree x 1
    • Useful Useful x 1
  3. Do what @Puharesource said, also you forgot the EventHandler annotation.
    • Agree Agree x 1
    • Useful Useful x 1
  4. If you don't know how to do the things the above people have listed,
    check out this resource. It'll teach you how and explain why things are done.

    (If it's not allowed to post links to that website, please notify me)
    • Useful Useful x 1
  5. Gianluca

    Gianluca Retired Resource Staff
    Retired Patron

    Register your events in your onEnable, and add the EventHandler annotation before the start of your join message
  6. So when you use this plugin, and you wanna use it in world and world_nether, it's not possible. G.G
  7. The thread title hurts my eyes
    • Agree Agree x 2