Play sound on login.

Discussion in 'Plugin Development' started by Michiman, Aug 14, 2015.

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

    Michiman

    How do i make it play a sound to the player when they login?

    This is what i have and for some reason it is not working.


    Code:
    @EventHandler
    public void onPlayerLogin(PlayerLoginEvent e) {
             Player p = e.getPlayer();
      
            
             p.getWorld().playSound(p.getLocation(), Sound.ENDERMAN_TELEPORT, 10, 4);
            
     
            
    }
    
         }
     
  2. Offline

    SkyleTyler1337

    did you register the listener
    Code:
    getServer().getPluginManager().registerEvents(new TestListener(), this);
    ?
     
  3. Offline

    teej107

    @Michiman Play the sound after the event has finished. Aka: use a scheduled task
     
Thread Status:
Not open for further replies.

Share This Page