@OnlyIn(Dist.CLIENT)
public class ModSoundEvent {
@SubscribeEvent
public void soundEvent(TickEvent.PlayerTickEvent event){
{
if (event.player.getHeldItemMainhand().getItem() == ItemList.blue_lightsaber) {
event.player.playSound(SoundList.BUZZ, 0.5f, 1.0f);}
else {
event.player.playSound(SoundList.HURT,0.5f, 1.0f);
}
}
alright (srry for late didnt code for a few days) i made it only in the client and i figured out kinda what i need to do but i dont know how to stop a sound with TickEvent. is it possible or do i have to redo it (i tried doing it the way MinecrartTickableSound does it and it didnt work. thanks for the tip anyways i figured out some stuff with it)