other.hidePlayer(player) don't work

Discussion in 'Plugin Development' started by MiniDigger, Oct 26, 2013.

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

    MiniDigger

    Hi guys,
    I am developing a minigame plugin and ran into some troubles. When a player is out, I want him to specate the other player. I try to hide them, for the other players with this code:
    Code:
    for (Player other : Bukkit.getOnlinePlayers()) {
    other.hidePlayer(p);
    }
    
    but the other players still can see the player.
    Thank you for helping me.
     
  2. Offline

    the_merciless

    Dont you mean

    p.hidePlayer(other);

    And check for the same player


    Code:
    for (Player other : Bukkit.getOnlinePlayers()) {
    if (other != p){
    p.hidePlayer(other);
    }
    }
    Failing that, maybe try using potion effects
     
  3. Offline

    MiniDigger

    the_merciless I dont what that the other players see the player. So I have to use other.hidePlayer(player) dont I? I dont want to use potions because I dont want the player getting hitted by arrows and that stuff
     
  4. Offline

    xTrollxDudex

    MiniDigger
    Even if you use hidePlayer arrows still bounce off and clearly show where the player is
     
  5. Offline

    the_merciless

    other.hideplayer(p)

    will make 'player' invisible to 'other'

    Edit: corrected
     
  6. Offline

    MiniDigger

    Last edited by a moderator: Jun 5, 2016
  7. Offline

    xTrollxDudex

    That's not the javadocs btw. That's doxygen.

    And you just proved his point -_-
    No. If you use invisibility arrows stick into in midair. If you use hidePlayer then the arrows "bounce" off of you an imaginary arrow still goes to the area behind you. Key word is imaginary, it will still do damage to the target behind you and will land in the place behind you, you just can't se it once it "hits" you.
     
  8. Offline

    MiniDigger

    xTrollxDudex I am a bit tired at the moment .... Ill think tomorrow about this :D Its confusing
     
Thread Status:
Not open for further replies.

Share This Page