playEffect();

Discussion in 'Spigot Plugin Development' started by fujiboy4, May 25, 2015.

  1. Why is playEffect deprecated. And why is it not visible to other players?
     
    • Agree Agree x 1
  2. Could you provide the code?
    Its kinda hard to help without knowing exactly what your trying to do :p
     
  3. It is deprecated because, no idea. You can use ParticleEffect lib for no deprecated methods.

    Just make a for loop Player p : list of players and send it to all players.
     
  4. Or loop through all players and only send it to the ones who are close enough to be able to see the effect.
     
  5. Um, should I take a screenshot?... Cause its defiantly deprecated.
    Code (Text):
    // ** Example **


    @SusspressWarnings("deprecated")
    @EventHandler
    public void onMove(PlayerMoveEvent e) {

    final Player p = e.getPlayer();

    playEffect(p.getLocation, Effect.MOB_SPAWNER_FLAMES, 500);

    }
    Something like that.
     
  6. You can send them to everyone if that's what you mean.
     
  7. Why a library when we have a particle API in Spigot? (See Player.Spigot#playEffect() and World.Spigot#playEffect())
     
    • Agree Agree x 2
    • Useful Useful x 1
  8. With a Library you can do more advanced stuff.
     
  9. With NMS I can do everything, your point being? That aside, most methods of that library are already inside the Spigot API, aside a few 'facade' methods which you would have to do manually.
     
    • Agree Agree x 1
  10. Yeah but when you're lazy you can just use that lib.
     
  11. Thanks Well of course playEffect() is deprecated, why wouldn't it wouldn't it better to understand ease show us some code it wouldn't it would probably can really make this! Thanks Well of code it would probably make things a lot better to understand easier to understand easier to understand ease show us some course show us some code it wouldn't it be? I hope you please show us some course show us some code it be? I mean really make this! Thanks Well of course pleasier to understand. I hope you read
     
    • Funny Funny x 1
  12. That english though, uhh, what did you said?
     
    • Agree Agree x 1
    • Winner Winner x 1
  13. What!?
     
  14. I mean really the one not making to lie What did you're really perfect. And, english is my english? I mean really the one not going sense, haha. Plus why would say I'm pretty cool not going sense, haha. Plus why would I would I would say I'm pretty cool not going to lie What do you say I'm pretty cool not making sense, haha. Plus why would said? I mean what do yeah I ever tell you're really my english? It language so yeah I mean really the one not going sense, haha. Plus why would I mean why would
     
  15. * facepalm *
     
    • Funny Funny x 2
    • Agree Agree x 1
  16. True, however this can sometimes be a problem. Especially for those who are looking to spawn just vanilla particle behavior.

    This is not always the best idea to replace depreciated code like the LAVA_POP effect found in playEffect class. For example, using a particle lib gives you COMPONENTS of these particle effects and not the full behavior itself. So if a coder wanted to spawn for example the lava particle pop effect work exactly how it works in vanilla Minecraft they could not do that in a Particle lib without getting into some crazy trigonometry. And even then it would be very hard to get it to spawn exact to the way the effect works in vanilla.
     
    #19 _TureNord, Oct 23, 2015
    Last edited: Oct 23, 2015
  17. Hex

    Hex
    IRC Staff

    Don't use a library you don't need. Spigot's particle API is fine. Don't worry about the playEffect deprecation too much, Bukkit's use of deprecation has been sketchy to say the least.
     
    • Like Like x 1
    • Agree Agree x 1