#786: Add methods to get sounds from entities

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2022-09-11 22:24:08 +10:00
parent 04574c48bb
commit 38ba2e3273
4 changed files with 120 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package org.bukkit.entity;
import org.bukkit.Sound;
import org.bukkit.loot.Lootable;
import org.jetbrains.annotations.Nullable;
@@ -47,4 +48,17 @@ public interface Mob extends LivingEntity, Lootable {
* @return whether the mob is aware
*/
public boolean isAware();
/**
* Get the {@link Sound} this makes while ambiently existing. This sound
* may change depending on the current state of the entity, and may also
* return null under specific conditions. This sound is not constant.
* For instance, villagers will make different passive noises depending
* on whether or not they are actively trading with a player, or make no
* ambient noise while sleeping.
*
* @return the ambient sound, or null if this entity is ambiently quiet
*/
@Nullable
public Sound getAmbientSound();
}