类 PlaySoundEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.sound.SoundEvent
net.minecraftforge.client.event.sound.PlaySoundEvent
Fired when a sound is about to be played by the sound engine. This fires before the sound is played and before any
checks on the sound (such as a zeroed volume, an empty
Sound
, and
others). This can be used to change or prevent (by passing null)
a sound from being played through
setSound(SoundInstance)
).
This event is not cancellable, and does not have a result.
This event is fired on the main Forge event bus, only on the logical client.
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.client.event.sound.SoundEvent
SoundEvent.SoundSourceEvent
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getName()
返回 the name of the original sound。返回 the original sound that was to be played。@Nullable SoundInstance
getSound()
返回 the sound to be played, ornull
if no sound will be played。void
setSound
(@Nullable SoundInstance newSound) Sets the sound to be played, which may benull
to prevent any sound from being played.从类继承的方法 net.minecraftforge.client.event.sound.SoundEvent
getEngine
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
name
-
originalSound
-
sound
-
-
构造器详细资料
-
PlaySoundEvent
-
-
方法详细资料
-
getName
返回 the name of the original sound。 This is equivalent to the path of the location of the original sound.- 返回:
- the name of the original sound
-
getOriginalSound
返回 the original sound that was to be played。- 返回:
- the original sound that was to be played
-
getSound
返回 the sound to be played, ornull
if no sound will be played。- 返回:
- the sound to be played, or
null
if no sound will be played
-
setSound
Sets the sound to be played, which may benull
to prevent any sound from being played.- 参数:
newSound
- the new sound to be played, ornull
for no sound
-