Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.7.10] Custom mobs not playing (Unable to play unknown soundEvent)

Featured Replies

Posted

Wracking my brain and losing sleep so I need a sanity check!

 

I have a custom mob, based on EntityZombie (EntityBeavis)

 

  • I created the "sounds.json" file at the root of my asset folder (testmod) [example below]
  • put the ogg file in the sounds folder  (beavis_cornholio.ogg)
  • sounds folder is in 'assets/testmod'
  • called the custom sound by overriding the "playLivingSound" method referencing modid:event ("testmod:beavisliving")

 

When I run the code, the error I get is "Unable to play unknown soundEvent testmod:beavisliving

 

I know its gotta be something stupid but I'm just not seeing it.

 

EntityBeavis.java

package net.chonacky.minecraft.mod.testmod.bb;


import net.chonacky.minecraft.mod.testmod.Main;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.world.World;

public class EntityBeavis extends EntityZombie {


	private String livingSound = Main.MODID+":beavisliving" ; //MODID = "testmod"

	public EntityBeavis(World worldIn) {

		super(worldIn);
		this.setCustomNameTag("Let's Burn Something!");
		
	}
	
	@Override
	public void playLivingSound() {
		
	 this.playSound(livingSound, this.getSoundVolume(), this.getSoundPitch());

	}
	
}

 

Here is the sounds.json file:

{
"beavisliving": 
	{
	"category": "master",
	"sounds": 
		[{"name":"beavis_cornholio"}
		]
	}
}

 

1.7.10 is no longer supported here.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Asked and answered: Due to the number of different project folders I have (1.7.10, 1.8.9, 1.11.1) I was editing the wrong sounds.json file.

The one shown above is correct and works.

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.