Player Hear Sound Event

Discussion in 'Plugin Development' started by Fabi0011, Jan 1, 2022.

  1. Offline

    Fabi0011

    Is there a event which is called when a player hears a sound? Like this:

    @EventHandler
    public void onHearSound(PlayerHearSoundEvent e) {
    Player p = e.getPlayer();
    if(e.getSound().equals(Sound.some_sound_idk)) {
    p.sendMessage("AMOGUS SUS");
    }
    }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Fabi0011 Sounds are client side, not server
     
  3. Offline

    Strahan

    If you aren't sure if an event exists, you can check the class list.
     
  4. Offline

    rudraksha007

    i guess this is possible by listening to outgoing packets.... i guess using protocol lib would.... but yeah i don't think u can detect background music with it...
     

Share This Page