Disable arrow and fluids visibility to other players

Discussion in 'Plugin Development' started by Webster56, Jul 22, 2016.

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

    Webster56

    Hello folks,

    I'm currently developing a pvp-arena plugin, however I'm having some issues with some aspects of pvp

    It is useful to use water or lava buckets to slow down your enemy in an attempt to flee, and shooting him with arrows afterwards.

    However, my arenas are rather tiny (50*50) and potentialy lots of player can play on the same arena. These players aren't visible to all the other players who aren't in their game.

    My problem is: is there a way to allow players to shoot arrows and to pour buckets in their game, but the other players who aren't in this game don't see it (and are also not damaged by these actions), without duplicating my arenas all around the map ?

    I've thought about ProtocolLib, but i'm not sure if it would work for the fluid part.

    Thanks !

    (oh, it's bukkit 1.7.10 by the way)
     
  2. @Webster56
    Well what I suggest doing is preventing any damage that would be done by these sorts of blocks by listening to the PlayerDamageEvent, and for the visibility part I guess you could prevent the packets being sent to certain players. Although this would make them invisble, you would still slow down when walking inside liquids.

    Are you sure this is the best way of doing things? Can't you just have a seperate arena for each game, or only allow one game at a time?
     
  3. Offline

    Webster56

    I could have a separate arena for each game, but i'm afraid this would not be really scalable, i don't really know.

    One game at a time is out of question, there might be 200+ players using this thing.

    Yeah, sadly i don't feel there's a way to do it for the slow problem. I guess multiple arenas would solve all these issues
     
  4. @Webster56
    Yeah you could probably do it by manually setting momentum values and stuff, but using multiple arenas is probably your best bet.
     
  5. Offline

    Zombie_Striker

    @Webster56
    What if you send the water block placement packets only to the two players that are fighting? Using Player.sendBlockChange(location,material,data) you are able to tell only those two players that there is water on the ground, making sure only those two players are affected by the water.
     
Thread Status:
Not open for further replies.

Share This Page