package net.arcmods.ryantlg.blockClasses; import net.arcmods.ryantlg.sounds; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.sound.SoundCategory; import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class elon extends Block{ public elon(Settings settings) { super(settings); } @Override public ActionResult onUse(BlockState blockState, World world, BlockPos blockPos, PlayerEntity placedBy, Hand hand, BlockHitResult blockHitResult) { if (!world.isClient) { world.playSound( null, // Player - if non-null, will play sound for every nearby player *except* the specified player blockPos, // The position of where the sound will come from sounds.ELON_SOUND_EVENT, // The sound that will play SoundCategory.BLOCKS, // This determines which of the volume sliders affect this sound 1f, //Volume multiplier, 1 is normal, 0.5 is half volume, etc 1f // Pitch multiplier, 1 is normal, 0.5 is half pitch, etc ); } return ActionResult.FAIL; } }