Library [1.8] ParticleEffect v1.7

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

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

    DarkBladee12

    michael566 There's no way to stop a particle effect once played. You can only increase the speed for some types to make them play faster! Every time you call the display method the particle effect will be played once. If you want it to play periodically you'd have to create a scheduler which plays the effect ;)
     
  2. Offline

    maved145

    michael566 DarkBladee12

    If you are using a scheduler though you can than cancel the scheduler for that specific player. :)
     
  3. Offline

    michael566

  4. Offline

    PlayerNerd

    How can i do a particle fall down?
     
  5. Offline

    DarkBladee12

    PlayerNerd can you explain further what you mean exactly?
     
  6. Offline

    PlayerNerd


    DarkBladee12 I´m speaking to do like the Blood Wizard in TNT Wizard of Hypixel, you throw the particle and it fall, like a semicircle.
     
  7. Offline

    DarkBladee12

  8. Offline

    AoH_Ruthless

    DarkBladee12
    Does the 1.7 version work with CB 1.7.9-R0.2? I can't seem to get it to work under any condition. What I am trying now:
    • A timer repeating every tick for 100 ticks
    • Speed of 0.2f
    • An offset of 0.3f (x, y, and z)
    • 10 particles every tick above a player's head
    No particles are being displayed; there are no other plugins on the test server and no error log. At time my FPS just sinks so I know that the particles are being sent, but I have no idea why I cannot see them.
    Code:java
    1. private void playEffect(final Player player) {
    2. final Location loc = player.getLocation().add(0.0, 2.5, 0.0);
    3. final BukkitTask task = Bukkit.getScheduler().runTaskTimer(plugin,
    4. new BukkitRunnable() {
    5. @Override
    6. public void run() {
    7. effect.display(loc, 0.3f, 0.3f, 0.3f, speed, amount);
    8. }
    9. }, 1l, 1l);
    10. Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
    11. @Override
    12. public void run() {
    13. Bukkit.getScheduler().cancelTask(task.getTaskId());
    14. }
    15. }, 100l);
    16. }
     
  9. Offline

    Jaaakee224

    DarkBladee12 I got a question, how would I make it so if a player moved(walked, flew), the particles would stop, and then when the player is still, the particles would start back up again.
     
  10. Offline

    AoH_Ruthless

    Jaaakee224
    Scheduled task timer (every tick or two ticks), cache player location, compare against player's new location, check if they are same and send particles if they are, check if they are different and don't send particles if they are different..
     
  11. Offline

    flabbycatty

    Ummmm the particles are not showing up for other players and appear to be client - side only. Any help?
     
  12. Offline

    ChipDev

    Same problem happened to me... :/ forgot how to fix srry!
     
  13. Offline

    DarkBladee12

    flabbycatty Maybe you've used the wrong method, there's one with a range parameter which displays the particles for all players in that range and one with a player array argument which only displays the particles for these players!

    AoH_Ruthless Can you tell me which effect you tried to display?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  14. Offline

    AoH_Ruthless

    DarkBladee12
    I tried several effects. The enum names as follows:
    • CLOUD
    • HEART
    • DRIP_WATER (something like that)
    • SMOKE, LARGE_SMOKE
    • EXPLODE
    • ENCHANTMENT_TABLE
    • and a few others.
    Furthermore, I know it isn't an issue with the variable 'effect'. I tried replacing it with ParticleEffect.CLOUD.display(...) and still nothing happened. I also knew that the method was getting called because I could hear the sound being played. While I don't think it is an issue with asynchronous threading (that wouldn't be a logical issue), I also tested it without any Runnable timers and the effect was still not being displayed.
     
  15. Offline

    DarkBladee12

    AoH_Ruthless You're just using the wrong display method! The one you're using has a player varargs at the end and will only display the effect for those players in that array, but you didn't add any players to it so it will be invisible for everyone. Just use the method with the range argument and it should be displayed to all players in this range!

    Code:java
    1. effect.display(loc, <range>, 0.3f, 0.3f, 0.3f, speed, amount);
     
  16. Offline

    AoH_Ruthless

    DarkBladee12
    That doesn't make sense. There is no player parameter at all in my code. Looking at the source, if I don't specify a range or a player parameter, it defaults to all players in the source code ... But I will attempt this anyways and edit this post if it works or not.

    Edit: Specifying the range to a value such as 16 does nothing; the effect still does not appear :(
     
  17. Offline

    DarkBladee12

    AoH_Ruthless Are you sure that you enabled particles on your client?
     
  18. Offline

    SuperGabe64

    How do you make it so only certain ranks/people get the effects?
     
  19. Offline

    ChipDev

    Use an if permission block.
     
  20. Offline

    oasis9

    Always getting a PacketInstantiationException, null pointer here, in ParticleEffect class;
    Code:java
    1. private static Object instantiatePacket(String name, Location center, float offsetX, float offsetY, float offsetZ, float speed, int amount) {
    2. if (amount < 1)
    3. throw new PacketInstantiationException("Amount cannot be lower than 1");
    4. try {
    5. return packetPlayOutWorldParticles.newInstance(name, (float) center.getX(), (float) center.getY(), (float) center.getZ(), offsetX, offsetY, offsetZ, speed, amount);
    6. } catch (Exception e) {
    7. throw new PacketInstantiationException("Packet instantiation failed", e);
    8. }
    9. }

    The return line throws a null pointer exception, as the constructor is supposedly null.

    My particle display code;
    Code:java
    1. ParticleEffect.NOTE.display(pl.getLocation(), 0, 0, 0, 0, 1);

    (I'm only playing around with it).

    Error:
    Code:
    2014-08-11 19:12:22 [SEVERE] Could not pass event PlayerInteractEvent to Semicolons v1
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
        at org.bukkit.craftbukkit.v1_5_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:190)
        at org.bukkit.craftbukkit.v1_5_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:160)
        at net.minecraft.server.v1_5_R3.PlayerConnection.a(PlayerConnection.java:617)
        at net.minecraft.server.v1_5_R3.Packet15Place.handle(SourceFile:58)
        at net.minecraft.server.v1_5_R3.NetworkManager.b(NetworkManager.java:292)
        at net.minecraft.server.v1_5_R3.PlayerConnection.d(PlayerConnection.java:115)
        at net.minecraft.server.v1_5_R3.ServerConnection.b(SourceFile:35)
        at net.minecraft.server.v1_5_R3.DedicatedServerConnection.b(SourceFile:30)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:581)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: net.bob.ParticleEffect$PacketInstantiationException: Packet instantiation failed
        at net.bob.ParticleEffect.instantiatePacket(ParticleEffect.java:292)
        at net.bob.ParticleEffect.display(ParticleEffect.java:411)
        at net.bob.ParticleEffect.display(ParticleEffect.java:427)
        at net.bob.Semicolons.onPlayerInteractEvent(Semicolons.java:1156)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
        ... 16 more
    Caused by: java.lang.NullPointerException
        at net.bob.ParticleEffect.instantiatePacket(ParticleEffect.java:290)
        ... 24 more
    Nevermind the name of the plugin, it was schoolwork. I have to teach the students in my class about semicolons. (Boring much). Anyways, decided to make it a bit more fun - MINECRAFT!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  21. Offline

    ChipDev

    Good idea :); Semicolons are awesome; just like teaching kids what they do.
     
  22. Offline

    DarkBladee12

    oasis9 well it seems like you're using Bukkit for version 1.5, so you'd have to use the version which is for 1.6- ;)
     
  23. Offline

    FlxiFlix

    Is it possible to color the RED_DUST or the INSTANT_SPELL ?
    If I color the RED_DUST it is a color-mixed particle-effect.
     
  24. Offline

    DarkBladee12

    FlxiFlix it's not possible yet to display them in a specific color, but they have a static color when using 0 as speed value!
     
  25. Offline

    JordyPwner

    DarkBladee12

    Lib issue:

    Show Spoiler
    [11:01:32 ERROR]: Could not pass event ProjectileHitEvent to Guns v1.0.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callProjectile
    HitEvent(CraftEventFactory.java:629) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g
    8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.EntityProjectile.h(EntityProjectile.java
    :158) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.entityJoinedWorld(World.java:1421)
    [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.playerJoinedWorld(World.java:1402)
    [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.tickEntities(World.java:1290) [cra
    ftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.WorldServer.tickEntities(WorldServer.jav
    a:481) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:6
    49) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    60) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljav
    a/util/Collection;
    at me.jordypwner.guns.ParticleEffect.getPlayers(ParticleEffect.java:269)
    ~[?:?]
    at me.jordypwner.guns.ParticleEffect.display(ParticleEffect.java:414) ~[
    ?:?]
    at me.jordypwner.guns.ParticleEffect.display(ParticleEffect.java:430) ~[
    ?:?]
    at me.jordypwner.guns.SnowballHit.onProjectileHit(SnowballHit.java:29) ~
    [?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_60]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    ... 14 more
    [11:01:45 ERROR]: Could not pass event ProjectileHitEvent to Guns v1.0.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.event.CraftEventFactory.callProjectile
    HitEvent(CraftEventFactory.java:629) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g
    8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.EntityProjectile.h(EntityProjectile.java
    :158) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.entityJoinedWorld(World.java:1421)
    [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.playerJoinedWorld(World.java:1402)
    [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.World.tickEntities(World.java:1290) [cra
    ftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.WorldServer.tickEntities(WorldServer.jav
    a:481) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:6
    49) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    60) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljav
    a/util/Collection;
    at me.jordypwner.guns.ParticleEffect.getPlayers(ParticleEffect.java:269)
    ~[?:?]
    at me.jordypwner.guns.ParticleEffect.display(ParticleEffect.java:414) ~[
    ?:?]
    at me.jordypwner.guns.ParticleEffect.display(ParticleEffect.java:430) ~[
    ?:?]
    at me.jordypwner.guns.SnowballHit.onProjectileHit(SnowballHit.java:29) ~
    [?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _60]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _60]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_60]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_60]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    ... 14 more


    something with: Caused by: java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()Ljav
    a/util/Collection;

    line 269
     
  26. Offline

    Roelyboely12

    not working for me sadly
    Code:java
    1. ParticleEffect.HEART.display(event.getEnchanter().getLocation(), 0, 0, 0,10, 1000);

    im using the one everyone can see within 20 blocks
     
  27. Offline

    DarkBladee12

    Roelyboely12 try decreasing the speed or add the range parameter after the player parameter! (ParticleEffect.HEART.display(event.getEnchanter().getLocation(), RANGE, 0, 0, 0,10, 1000);)

    JordyPwner try updating to a newer build!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 29, 2015
  28. Offline

    JordyPwner

    DarkBladee12 sorry total forgot this! its working now used higher build thx!
     
    ChipDev likes this.
  29. Offline

    ChipDev

    Hit delete!
     
  30. Offline

    DarkBladee12

    Hey guys, I just wanted to announce that a small update of this library will follow soon alongside a small plugin which allows you to display all particle effects with commands!
     
Thread Status:
Not open for further replies.

Share This Page