What's wrong with this code?

Discussion in 'Plugin Development' started by djyee, Aug 21, 2014.

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

    djyee

    What's wrong with this code?
    Code:java
    1. @EventHandler
    2. public void onPlayerMove34(PlayerMoveEvent event) {
    3. {
    4.  
    5. final Player player = event.getPlayer();
    6.  
    7.  
    8. Location loc = new Location(player.getWorld(), getConfig().getInt("X"), getConfig().getInt("Y"), getConfig().getInt("_Z"));
    9.  
    10.  
    11. Location b21 = loc.clone().add(1,0,1);
    12. if (player.getLocation(b21) != b21)
    13.  
    14. player.sendMessage("Its Work");
    15. }
    16. }
    17.  
     
  2. djyee Did it throw an exception? and why did you put it in 2 breakets? is the "_Z" wanted with the "_"? please tell us more about your problem
     
  3. djyee getInt("_Z") ? dont you mean getInt("Z") ?
     
  4. Jack Price-Burns would be awesome xD "What's wrong with this code" like a find the error game with one letter to much :D was also an idea of me
     
  5. Offline

    stormneo7

    Compare locations using the locA.distance(locB) feature.
    For instance,
    Code:java
    1. if(locA.distance(locB) <= 3){
    2. // Run Code
    3. }
     
Thread Status:
Not open for further replies.

Share This Page