Effect following player?

Discussion in 'Plugin Development' started by GreatMinerZ, Nov 29, 2013.

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

    GreatMinerZ

    Is there a way i can spawn effect particles on the player's location and let them follow the player as he moves?

    Thanks!
     
  2. Offline

    Gater12

    NathanWolf likes this.
  3. Offline

    NathanWolf

    I think you would need to continuously play the effect in a timer or on player move.
     
  4. Offline

    GreatMinerZ

    Thanks for the quick answers! Looking into it now.
     
  5. Offline

    Gamecube762

    Looping World.playEffect(Location location, Effect effect, int data)can work, or you can call it on PlayerMoveEvent.
     
  6. Offline

    GreatMinerZ

    What's the best way to check if the player has been launched into the air and then loop the effects to his location?

    Important part of the code:

    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    2. if (sender instanceof Player) {
    3. if (cmd.getName().equalsIgnoreCase("rocket")) { // If player typed /rocket
    4. //
    5.  
    6. Player player = (Player) sender;
    7. player.setVelocity(new Vector(0,5,0));
    8.  
    9. //
    10. } else {
    11. sender.sendMessage("You must be a player to use this command!");
    12. return false;
    13. }
    14. }
    15. return false;
    16. }
    17.  
    18. @EventHandler(priority = EventPriority.HIGH)
    19. public void onFallDamage(EntityDamageEvent event){
    20. if(event.getEntity() instanceof Player && event.getCause() == DamageCause.FALL)
    21. event.setCancelled(true);
    22. }
    23. }
     
  7. Offline

    boysnnoco

    GreatMinerZ add them to a hashmap then remove them when they move check if the player that moved is in the hashmap play the sound, then when they hit the ground remove them from the hashmap
     
Thread Status:
Not open for further replies.

Share This Page