Posted July 6, 201411 yr How would I go about playing the normal Minecraft eating sound when I feed my custom tamed entity.
July 6, 201411 yr Use one of the World#playSoundXXX methods and insert a valid sound file name (open Minecraft's 'sounds.json' file to find valid sound names). An example from inside an Entity sub-class that plays the xp orb sound: worldObj.playSoundAtEntity( this, // the entity at which to play the sound "random.orb", // sound file name from sounds.json 1.0F, // volume (randomize if you want) 0.5F * ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.8F) // pitch that has lots some randomness ); http://i.imgur.com/NdrFdld.png[/img]
July 6, 201411 yr Author Apparently it can't play the sound as it is unkown... I used this: worldObj.playSoundAtEntity(this, "random.eat1", 1.0F, 0.5F * ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.8F));
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.