Particles Not Showing

Discussion in 'Plugin Development' started by mpattrick, Feb 16, 2015.

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

    I've been creating a plugin for when you throw a egg it plays a sound and Effects but i have encountered an error and it isnt displaying some Particles.

    Code:
    e.getWorld().playEffect(e.getLocation(), Effect.MOBSPAWNER_FLAMES, 1);
    works,
    But when I use
    Code:
    ParticleEffect.SPELL_INSTANT.display(0, 0, 0, 4, 2, e.getLocation(), 11);
    it wont work.

    I was wondering if I need to import my ParticleEffect.class into my main.class but in eclipse it dosent show any errors.

    Thanks,
    ~ mpattrick
     
  2. Offline

    user_90854156

    Well, where did you get ParticleEffect.class ? (show us class?)
     
  3. Offline

    Konato_K

    @mpattrick Particles are rendered client side, and they only render if the player is within some blocks, this may be your problem, the particle packet is sent, but the client doesn't render it because it's too far from it (this is similar on how mobs only render within 64 blocks)
     
  4. Offline

    Funergy

    @mpattrick Here is a 1 line example to spawn particles with packets.
    Code:
    ((CraftPlayer) p).getHandle().playerConnection.sendPacket(new PacketPlayOutWorldParticles("reddust", (float) loc.getX(), (float) loc.getY(), (float) loc.getZ(), offsetX, offsetY, offsetZ, speed, amount)
     
  5. @Funergy I would be happier using
    Code:
     ParticleEffect.NAME.display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range);
    
    Because it is so much easier. Its just the float & double part confusing me.
     
  6. Offline

    Funergy

    @mpattrick You know what offset means?
    Speed: You can mess with the speed sometimes it gives you some colors.
    Amount: You actually should know what that means :confused:
    Location: You actually should know what that means :confused:
    Range: The range people will see it.
    if range is 10 people will only see it if they are in a range of 10. (I don't know if it is with blocks!)
     
  7. @Funergy Thanks, I think it is the Range that is messing me up and i dont think it is in blocks because my current range is 11

    EDIT: My SPELL_INSTANT is now working but my EXPLODE_NORMAL isnt.

    Code:
    ParticleEffect.SPELL_INSTANT.display(0, 0, 0, 4, 15, e.getLocation(), 64);
    Code:
    ParticleEffect.EXPLOSION_NORMAL.display(0, 0, 0, 4, 15, e.getLocation(), 64);
    Any idea why not?
     
    Last edited: Feb 17, 2015
Thread Status:
Not open for further replies.

Share This Page