| Name | player hears sound |
| Event Lines | player hears sound |
| Triggers | when a player receives a sound packet from the server. |
| Generated Examples | after player hears sound:
on player hears sound: |
| Has Player | Always. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Switches | key:<sound_key> to only process the event if the sound matches the modern Minecraft sound key. |
| Contexts | <context.sound_key> returns an ElementTag of the modern Minecraft sound key.
<context.sound_name> returns an ElementTag of the sound's Bukkit name.
<context.category> returns the name of the category the sound is from.
<context.is_custom> returns 'true' if the sound is custom, otherwise false.
<context.source_entity> returns the entity this sound came from (if any).
<context.location> returns the location the sound will play at.
<context.volume> returns the volume level.
<context.pitch> returns the pitch.
|
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Player |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerHearsSoundScriptEvent.java#L21 |