Solved Particles problem.

Discussion in 'Plugin Development' started by xFoundation, Apr 23, 2017.

Thread Status:
Not open for further replies.
  1. Hey guys,

    Today I have a problem with my code.

    [​IMG]

    How to reduce the amount of particle ?

    I have this code:

    Code:
    World world = e.getPlayer().getWorld();
                        world.playEffect(blocktoadd, Effect.STEP_SOUND, Material.DIAMOND_BLOCK);

    Usefuls informations: It's for a railgun game. With a right-click, i'm shooting fireworks to instakill players. I wanted to add an effect (diamond particles) in the location : blocktoadd (it's a BlockIterator).

    Thanks for the help!
     
  2. Offline

    ipodtouch0218

    Quakecraft? Hmmm...

    Anyway, are you using 1.8? In later versions of Spigot/Bukkit, you can spawn particles separate using World#spawnParticle
     
  3. It looks hard hmm
     
  4. Offline

    Zombie_Striker

    ipodtouch0218 likes this.
  5. @Zombie_Striker
    I tried this:

    Code:
    int count = 5;
    p.getWorld().spawnParticle(Particle.BLOCK_DUST, blocktoadd, count, Material.DIAMOND_BLOCK);
     
  6. Offline

    Zombie_Striker

  7. @Zombie_Striker

    I did this, it work but i don't know how to set the material (for the particle type)

    Code:
    p.getWorld().spawnParticle(Particle.BLOCK_CRACK, blocktoadd, 0, 0, 0, 0, 57);
    I wrote 57 because it's the ID of diamond block.

    Thanks!
     
  8. Offline

    Zombie_Striker

    @xFoundation
    Block Crack is different than Block Dust. Block crack is the 'particle' that displays when you are mining a block (the cracks in the block). BLOCK_DUST is what you want.
     
  9. @Zombie_Striker

    I wrote this:
    Code:
    p.getWorld().spawnParticle(Particle.BLOCK_DUST, blocktoadd, 5, 0, 0, 0, 57);
    5 for the amount of particles, and 57 for the diamond particle but it doesn't work :/

    With BLOCK_CRACK:

    [​IMG]
     
    Last edited: Apr 27, 2017
  10. Offline

    Zombie_Striker

    @xFoundation
    57 is actually the data for TNT, though I do not know why the textures would be bugged. Change it to 68 (Diamond Block) and see if that fixes the problem.
     
  11. @Zombie_Striker

    I have always the same particles :/

    Code:
    p.getWorld().spawnParticle(Particle.BLOCK_CRACK, blocktoadd, 2, 0, 0, 0, 68);
    
     
    Last edited: Apr 30, 2017
  12. It works ! Thanks
     
    Last edited: Apr 30, 2017
Thread Status:
Not open for further replies.

Share This Page