Posted November 6, 20204 yr Ive created a class called ModClientEvents which manages my events. in it, I have the following code: ackage com.Michael.TutorialMod2.events; import com.Michael.TutorialMod2.Tutorial; import com.Michael.TutorialMod2.items.Vodka; import com.Michael.TutorialMod2.util.RegistryHandler; import net.minecraft.entity.LivingEntity; import net.minecraft.item.Items; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.event.entity.EntityEvent; @Mod.EventBusSubscriber(modid = Tutorial.MOD_ID, bus=Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvents { public static void onPlayerEat(LivingEntityUseItemEvent event) { LivingEntity player = event.getEntityLiving(); if(player.getHeldItemMainhand().getItem() == RegistryHandler.Vodka.get()) { Tutorial.LOGGER.info("test"); //code to play a 3rd party sound file } } } How can I play a 3rd party sound after I finish using the item vodka?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.