1.13 EnumParticle

Discussion in 'Spigot Plugin Development' started by CodeMaker, Sep 16, 2018.

  1. Hello, I am trying to update someone else's plugin for myself (author is inactive).
    The plugin uses an
    Code (Text):
    enumParticle = PackageType.MINECRAFT_SERVER.getClass("EnumParticle");
    which was removed in 1.13.
    What can be used to replace it on the new version?
    Then later on there is another method I'm having trouble changing, it has this method that also gives an error when trying to use the particles in game.
    Code (Text):
    setValue(packet, true, "a", enumParticle.getEnumConstants()[effect.getId()]);
    Where true is called declared and "a" is the field name.

    Does anyone know which is the correct usage of those in 1.13?
  2. it’s moved from. particle#display to World or Player#SpawnParticle()

    Sent from my iPhone using Tapatalk
  3. I am talking about particle NMS though.
  4. Would be in the world object most likely. You can’t do it from the particle enum now

    Sent from my iPhone using Tapatalk
  5. Why would you use NMS?
  6. As I mentioned this is not my plugin I am just trying to update it because author is not updating it anymore and I need it for my server.
    And since it works with NMS to change would be way too much work.
  7. You’re going to have to change it anyways as the way particles were done is different from how they are done now. Suggest updating it to use the API and you’ll have a lot less problems down the road and it’ll be easier to maintain. Nms is fine when there’s no good api methods to use but for particles you’re kind of just over complicating things by trying to use nms

    Sent from my iPhone using Tapatalk
  8. I also suggest just getting rid of the NMS code and replacing it with code using the regular API. It's a lot easier and will not have to be maintained every version.
    • Agree Agree x 1
  9. Eventually use Reflection if you still want to use NMS, but it is still recommended what has been mentioned above (using API methods).

Share This Page