Package net.minecraftforge.event.entity
Class PlaySoundAtEntityEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.entity.EntityEvent
-
- net.minecraftforge.event.entity.PlaySoundAtEntityEvent
-
public class PlaySoundAtEntityEvent extends EntityEvent
PlaySoundAtEntityEvent is fired a sound is to be played at an Entity
This event is fired whenever a sound is set to be played at an Entity such as inClientPlayerEntity.playSound(SoundEvent, float, float)andWorld.playSound(PlayerEntity, double, double, double, SoundEvent, SoundCategory, float, float).
namecontains the name of the sound to be played at the Entity.
volumecontains the volume at which the sound is to be played originally.
pitchcontains the pitch at which the sound is to be played originally.
newVolumecontains the volume at which the sound is actually played.
newPitchcontains the pitch at which the sound is actually played.
Changing thenamefield will cause the sound of this name to be played instead of the originally intended sound.
This event isCancelable.
If this event is canceled, the sound is not played.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private SoundCategorycategoryprivate SoundEventnameprivate floatnewPitchprivate floatnewVolumeprivate floatpitchprivate floatvolume
-
Constructor Summary
Constructors Constructor Description PlaySoundAtEntityEvent(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SoundCategorygetCategory()floatgetDefaultPitch()floatgetDefaultVolume()floatgetPitch()SoundEventgetSound()floatgetVolume()voidsetCategory(SoundCategory category)voidsetPitch(float value)voidsetSound(SoundEvent value)voidsetVolume(float value)-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
name
private SoundEvent name
-
category
private SoundCategory category
-
volume
private final float volume
-
pitch
private final float pitch
-
newVolume
private float newVolume
-
newPitch
private float newPitch
-
-
Constructor Detail
-
PlaySoundAtEntityEvent
public PlaySoundAtEntityEvent(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)
-
-
Method Detail
-
getSound
public SoundEvent getSound()
-
getCategory
public SoundCategory getCategory()
-
getDefaultVolume
public float getDefaultVolume()
-
getDefaultPitch
public float getDefaultPitch()
-
getVolume
public float getVolume()
-
getPitch
public float getPitch()
-
setSound
public void setSound(SoundEvent value)
-
setCategory
public void setCategory(SoundCategory category)
-
setVolume
public void setVolume(float value)
-
setPitch
public void setPitch(float value)
-
-