Spectator

Discussion in 'Plugin Development' started by TheGamblingMan, Jul 6, 2014.

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

    TheGamblingMan

    Hey how is it possible to make player's who are in an array list that they can see each other a bit transperant and the players who play can't see them?
    And how can i make that this player's can't block arrows?
     
  2. Offline

    unrealdesign

    1. Make a Set<Player> for all spectators in the game
    2. Make a Set<Player> for all players in the game
    3. Loop through all spectators in the game and give them an invisibility potion that will make them semi-transparent
    4. Loop through all the players in the game, and for each one loop again through all the players that are spectators and do (player playing).hidePlayer((spectator))
    5. Once a player becomes a spectator give them the invisibility potion and for all players playing, do the hidePlayer(Player p) with the parameter of the new spectator player and then finally unhide all the players in the spectator Set from the new spectator
    6. Once the game ends, unhide all the players from each other and remove the potion effects
     
  3. Offline

    TheGamblingMan

    i know how to make them invisible for all players but how does this work that they are so transparent so that you still can see him but can see trough him?
    Because with an invisible potion they disapear again completly
     
  4. Offline

    Mr360zack

    don't store player objects ;p
     
    KingFaris11 likes this.
  5. Offline

    unrealdesign

    Unless the game is really long, it doesn't matter. Most games people make aren't long at all, so storing Player instances doesn't matter.
     
  6. Offline

    TheGamblingMan

    what do you mean with long?
     
  7. Offline

    fireblast709

  8. Offline

    unrealdesign

    If you want to be safe
     
  9. Offline

    TheGamblingMan

    Where can i read something about this set collections? I haven't used this untli now :) and i want to learn how i use it
     
  10. Offline

    macboinc

  11. Offline

    TheGamblingMan

    Yes i have seen this but i don't know if it still works because the example code doesn't work :(
     
Thread Status:
Not open for further replies.

Share This Page