[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


    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


    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


    This is what I do

    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


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


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


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



    (not static)
  8. Offline


    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


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


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


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


    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