Spectators Blocking Projectiles.

Discussion in 'Plugin Development' started by Ad237, Jun 26, 2013.

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

    Ad237

    I have a custom coded gun plugin on my server and I also have a first person spectator plugin. The problem is when a player shoots a gun while being spectated the bullet hits the spectator which cancels the bullet. I have done a bit of research into this and the only methods I could find were to teleport the spectator away and launch a new arrow. The problem with this is this may cause some derp bugs with spectators. Anyone know a better way? By the way the spectators are hidden using Bukkit.hidePlayer() and they are stored in an arraylist. Any help would be appreciated.
     
  2. Offline

    RealDope

    Cancel the projectile and apply the damage/knockback to the player manually maybe
     
  3. Offline

    Ad237

    RealDope I would prefer if the player could see the projectile though.
     
  4. Offline

    RealDope

    Yes you cancel the event when the projectile hits, not when it's launched
     
  5. Offline

    foodyling

    Cancel the event, capture the incoming arrows velocity, delete the arrow, move the spectator to a different location, spawn an arrow, apply previous velocity of the arrow that hit the spectator.
     
  6. Offline

    Limeth

    Or you could spawn it behind the blocking player without teleporting him away I guess.
     
  7. Offline

    RealDope

    Guys the problem is that he doesn't want to teleport the spectator and the spectator is directly inside the real player.
     
  8. Offline

    blablubbabc

    For the shooter being spectated, you could spawn the arrow a bit in front of the player. Far enough away, that it doesn't hit the first-person-spectator "inside" the shooter. (probably not the nicests option.. but the best I currently was able to think of for the shooter..)

    For the target being not hit by the arrow because of the spectator spectating him: you could remember for each spectator, which player he is currently spectating and if the spectator is hit, you handle it as if the player which is spectated would have been hit instead.
     
Thread Status:
Not open for further replies.

Share This Page