Solved How to get player effects using NMS

Discussion in 'Spigot Plugin Development' started by FrancoAlvarez, Jun 14, 2021.

  1. Im creating a multiversion plugin but i have a problem with the potion effects in newer minecraft versions.

    for example if in my server there are players using 1.8 i want to get the effects that those players have,
    or if some players are in 1.9 i want to get the effects from this version as Levitation but i dont know how to do it, im dont know if this is possible with NMS. or with other way.

    I dont think this was possible with NMS thats weird xd, but if you know how to do it please say me xd.

    Thanks you for read <3
     
    • Winner Winner x 1
  2. Yes i know that Spigot Api already have a method for that, but this no longer work when a have multiples versions of spigot as project libraries and for example when im coding something for 1.9 players where there is the effect Levitation that there is not in minecraft 1.8 i couldnt found it in the enum PotionEffectType, idk if you understand me my english is not perfect.
    I leave some pics so maybe u can understand me better.

    My project libraries are those:

    xd1.png

    My Problem:

    xd2.png

    Im think that this is due im invoking the enum PotionEffectType of a 1.8 librarie but i want to know how to switch to the 1.9 one....


    Sorry for the dumb code xD but is for the people understand me
     
    #3 FrancoAlvarez, Jun 15, 2021
    Last edited: Jun 15, 2021
  3. 1.9 Raise the spigot library priority to the top
     
  4. And how i do it?
     
  5. Adjust the priority in the Order and Export tab next to the Library tab. Click the added jar file and adjust it with Up, Down or Top, Bottom among the buttons on the right.
     
  6. Thanks you!! You fix my problem :)