Class PlayLevelSoundEvent.AtPosition

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

public static class PlayLevelSoundEvent.AtPosition extends PlayLevelSoundEvent
PlayLevelSoundEvent.AtPosition is fired when a sound is played on the Level at a specific position. This event is fired from Level.playSound(Entity, BlockPos, SoundEvent, SoundSource, float, float) and Level.playSeededSound(Entity, double, double, double, Holder, SoundSource, float, float, long).

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

    • position

      private final Vec3 position
  • Constructor Details

  • Method Details

    • getPosition

      public Vec3 getPosition()
      Returns the position the sound is being played at.
      Returns:
      the position the sound is being played at