Solved Hiding players

Discussion in 'Spigot Plugin Development' started by Plochem, Jun 17, 2018.

  1. I'm using player#hidePlayer(Player p) in order to make the player a spectator. Problem is, the hidden player still blocks the arrows. How would I make the arrow go through the hidden player? Just think of the spectators when they die in hypixel.

    I don't want to just change the player's gamemode to spectator because the spectators need to have an item in their hotbar to join a game.

    edit: i'll try all suggestions tomorrow since it's pretty late
     
    #1 Plochem, Jun 17, 2018
    Last edited: Jun 17, 2018
  2. try this maybe
    e.getPlayer()#spigot()#setCollidesWithEntities(false)
     
  3. Why not just set their gamemode to spectator? They still have items and can use items.
     
  4. Could you add me on discord at MCMarter#1110? or could you put some code below for how you are making the player invisible as I see how you are doing it, but how far you have gotten with trying to make the person block arrows, but couldn't you just use EntityDamageByEvent and test if the player is included in an ArrayList or is hidden it'll set the event to cancelled and just remove the arrow from grabbing the arrow from being shot from the entity damager
     
  5. Orrrr maybe try this:
    Have a list of your "spectators" or whatever and whenever they get hit by an arrow, it teleports them up 2 blocks and it spawns a new arrow with the velocity of the old one soryy i suck at explaining things hope it helps