Solved Will an error be thrown?

Discussion in 'Plugin Development' started by RoboticPlayer, Oct 25, 2015.

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


    Just wondering if an error will be thrown if you try to remove a potion effect that the player does not have. For example:
    Player p = (Player) sender;
    If the player doesn't have the blindness effect when that is called, will there be an error or will just nothing happen?
  2. Offline


    Test it yourself
  3. Offline


    @henderry2019 I don't think so, but you might wanna check if the player actually has that active potion effect first, just in case.
  4. Offline


    Agreed, it doesn't hurt to check, also means if anything changes and errors start getting thrown he'd be covered.
  5. Offline


    No error will be thrown... And you don't have to check. The method checks it for you I believe.
  6. Offline


    I think
    will be much more effective.

    But I can tell you that it won't throw an error if the LivingEntity doesn't have the effect.
  7. Offline


Thread Status:
Not open for further replies.

Share This Page