Error...

Discussion in 'Plugin Development' started by JeykoExample, Sep 26, 2014.

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

    JeykoExample

    Hey Guys,

    i wanted to ask you, if you know what i did wrong in this class?

    PHP:
    package me.jeykoplays.Listeners;

    import me.jeykoplays.Main.Main;

    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.Action;
    import org.bukkit.event.player.PlayerInteractEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;

    public class 
    MeetingEvent implements Listener {
        
        private 
    Main plugin;
        
        public 
    MeetingEvent(Main plugin) {
            
    this.plugin plugin;
        }
        
        @
    EventHandler
        
    public void onRightClick(PlayerInteractEvent e) {
            
    Player p e.getPlayer();
            if (
    e.getAction() == Action.RIGHT_CLICK_BLOCK
                    
    || e.getAction() == Action.RIGHT_CLICK_AIR) {
                
                
    ItemStack Slot1 = new ItemStack(Material.COMMAND1);
                
    ItemMeta met1 Slot1.getItemMeta();
                
    met1.setDisplayName("§bMeeting");
                
    Slot1.setItemMeta(met1);
                
                if (
    p.getItemInHand() == Slot1) {
                    
                    
    this.plugin.reloadConfig();
                    for (
    String t this.plugin.getConfig().getStringList("meeting.players")) {
                        
    Player listplayer Bukkit.getPlayerExact(t);
                        if (
    listplayer.isOnline()) {
                            
                            
    String x this.plugin.getConfig().getString("meeting.location.x");
                            
    String y this.plugin.getConfig().getString("meeting.location.y");
                            
    String z this.plugin.getConfig().getString("meeting.location.z");
                            
    String world this.plugin.getConfig().getString("meeting.location.world");
                            
                            
    Location loc = new Location(Bukkit.getWorld(world), Integer.parseInt(x), Integer.parseInt(y), Integer.parseInt(z));
                            
    p.sendMessage(x+y+z+world);
                            
    p.teleport(loc);
                            
                            }
                        }
                    }
                }
            }
        }

    Normally it should get the Location and teleport there ... but nothing is happening ... no error nothing ...
     
  2. Offline

    Gnat008

    JeykoExample
    When there are no errors, put in System.out.println("debug n"); inside each if statement, where n is a number, so you can find how far it gets. Then run the command, and look in the console, and see where it gets to.
     
  3. Offline

    Nateb1121

    Maybe a noob question but, have you registered your listener class in the class that extends JavaPlugin?
     
Thread Status:
Not open for further replies.

Share This Page