Class PlayLevelSoundEvent.AtEntity

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.PlayLevelSoundEvent
net.neoforged.neoforge.event.PlayLevelSoundEvent.AtEntity
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
PlayLevelSoundEvent

public static class PlayLevelSoundEvent.AtEntity extends PlayLevelSoundEvent
PlayLevelSoundEvent.AtEntity is fired when a sound is played on the Level at an Entity's position. This event is fired from Level.playSound(Entity, BlockPos, SoundEvent, SoundSource, float, float), Level.playSeededSound(Entity, double, double, double, Holder, SoundSource, float, float, long), and
invalid reference
LocalPlayer#playSound
.

This event is cancelable. If this event is canceled, the sound is not played.

This event does not have a result.

This event is fired on the NeoForge.EVENT_BUS.

  • Field Details

    • entity

      private final Entity entity
  • Constructor Details

  • Method Details

    • getEntity

      public Entity getEntity()
      Returns the entity the sound is being played on.
      Returns:
      the entity the sound is being played on