Search in sources :

Example 1 with PositionedSoundInstance

use of net.minecraft.client.sound.PositionedSoundInstance in project BleachHack by BleachDrinker420.

the class NotebotUtils method play.

private static void play(SoundEvent sound, float pitch) {
    MinecraftClient mc = MinecraftClient.getInstance();
    Vec3d vec = mc.player == null ? Vec3d.ZERO : mc.player.getPos();
    mc.getSoundManager().play(new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, vec.x, vec.y, vec.z));
}
Also used : MinecraftClient(net.minecraft.client.MinecraftClient) PositionedSoundInstance(net.minecraft.client.sound.PositionedSoundInstance) Vec3d(net.minecraft.util.math.Vec3d)

Example 2 with PositionedSoundInstance

use of net.minecraft.client.sound.PositionedSoundInstance in project mineclub-expanded by Blobanium.

the class SoundPlayer method playSound.

public static void playSound(float pitch) {
    SoundEvent sound = registerSound();
    PositionedSoundInstance posSound = PositionedSoundInstance.master(sound, pitch, getVolume(ConfigReader.outbidVolume));
    MinecraftClient.getInstance().getSoundManager().play(posSound);
}
Also used : SoundEvent(net.minecraft.sound.SoundEvent) PositionedSoundInstance(net.minecraft.client.sound.PositionedSoundInstance)

Aggregations

PositionedSoundInstance (net.minecraft.client.sound.PositionedSoundInstance)2 MinecraftClient (net.minecraft.client.MinecraftClient)1 SoundEvent (net.minecraft.sound.SoundEvent)1 Vec3d (net.minecraft.util.math.Vec3d)1