Arena borders

Discussion in 'Plugin Development' started by TopTobster5, Jul 3, 2014.

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

    TopTobster5

    Hi

    So currently in my plugin, players are teleported back to spawn when they leave the arena. This is done by checking every second if the player is in the arena or not.

    However, I would much rather just block people from leaving the arena. What's the easiest way of implementing this? Would I be forced to use a PlayerMoveEvent as I can cancel that, or is there another way?.

    Thanks in advance for any help!
     
  2. Offline

    teej107

    Yes check to see if the player is outside of the arena and cancel then PlayerMoveEvent if they are.
     
  3. Offline

    TopTobster5

    teej107 Alright. I was looking to see if there was a way to not use the player move event, but if this is the only way, then thanks. :)
     
  4. Offline

    teej107

    TopTobster5 You can use a scheduledSyncRepeatingTask instead and iterate over each player and see if they are in the boundaries as well. No events needed.
     
  5. Offline

    TopTobster5

    teej107 How would I cancel their movement and move them back into the arena? I already scan through the players and move them back to the spawn, but I w0uld rather they just get stopped.
     
  6. Offline

    teej107

    TopTobster5 It would be better to use a PlayerMoveEvent for that then.
     
  7. Offline

    TopTobster5

Thread Status:
Not open for further replies.

Share This Page