The plugin ("peek") I'm making grants spectator gamemode when you call the command and teleports the player back to their original position when they reinitiate the command. This part works fine. At the moment the plugin works as follows: /peek (if no player file found, create initial datafile) check wether the "peek" mode is activated from player file if no -> update file with necessary variables, activate specator if yes -> teleport player, disable spectator, update file My main class atm only checks for plugin folders and creates them if necessary and calls upon the another class (new PeekCommand(this)), which implements CommandExecutor. I would like to track the position of the players who have the plugin activated. I'm creating a range check from their original position and teleporting them back a bit if they cross a certain range. (Basically the plugin grants a limited range spectator mode mainly to be used to troubleshoot builds or have different angles for builds more reasonably.) Two reasonable ways to track, that I see. 1. Track players who have a certain variable on in the yml file (the pluging creates player specific files to keep track of variables upon command). Tracking this would mean looping the plugin all the time in the back? How to achieve that? Or are the plugins always "on" anyways, checking for met conditions? Some from of eventhandling? Currently not in the know how to properly implement eventhandling or 2. Create a loop that activates when the plugin is called (and such gamemode changed) and ends when the plugin is called again. That would require changing the structure for the plugin to check joining players status too, to account for disconnecting while peek mode activated. I assume this could be a decent way to do this. Can I just put a loop that runs when the mode is activated, and that ends when it receives another /peek? Not sure how to do that -- can the player call the command again when it's still running on a loop? ( 3. A better way that some wise wizard might hint me towards to) I'm very new to Spigot API - actually started a couple hours ago - and rusty with programming, so I'm not sure how to implement either in a plugin. Basically I don't know how to implement continuous checks in a plugin. Being as efficient is obviously a goal, though many players won't be using this concurrently. The math for the ranges etc is easy, I only need some hints how to track the player movement properly and efficiently. I tried to google around but didn't feel confident enough in my understanding of anything I found, and I didn't find much. I can paste the code if asked, but didn't feel like it was necessary for this. Tracking every players movement seems silly, as we have conditions we can check before doing that. If anyone is interested, one feature I haven't yet decised on is how to handle possible abuse. Why I need to think and research about this more is because I don't want the command to be used to glitch out of situations (for example suffocation trap, lava, on the same block with loads of mobs etc). Maybe I try to add a check if they have taken damage recently, or maybe more simply a) there can't be entities within his activation coordinates and b) their activation coordinates must be air blocks c) they must be full hp. They are limiting but not plugin breaking (assuming there are air blocks in the nether and end) and remove a lot of the abusing, I think. Probably a good thing to add is also to check wether they are stationary, so it can't be abused in falling. Not sure how to implement that either, yet. I also might add some limit or cost to the usage (1 diamond from inventory every 5 uses etc), as I prefer vanilla experiences but feel like a bit of "cheating" could add some fun to the experience.