Water Drip Particle Effect

Discussion in 'Spigot Plugin Development' started by Nosmakos, Jun 9, 2016.

  1. hey guys i never tried to make a particle effect but i tried because i need "sweat" for my thirst so the particle i made was doing water drops from his head but the thing is if the player walk fast/sprint the particle stays back for 1.5 sec and it's a "sweat" you know this can't be happening only throwing the drops in front of him not staying back..anyone know how i can do that?
    this is what i used
    Code (Text):
    layer.getLocation().getWorld().playEffect(player.getEyeLocation().add(0, 4, 0).subtract(0, 4, 0), Effect.WATERDRIP,1);
  2. .add(0, 4, 0).subtract(0, 4, 0) doesn't make sense, that doesn't do anything.

    If I understand your problem right, you want to spawn the particles infront of the players moving direction. For that you get the players velocity, multiply it by a value, add the vector to the players location and then spawn the particles there
  3. There are really good libraries you can use to create particle effects. The one I use in every single plugin is this one: ParticleEffect library by DarkBladee12. It's pretty easy to use and works well. It says it's for 1.8 but it works fine for 1.9, the only thing is that the new particles are missing but you can add them like I did or just ignore them.

    Good luck :)
  4. yeah it was a testing so i can spawn the water drip but whenever i was moving the water drip stayed back for a few seconds and thank you for your answer i will try that!
  5. yeah my friend has his own particles too but the point is i wanna use only 1 particle effect for "sweat" and i don't think i should use a library just for 1 particle effect :/
  6. It doesn't really matter if you use one or not, and is the problem that the particles float for a little while? Because if it is I don't know if this can be avoided, that's just how the particles work and you cant change their physics without modding the actual game. Unless its a directional particle in this case you can use the library I put in the reply above ^ to change the movement direction downwards but I dont know if it is.
  7. damn it thank you for your suggestion if i can't find a way to do this i might use a library like you saying.
  8. I just looked at the library, the particle is not directional. This means that it might not be possible to give them movement and stop the floating effect. Maybe the particle "WATER_SPLASH", this particle is directional and this means that you are able to give it a downwards motion. The particle WATER_SPLASH is in the library looks like this:
    Just make sure you specify a direction with a vector, otherwise the particles will bounce up first by default which you probably dont want.
  9. okay good thank youu ! i hope i make it without library tho.