How much PlayerMoveEvent is too much ?

Discussion in 'Spigot Plugin Development' started by Deo5Ex, Jun 6, 2016.

  1. Hey there !
    Just a slight question. I'm pretty much forced to use a lot of PlayerMoveEvent for a spell plugin, but I'm also a bit concerned about optimization as I heard that PlayerMoveEvent does causes lag.

    The code I put in each event isn't heavy in itself, but there's a lot of them and I'd like to know what can causes lag, especially about PlayerMoveEvent.
  2. According to what you want it to run in each PlayerMoveEvent is whether to give lag, if for example is checking for locations and that does not cause lag
  3. It depends. I have for example a playerMoveEvent that adjusts the locations for a line of particle (a flamethrower), so it checks the target block, sets any entity aimed on fire, and whatever. Does things like that cause lag in move events (in case of, yes, I added a check so nothing's calculated if the player is not using spell)
  4. EMM may perhaps cause lag that, try to find alternative methods to PlayerMoveEvent. If the player is in constant motion PlayerMoveEvent executes each less than one second.