Package etithespirit.orimod.event
Class EntityEmittedSoundEventProvider
java.lang.Object
etithespirit.orimod.event.EntityEmittedSoundEventProvider
A shitty representation of a Forge event sort of thing. Intended to be used in tandem with mixins to manually implement PR #7941
- Author:
- Eti
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityEmittedSoundEvent
getSound
(net.minecraft.world.entity.Entity source, net.minecraft.world.entity.player.Player player, double x, double y, double z, net.minecraft.sounds.SoundEvent sound, net.minecraft.sounds.SoundSource category, float volume, float pitch) Passes the given sound through the EntityEmittedSoundEvent handler, which can systematically modify the sound based on the event it is sourced from.static void
registerHandler
(Consumer<EntityEmittedSoundEvent> handler) Register an event handler for this event.static void
unregisterHandler
(Consumer<EntityEmittedSoundEvent> handler) Unregister an event handler for this event.
-
Constructor Details
-
EntityEmittedSoundEventProvider
public EntityEmittedSoundEventProvider()
-
-
Method Details
-
getSound
@Nonnull public static EntityEmittedSoundEvent getSound(@Nonnull net.minecraft.world.entity.Entity source, @Nullable net.minecraft.world.entity.player.Player player, double x, double y, double z, @Nonnull net.minecraft.sounds.SoundEvent sound, net.minecraft.sounds.SoundSource category, float volume, float pitch) Passes the given sound through the EntityEmittedSoundEvent handler, which can systematically modify the sound based on the event it is sourced from. Returns the event packet containing all modifications.- Parameters:
source
- The entity that is emitting this sound.player
- The player that this sound should NOT play for, or null to play for only this client. (see entity.playSound)x
- The X position of the sound emission.y
- The Y position of the sound emission.z
- The Z position of the sound emission.sound
- The sound that is being played.category
- The category of the sound that is being played.volume
- The volume of the sound that is being played.pitch
- The pitch of the sound that is being played.- Returns:
- The sound event containing all modifications, or null if the entity's world is null.
-
registerHandler
Register an event handler for this event.- Parameters:
handler
- The handler to register.
-
unregisterHandler
Unregister an event handler for this event.- Parameters:
handler
- The handler to unregister.
-