Solved Setting compass target does not work

Discussion in 'Plugin Development' started by letsgo00, May 27, 2017.

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

    letsgo00

    I'm working on a plugin which sets the compass location to the middle of an arena using this:
    Code:
     public void updateCompass(){
            for(Player p : players.keySet()){
                p.setCompassTarget(arena.getBeacon());
            }
        }
    But when I call this method the compass in my inventory does not change.

    I have tried debugging it with player.sendMessage(p.getCompassTarget()); and this shows that the compass location is set to where I want it, but still does not update the compass in my inventory.
     
  2. Offline

    timtower Moderator Moderator

    @letsgo00 Try also calling p.updateInventory(), might work, not sure though.
     
  3. Offline

    letsgo00

  4. Offline

    timtower Moderator Moderator

    @letsgo00 Run the code, then check a minute later what the target it.
     
  5. Offline

    letsgo00

    @timtower Oh actually it is a minecraft bug, I have restarted my client and it works now
     
  6. Offline

    timtower Moderator Moderator

    @letsgo00 Weird... Hope for you that it is not consistent ;)
     
  7. Offline

    RBT_KitK4t

    Make sure your getBeacon returns a loction

    Envoyé de mon SM-G530W en utilisant Tapatalk
     
  8. Offline

    timtower Moderator Moderator

    @RBT_KitK4t
     
Thread Status:
Not open for further replies.

Share This Page