Solved PacketPlayOutWorldParticles vs. player.spawnParticle

Discussion in 'Plugin Development' started by mine2012craft, Nov 25, 2018.

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

    mine2012craft

    This is really just a preference question to see which is better.

    I notice that there are two ways a player can spawn particles: PacketPlayOutWorldParticles or player.spawnParticle (or world.spawnParticle)

    Is there any performance or options difference between the two? Or are these practically similar in every aspect and it doesn't matter?

    -WarlordWeaponry
     
  2. Offline

    ToldiIII

    PacketPlayOutWorldParticles plays only the player, so particle effects are only visible to him, the player & world.spawnParticle is seen by all online players.
    Or no?
     
  3. Offline

    mine2012craft

    player.spawnParticle spawns particles for that player only
    world.spawnParticle spawns particles in the world for everyone to see.
     
  4. Offline

    Zombie_Striker

    @mine2012craft
    Player#spawnParticle does not require and NMS, so it is not version dependent.

    If you use packets, you either use ProtocolLib to handle the NMS for you, or you have to use NMS, which makes it version dependent.
     
  5. Offline

    mine2012craft

    Thank you for answering. I was really looking on whether either one changes performance, but I'll assume they're about the same.
     
Thread Status:
Not open for further replies.

Share This Page