Solved Particle Effects

Discussion in 'Plugin Development' started by CeramicTitan, Nov 14, 2012.

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

    CeramicTitan

    Hi, I was just wondering if anyone knows how to get these particle effects


    particles.png
     
  2. Offline

    Terradominik

    you want playEffect();

    playEffect(Location loc, Effect effect, int data)
    Plays an effect to just this player.

    so you have to do
    player.playEffect(player.getLocation(), Effect.SOMETHING, 0);

    for data you can simply add 0 (for some effects a other number is useful)
    for Effect.SOMETHING you can add the Effect, i think its MOBSPAWNER_FLAMES
     
  3. Offline

    fireblast709

    The particles look like the blockbreak particles for lava
     
  4. Offline

    CeramicTitan

    Unless you spawn a block at the player and break it immediately?
     
  5. Offline

    fireblast709

    or... packets. Packet # 61 to be exact
     
  6. Offline

    CeramicTitan

    I don't know how to code with packets
     
  7. Offline

    fireblast709

    Assume a player who you want to send the packet to, Player t:
    Code:java
    1. Packet61WorldEvent packet = new Packet61WorldEvent(2001, x, y, z, 11, false);
    2. ((CraftPlayer)t).getHandle().netServerHandler.sendPacket(packet);

    Replace x, y and z with the location. This will spawn lava break particles at x,y,z. You will need Craftbukkit.jar as a library to build your jar.

    This would be done for multiple players by basically doing this for each player :3.
    More packets at: http://www.wiki.vg/Protocol
     
  8. Offline

    CeramicTitan

    How do you know what packet number it is? For future reference
     
  9. Offline

    fireblast709

  10. Offline

    chasechocolate

    fireblast709 I think he means if there is a list for all the different packets and what they do.
     
  11. Offline

    CeramicTitan

    More like on this website: http://www.wiki.vg/Protocol how do you find what the proper packet number is
     
  12. Offline

    fireblast709

  13. Offline

    rfrehv

    Actually "Sound or Particle Effect" is 0x3D which is 49.
     
  14. Offline

    fireblast709

    rfrehv explain yourself? Have you any knowledge how to convert hex to dec? 3*16 + 13 = 61 right?
     
  15. Offline

    rfrehv

    Yup I'm pretty sure it is 61, I should've said "which is 49 on the site". Said that b/c I went to http://www.wiki.vg/Protocol and you simply won't find that as 61. I had to actually Ctrl+F effects. Sorry for the "mistake" :p
     
  16. Offline

    fireblast709

  17. Offline

    caxco93

    i cant seem to find the Packet61WorldEvent class
    what am i missing? how do i send the lava break packet?
     
  18. Offline

    fireblast709

    Later it got clear that the Javadocs were lacking some information. use
    Code:
    world.playEffect(someLocation, Effect.STEP_SOUND, blockID);
     
  19. Offline

    caxco93

    i dont want the sound, i want the particles
     
  20. Offline

    fireblast709

    I already told you, the javadocs is kind off lacking information there. You should try it out, I was amazed myself that it worked.
     
  21. Offline

    caxco93

    hehe thx ill give it a try then. thanks for replying to such an old thread.
     
  22. Offline

    dillyg10

    How can you do this with data, for example if I wanted to do red wool. Is there some bit shifting I need to do to make it work?
     
  23. Offline

    chasechocolate

    Yeah, I'm wondering that too... The playEffect takes a Material/int, not ItemStack where you can add your own data.
     
  24. Offline

    CeramicTitan

    this doesn't work for items with metadata. Eg. Red wool, mossy smooth stone brick, etc
     
  25. Offline

    The_BloodHound

    How are you sending the particles to the player location? Is there some variables I'm missing or am I just not understanding?
     
  26. Offline

    eyamaz

    If you are having difficulties, please open your own thread instead of necroing a thread from a half year ago.

    Locked
     
Thread Status:
Not open for further replies.

Share This Page