[Solved] How to make a player invisible

Discussion in 'Plugin Development' started by Jogy34, Apr 20, 2012.

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

    Jogy34

    For a plugin I'm making I want to make a player invisible for a certain amount of time. I know you have to stop packets from being sent I just have no clue how to stop them or what packets I need to stop. Can someone please help me with this?
     
  2. Offline

    vildaberper

    player.hidePlayer(Player player);
    player showPlayer(Player player);
    player.canSee(Player player);

    Something like that, can't really remember (there's an api for that).
     
  3. Offline

    Iron_Crystal

    This is what I do

    Code:java
    1. for (Player players : Bukkit.getOnlinePlayers())
    2. {
    3. players.hidePlayer(player);
    4. }


    Where players are the online players and player is the person being hidden
     
  4. Offline

    Musicguy

    With that code, (player) in the code players.hidePlayer(player) reports this error : player cannot be resolved to a variable
     
  5. Offline

    Sabersamus

    Then you dont have a variable named player :p
     
  6. Offline

    Musicguy

    Lol, thanks Sabersamus. Is there a way to make a player visible again?
     
  7. Offline

    Sabersamus

    Player.showPlayer(otherPlayer);

    (not static)
     
  8. Offline

    stuntguy3000

    Sorry for bumping a super duper old thread, but i don't want to copy this thread again,

    Is there a way i can hide a player for everyone except ops? I think i am not understanding how to use this method thing..lol
     
  9. Offline

    drtshock

    Add an if statement inside of the for loop?
     
  10. Offline

    stuntguy3000

    I mean like, i don't understand how to actually do .hideplayer
     
  11. Offline

    drtshock

    Put that inside of a command method or something, then it vanishes player from everyone online.
     
  12. Offline

    stuntguy3000

    Oh wow im a hurp,

    Just realised how to use it ._.

    Thanks anyway :p
     
    shmkane and drtshock like this.
Thread Status:
Not open for further replies.

Share This Page