I finished up work last night on updating one of my internal libraries to 1.8, and I thought I'd share it here. Since Mojang changed the constructor for particle packets in 1.8, most if not all exisitng libraries do not function with it. My library should work for Minecraft versions going back to 1.6 and possibly even before, though I haven't tested it for that. It's simple enough to use, and consists of a single class. To create a particle effect: Code:java ParticleEffect effect = new ParticleEffect(ParticleEffect.ParticleType.FLAME, 0.02, 5, 0.0001); You can then send it to players with: Code:java effect.sendToLocation(someLocation); Source: https://github.com/mproncace/ParticleLib
Thanks for this, is there anyway you can add a way to apply offsets to the particles? This is something that previous libraries support. I'm unsure if the 1.8 constructors allow for offsets anymore. EDIT: Nvm, saw how you managed radius. You should definitely consider adding some offSet args.
ShadyPotato This is a great replacement for the previous particle lib I was using. Agreeing with zDylann that you should split up the radius argument into offset x y z. How would you display a specific icon crack as a particle? Such as a melon slice.
I'll be sure to do that in a future commit. Currently, it's not possible to pass data values, but I intend to add that feature very soon as well (probably at the same time as the separate radius arguments).
@MinecraftMart Create a new class in your project and call it ParticleEffect. Then go here https://github.com/mproncace/Partic...et/amigocraft/particlelib/ParticleEffect.java and paste that code into the class.
Hi, First of great Library. It works great. But im having a complication i cant figure out. Code: @EventHandler public void onBlockPlace(BlockPlaceEvent e){ loc = (Location) e.getBlock().getLocation().add(0.5,1,0.5); if(e.getBlock().getType() != null){ if(e.getBlock().getType() == Material.ANVIL){ id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){ public void run(){ PE = new ParticleEffect(ParticleEffect.ParticleType.HEART, .5,1,0); PE.sendToLocation(loc); } }, 0, 20); as you can see i want all anvils to have the heart effect to them but, when ever i place more anvils the original effect gets moved then a new set is added as well so if i have 3 anvils, i have one anvil with 3 sets going a once, any help here?
Just a note that the icon crack packet, unless it changed in 1.8, is not something that you can reliably use. The reason is because the icon crack packet will show a different item depending on its resolution, so someone with a 32bit pack will see a different item than someone with a 16bit pack. So the only time you should really use this particle is for random particles/colors or if you force a resourcepack on the player and you know what the item will be shown as.
@RingOfStorms Like i see it you use the same variable to hold the Particle(PE). Try to use a list instead to hold each of the particles. So you store ALL the packets, maybe it will work. I'm New ro bukkit and coding, but i have S problem like This yesterday, and this work for me. I have also never user particles. But you can always try
You can use the generic effect with ParticleType.BLOCK_CRACK. However, particle data (i..e. block type) isn't supported by the class at the moment. I may add this if I get the chance, but I can't make any promises.