public class PlaySoundAtEntityEvent extends EntityEvent
ClientPlayerEntity.playSound(SoundEvent, float, float)
and World.playSound(PlayerEntity, double, double, double, SoundEvent, SoundCategory, float, float)
.name
contains the name of the sound to be played at the Entity.volume
contains the volume at which the sound is to be played originally.pitch
contains the pitch at which the sound is to be played originally.newVolume
contains the volume at which the sound is actually played.newPitch
contains the pitch at which the sound is actually played.name
field will cause the sound of this name to be played instead of the originally intended sound.Cancelable
.HasResult
MinecraftForge.EVENT_BUS
.EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.EyeHeight
Modifier and Type | Field and Description |
---|---|
private SoundCategory |
category |
private SoundEvent |
name |
private float |
newPitch |
private float |
newVolume |
private float |
pitch |
private float |
volume |
Constructor and Description |
---|
PlaySoundAtEntityEvent(Entity entity,
SoundEvent name,
SoundCategory category,
float volume,
float pitch) |
Modifier and Type | Method and Description |
---|---|
SoundCategory |
getCategory() |
float |
getDefaultPitch() |
float |
getDefaultVolume() |
float |
getPitch() |
SoundEvent |
getSound() |
float |
getVolume() |
void |
setCategory(SoundCategory category) |
void |
setPitch(float value) |
void |
setSound(SoundEvent value) |
void |
setVolume(float value) |
getEntity
private SoundEvent name
private SoundCategory category
private final float volume
private final float pitch
private float newVolume
private float newPitch
public PlaySoundAtEntityEvent(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)
public SoundEvent getSound()
public SoundCategory getCategory()
public float getDefaultVolume()
public float getDefaultPitch()
public float getVolume()
public float getPitch()
public void setSound(SoundEvent value)
public void setCategory(SoundCategory category)
public void setVolume(float value)
public void setPitch(float value)