Solved HELP! On interact not working!

Discussion in 'Spigot Plugin Help' started by HungryBoy02, May 5, 2017.

  1. Okay, so here's my code:
    Code (Text):
    public void onPlayerUse(PlayerInteractEvent event) {
            Player p = event.getPlayer();
           
            if (!(event.getItem().getType() == Material.GRASS)) return;
               
                Server server = p.getServer();
               
                if (!(event.getAction() == Action.RIGHT_CLICK_AIR)) return;
                Logger logger = Logger.getLogger("Minecraft");

                logger.info(p.getWorld().getName() + ", " + plugin.getConfig().getString("Hub World"));
                if (p.getWorld().getName() == plugin.getConfig().getString("Hub World")) {
                    server.dispatchCommand(p, "menu");
                }
        }
    and in the log, it says that the comparison was the same ( logger.info(p.getWorld().getName() + ", " + plugin.getConfig().getString("Hub World")); looked exactly the same)
    but for some reason, it will not dispatch the command no matter what i do!
     
  2. ... this is embarrasing but i just figured it out, i had to to equals ignore case...
     
  3. umm, i was? i already said i realised what i had messed up.