Hard Coded Locations

Discussion in 'Plugin Development' started by nrs23, Jan 29, 2014.

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

    nrs23

    So currently I'm using this to save hold locations, then in the onBlockBreakEvent it runs a if location equals either red1 red2 or red3, player.sendmessage("blablabla") type of thing. It doesn't seem to work, is there either something wrong with the code or is there a better way.

    Code:
            Location loc = event.getBlock().getLocation();
            World world = Bukkit.getServer().getWorld("world");
            Location red1 = new Location(world, 16, 95, -112);
            Location red2 = new Location(world, 3, 88, -109);
            Location red3 = new Location(world, 5, 94, -115);
    To clarify when I say it doesn't work I mean the rest of the Event listener works fine but that if statement doesn't seem to even be noticed there are no errors and the blocks break just like normal
     
  2. Offline

    Alshain01

    We need to see more code than that. Are you canceling the event? Are you using == instead of .equals(). Are you actually using integer literals or is that some kind of example? There are many many possible reasons it isn't working. We need code.
     
  3. Offline

    Shockwave317

    we have to see more to be able to do anything...
     
Thread Status:
Not open for further replies.

Share This Page