use of net.minecraft.sound.SoundEvent in project friends-and-foes by Faboslav.
the class GlareEntity method playEatSound.
public void playEatSound(ItemStack stack) {
SoundEvent soundEvent = this.getEatSound(stack);
this.playSound(soundEvent, 1.0F, 1.0F);
}
use of net.minecraft.sound.SoundEvent in project friends-and-foes by Faboslav.
the class IceologerIceChunkEntity method playSummonSound.
private void playSummonSound() {
SoundEvent soundEvent = this.getSummonSound();
this.playSound(soundEvent, 1.0F, RandomGenerator.generateFloat(0.95F, 1.05F));
}
use of net.minecraft.sound.SoundEvent in project Hypnotic-Client by Hypnotic-Development.
the class Explosion method build.
@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
int min = -5;
int max = 5;
mc.player.addVelocity(new Random().nextInt(max - min) + min, new Random().nextInt(3 - 1) + 1, new Random().nextInt(max - min) + min);
info("BOOM... exploded");
mc.world.addParticle(ParticleTypes.EXPLOSION_EMITTER, mc.player.getX(), mc.player.getY() + 0.5D, mc.player.getZ(), 0.0D, 0.0D, 0.0D);
mc.getSoundManager().play(PositionedSoundInstance.ambient(new SoundEvent(new Identifier("entity.generic.explode")), 1, 1));
return SINGLE_SUCCESS;
});
}
use of net.minecraft.sound.SoundEvent in project CopperEquipment by Redy1aye.
the class CopperBucket method playEmptyingSound.
protected void playEmptyingSound(@Nullable PlayerEntity player, WorldAccess world, BlockPos pos) {
SoundEvent soundEvent = this.fluid.isIn(FluidTags.LAVA) ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA : SoundEvents.ITEM_BUCKET_EMPTY;
world.playSound(player, pos, soundEvent, SoundCategory.BLOCKS, 1.0F, 1.0F);
world.emitGameEvent(player, GameEvent.FLUID_PLACE, pos);
}
use of net.minecraft.sound.SoundEvent in project Liminal-Library by LudoCrypt.
the class ServerPlayerEntityMixin method limlib$moveToWorld.
@Inject(method = "moveToWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V", ordinal = 5, shift = Shift.AFTER))
public void limlib$moveToWorld(ServerWorld to, CallbackInfoReturnable<Entity> ci) {
Optional<SoundEvent> sound = LiminalSoundRegistry.getCurrent(moveToWorld$from, to);
if (sound != null) {
this.networkHandler.sendPacket(new PlaySoundS2CPacket(sound.get(), SoundCategory.AMBIENT, this.getX(), this.getY(), this.getZ(), 0.25F, world.getRandom().nextFloat() * 0.4F + 0.8F));
}
this.moveToWorld$from = null;
}
Aggregations