Library [1.8] ParticleEffect v1.7

Discussion in 'Resources' started by DarkBladee12, Jun 20, 2013.

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


    Where's the point in allowing doubles if i have to convert the to floats anyway for creating a packet? Or what did you exactly mean?
  2. Offline


    l.getX() + 0.43D, l.getY() , l.getZ() + 0.25D
    I'm using the doubles to get the area around the players head to spawn the particles at a certain spot. I solved my issue by creating a new location and using your location argument I spawn the particles there.
                            ParticleEffect.HEART.display(0, 0, 0, 1, 1, loc1, 16);
  3. Offline


    Well you won't need doubles at all since these numbers don't have that much decimals ;)
  4. Offline


    Hey, dunno why there is a prob, maybe you could help me?
    I can't see any particles.

            plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> {
            }, 5 * 20L, 1L);
  5. Offline


    Did you enable particles in your mc video config?
  6. Offline


    Where can I change this setting?
    Edit: Found it, will test it tomorrow. Thanks
  7. Offline


    I get the error "This particle effect is not supported by your server version" when doing:

    ParticleEffect.BLOCK_DUST.display(new OrdinaryColor(1, 1, 1), p.getLocation(), 10);
    I want to create bright red particles, as I've seen done on servers.
    Am I creating the "OrdinaryColor" wrong?

    [18:32:03 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'test
    ' in plugin Test v1
            at org.bukkit.command.PluginCommand.execute( ~[cra
            at org.bukkit.command.SimpleCommandMap.dispatch(
    0) ~[craftbukkit.jar:git-Bukkit-17962f6]
            at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServe ~[craftbukkit.jar:git-Bukkit-17962f6]
            at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerCon [craftbukkit.jar:git-Bukkit-17962f6]
            at net.minecraft.server.v1_8_R1.PlayerConnection.a(
    :919) [craftbukkit.jar:git-Bukkit-17962f6]
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:37) [craft
            at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(SourceFile:9) [craftb
            at [cra
            at java.util.concurrent.Executors$ Source) [
            at Source) [?:1.7.0_51]
            at net.minecraft.server.v1_8_R1.MinecraftServer.z(
    43) [craftbukkit.jar:git-Bukkit-17962f6]
            at net.minecraft.server.v1_8_R1.DedicatedServer.z(
    84) [craftbukkit.jar:git-Bukkit-17962f6]
            at net.minecraft.server.v1_8_R1.MinecraftServer.y(
    98) [craftbukkit.jar:git-Bukkit-17962f6]
    :506) [craftbukkit.jar:git-Bukkit-17962f6]
            at Source) [?:1.7.0_51]
    Caused by: net.venturianmc.MixedMadness.ParticleAPI.ParticleEffect$ParticleVersi
    onException: This particle effect is not supported by your server version
            at net.venturianmc.MixedMadness.ParticleAPI.ParticleEffect.display(Parti ~[?:?]
    Using craftbukkit 1.8.
    Last edited: Mar 13, 2015
  8. Offline



    I try to show the chunkborders with particles. First I tried it with glass - works.
    Now when I changed the blocks to a scheduler with particles can I only see them, if I spawn them at the player location.. Whats wrong?

            Chunk chunk= p.getWorld().getChunkAt(p.getLocation());
            int yWert = p.getLocation().getBlockY();
            if (yWert >= 6) {
                yWert = yWert - 5;
            } else {
                yWert = 1;
            int yWert2 = yWert;
            if (cmd.getName().equalsIgnoreCase("sc")) {
                int totaltime = 20 * 7;
                BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
                int particle = scheduler.scheduleSyncRepeatingTask(plugin, () -> {
                    int i;
                    int i2;
                    for (i = yWert2; i < (yWert2 + 11); i++) {
                        for (i2 = 0; i2 < 15; i2++) {
                            Location corner1 = chunk.getBlock(i2, i, 0).getLocation();
                            Location corner2 = chunk.getBlock(15, i, i2).getLocation();
                            Location corner3 = chunk.getBlock(15 - i2, i, 15).getLocation();
                            Location corner4 = chunk.getBlock(0, i, 15 - i2).getLocation();
                            p.getWorld().playEffect(corner1, Effect.FIREWORKS_SPARK, 1);
                            p.getWorld().playEffect(corner2, Effect.FIREWORKS_SPARK, 1);
                            p.getWorld().playEffect(corner3, Effect.FIREWORKS_SPARK, 1);
                            p.getWorld().playEffect(corner4, Effect.FIREWORKS_SPARK, 1);
                            ParticleEffect.FIREWORKS_SPARK.display(0f, 0f, 0f, 0f, 2, corner1, 1.0);
                            ParticleEffect.FIREWORKS_SPARK.display(0f, 0f, 0f, 0f, 2, corner2, 1.0);
                            ParticleEffect.FIREWORKS_SPARK.display(0f, 0f, 0f, 0f, 2, corner3, 1.0);
                            ParticleEffect.FIREWORKS_SPARK.display(0f, 0f, 0f, 0f, 2, corner4, 1.0);
                            ParticleEffect.FIREWORKS_SPARK.display(0f, 0f, 0f, 0f, 2, p.getLocation(), 1.0);
                }, 0, 5L);
                        + "Glasblöcke zeigen für 7 Sekunden die Grenzen deines Chunks.");
                scheduler.scheduleSyncDelayedTask(plugin, () -> Bukkit.getScheduler().cancelTask(particle), totaltime);
    Last edited: Mar 14, 2015
  9. Offline


    Is there a way to color the FIREWORK_SPARK ?
    I need them in different colors :\

    ParticleEffect.FIREWORKS_SPARK.display(new ParticleEffect.OrdinaryColor(255, 0, 0), loc, 10);

    Doesn't work.
  10. Offline


  11. Offline


    Can you make it so that you can control how many seconds the particle stays for or something?
  12. Offline


    It's currently not possible to change how long a particle stays until it fades. However you can use a Runnable to display it continuously for a certain amount of time.
  13. Offline


    And can you move the particles around with a player?
  14. Offline


    You can send particles with a velocity to give more of an affect of following, otherwise just spawn still particles every tick which gives an appearance of following the player.
  15. Offline


  16. Offline


    I found the fix i put pull request with it
    Solved (open)
    I can't use colors in the redstone particles.

    i have a for that uses these colors
    for (OrdinaryColor c : new OrdinaryColor[]{ new OrdinaryColor(128,0,128), new OrdinaryColor(0,0,255), new OrdinaryColor(0,255,255), new OrdinaryColor(255,255,0), new OrdinaryColor(255,0,0), new OrdinaryColor(230,95,0),  new OrdinaryColor(255,0,0)}) {
    inside the for i use methods to change the location to create an arch, then i use

    ParticleEffect.REDSTONE.display(c, location, ParticleUtils.getPlayers());
    But it only paints a some of colors that i put in the array the rest it paints with white pink and strange colors that not are that I invoke
    Last edited: May 1, 2015
  17. Offline


    any command can remove the particle effect?
  18. Offline


    @DarkBladee12 :p This is so old, yet still so useful. But I have a question.
    I'm trying to get the particles of a redstone block breaking. I have everything all set up, but the only thing that's stumping me, is the ParticleData. I don't know what to set for that value :p

    If you could explain what particle data REDSTONE_BLOCK would be, and what I would put in that parameter, that would be fantastic <3
  19. Offline


    You have to create an instance of BlockData if you want to display effects like BLOCK_CRACK or BLOCK_DUST. For displaying redstone block particles you'd have to put new BlockData(Material.REDSTONE_BLOCK, (byte) 0) for ParticleData parameter.
    2008Choco likes this.
  20. Offline


    Okay so I did that, but it's giving me an error under "BlockData" :p
  21. Offline


    Could you tell me which error showed up?
  22. Offline


    @DarkBladee12 Don't bother :) I messed around with it a bit more and I managed to fix it
  23. Offline


    @DarkBladee12 do you known what sort of particle I can use the best for the shapes a cone preferably can be modified to have different colors. The current spel mob is a bit messy
  24. Offline


    To use different colors, I'd prefer the redstone one
  25. Offline


    @DarkBladee12 Could you please add a fix for this:

    Because currently doing this: ParticleEffect.BLOCK_CRACK.display(new ParticleEffect.BlockData(Material.STAINED_GLASS_PANE, (byte) 4), .1f, .1f, .1f, 0, 10, p.getLocation().add(0, 1, 0), 20000); does just display gray stained glass particles probably because of that. I tested it with the command: /particle blockcrack_16544 ~ ~ ~ 1 1 1 1 10 and that does work with yellow particles of the stained glass.

    Fixed it myself (starts at line 1448)
                    } else {
                        ReflectionUtils.setValue(packet, true, "a", enumParticle.getEnumConstants()[effect.getId()]);
                        ReflectionUtils.setValue(packet, true, "j", longDistance);
                        if (data != null) {
                            if(effect == ParticleEffect.BLOCK_CRACK) {
                                int[] packetData = {1};
                                packetData[0] = data.getPacketData()[1]*4096+data.getPacketData()[0];
                                ReflectionUtils.setValue(packet, true, "k", packetData);
                                ReflectionUtils.setValue(packet, true, "k", data.getPacketData());
    Last edited: May 29, 2015
    DarkBladee12 likes this.
  26. Offline


    Last edited: May 29, 2015
  27. Offline



    I just keep getting the same error wherever is says "Class<?>". It says "The type Class is not generic; it cannot be parameterized with arguments <?>". I have searched for a solution on the internet, but nothing has helped!
    Last edited: Jun 19, 2015
  28. Offline


  29. Offline


    @DarkBladee12 Well, that would take a really long time since it happens on every line of code that contains "Class<?>".
    I'm happy that you wanted to help, but I got into packets and I have now learned how to do it using them! Thank you for all the effort, and for making the library even if it didn't work for me! :)
  30. Offline


    How ca i make an helix with this?
Thread Status:
Not open for further replies.

Share This Page