How can I add effects in 1.13?

Discussion in 'Spigot Plugin Development' started by Tomcatchriss, Oct 25, 2018.

Thread Status:
Not open for further replies.
  1. Hello,

    a while ago I created a plugin with emotes. In 1.13 it's now longer working. Sounds working, but what has changed with playEffect?

    This will no longer work. How can I get this working again?
    Code (Text):
    player.spigot().playEffect(loc, Effect.HAPPY_VILLAGER, 1, 1, 3.0F, 3.0F, 3.0F, 40.0F, 100, 5);
    Eclipse says that HAPPY_VILLAGER cannot be resolved or is no field.

    Thanks for your help, Tomcatchriss
     
  2. player.getWorld().spawnParticle(Particle.SPELL_WITCH, loc, 0, 0, 0, 0, 1);

    Info on the parameters the post above
     
  3. Thanks for your help. I will try it.
     
  4. EffectLib is quite useful too, the jenkins server got 1.13 release!
     
    • Like Like x 2
  5. NathanWolf

    Supporter

    It's worth noting that EffectLib now uses Spigot's particle API. So if you all you want to do is spawn a few particles it's just as easy to do it without EffectLib.

    Thanks for the plug though! :)
     
  6. Hmm, now I have a new error message with this code:
    Code (Text):
    player.getWorld().spawnParticle(Particle.VILLAGER_HAPPY, loc, 1, 1, 3.0F, 3.0F, 3.0F, 40.0F, 100, 5);
    VILLAGER_HAPPY cannot be resolved or is not a field

    Any idea how I have to fix this?
     
  7. The code found on the official wiki is happy_villager
     
  8. NathanWolf

    Supporter

    Are you sure you're building against the 1.13 API? And you're using the spigot particle enum? VILLAGER_HAPPY should be correct.

    https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html
     
  9. Choco

    Moderator

    Wrong particle. org.bukkit.Particle
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.