Check onEnable cause (Reload or Start)

Discussion in 'Plugin Development' started by Bammerbom, Apr 9, 2014.

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

    Bammerbom

    I want to check for my plugin if the server start (onEnale) cause is a reload or start. How?
     
  2. Offline

    Shadowwolf97

    Not entirely sure if this is possible. You might be able to find an entity and see how long its been alive, but I'm not sure if ticksLived gets reset when the server reloads or not. You could set the metaData of all players to something, because metadata does not change on reload. So if there is a player with the metadata value, then it was a reload, if there wasnt, then either all metadata reset or most likely the server restarted.
     
  3. Offline

    themuteoneS

    Create boolean that default to false and set it to true on your onDisable. If it's true when the plugin enables then it was a restart. Clean and simple!
     
Thread Status:
Not open for further replies.

Share This Page