Jump to content

[SOLVED] [1.5.2.] Custom Mobs /w Custom Sounds.


Recommended Posts

Posted

Hey mates. I've came here with another question about modding. I'm basicly modding my own mod(mobs, dimensions, items, blocks etc.). I've made one mob and i wanted to make it say my own sounds. I've watched alot of tutorials. It was said to put code like that in EntityName of your mob:

protected String getLivingSound() {
return "mob.mymob.bip";
}
protected String getHurtSound() {
return "mob.mymob.hurt";
}
protected String getDeathSound() {
return "mob.mymob.death";
}

 

 

So i've made that code, i only need to put sounds in folders. I tried to put them in [resources/sound3/mob/mymob]. Checked it out in the game...nothing works. I couldnt hear mymob make those sounds. I tried to put sounds in [resources/newsound/mob/mymob]. It didnt worked too! I also tried to convert them in .ogg format. Nothing changed! But when i try to set it like cow sounds, or chicken or enderman and etc. it works, but only with their sounds.

I dont know what to do, maybe you know?

P.S; I'm working with 1.5.2 version of minecraft.

Please Help me!

Thanks alot if you do. 

Posted
  On 12/29/2013 at 8:50 PM, diesieben07 said:

Your question is not any more important than any other question on here. Putting "Very important" in the title is a) not going to have the desired effect (more people reading) but the opposite and b) very insolent.

 

On topic: Post your sound registering code, it is important.

 

Very important means  its important for me... Not for others.

Posted
  On 12/29/2013 at 8:50 PM, diesieben07 said:

On topic: Post your sound registering code, it is important.

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.

Posted

Its an event handler class.

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.

Posted
  On 12/31/2013 at 10:45 AM, diesieben07 said:

  Quote

Thanks. Could you give me any tutorial on how to do that, or code? I remember something about that, but that was ModLoader. Forge is another.

Look on the wiki (link above) in the tutorials list.

 

Seriously? Wiki? There is no answers on such questions. They only giv e answers on development if so.

Posted
  On 1/2/2014 at 3:02 PM, DoorCloser said:

  Quote

  Quote

Thanks. Could you give me any tutorial on how to do that, or code? I remember something about that, but that was ModLoader. Forge is another.

Look on the wiki (link above) in the tutorials list.

 

Seriously? Wiki? There is no answers on such questions. They only giv e answers on development if so.

 

Oh, so this page doesn't exist.  Gotcha.

(Despite being old, its still accurate, based on a cursory glance and my recollections of when I did it)

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.

Posted
  On 1/2/2014 at 3:20 PM, Draco18s said:

  Quote

  Quote

  Quote

Thanks. Could you give me any tutorial on how to do that, or code? I remember something about that, but that was ModLoader. Forge is another.

Look on the wiki (link above) in the tutorials list.

 

Seriously? Wiki? There is no answers on such questions. They only giv e answers on development if so.

 

Oh, so this page doesn't exist.  Gotcha.

(Despite being old, its still accurate, based on a cursory glance and my recollections of when I did it)

 

Thanks, but i still miss understand something. Tutorial says i supposed to put  MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds()); in @PreInit in Main.class. So it should be looks like that;

 

  Reveal hidden contents

 

 

Because eclipse giving me an error;

Syntax Error on token "MinecraftForge", delete this token

 

Without that string my sounds doesnt work. Can you help? I'll give you some codes;

package doorcloser.modding;

import net.minecraftforge.client.event.sound.SoundLoadEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;

public class HalflifeMod_EventSounds
{

    @ForgeSubscribe
    public void onSound(SoundLoadEvent event)
    {
        try 
        {
            event.manager.soundPoolSounds.addSound("houndeye/bip.wav", mod_HalflifeMod.class.getResource("/resources/newsound/mob/bip.ogg"));            
        
        } 
        catch (Exception e)
        {
            System.err.println("Failed to register one or more sounds.");
        }
    
        event.manager.soundPoolSounds.addSound("houndeye/bip1.ogg", mod_HalflifeMod.class.getResource("/resources/newsound/mob/bip1.ogg"));         
        event.manager.soundPoolSounds.addSound("houndeye/bip2.ogg", mod_HalflifeMod.class.getResource("/resources/newsound/mob/bip2.ogg"));         
        event.manager.soundPoolSounds.addSound("houndeye/bip3.ogg", mod_HalflifeMod.class.getResource("/resources/newsound/mob/bip3.ogg"));
        
}}

 

Did i set the paths not correct? Please help,

Posted

@PreInit
MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds());
}}

 

This is wrong.

 

First, @PreInit is a function declared with the @PreInit annotation in your main class.

Second (and the only inaccuracy in the tutoral) is that @PreInit was depreciated in favor of @EventHandler, but it should alert you to this and what to use instead.

Third, I don't know how you thought you needed two unpaired close-braces.

 

    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds());
    }

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.

Posted
  On 1/2/2014 at 8:14 PM, Draco18s said:

@PreInit
MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds());
}}

 

This is wrong.

 

First, @PreInit is a function declared with the @PreInit annotation in your main class.

Second (and the only inaccuracy in the tutoral) is that @PreInit was depreciated in favor of @EventHandler, but it should alert you to this and what to use instead.

Third, I don't know how you thought you needed two unpaired close-braces.

 

    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        MinecraftForge.EVENT_BUS.register(new HalflifeMod_EventSounds());
    }

 

Eclipse says; @EventHandler cannot be resolved to a type.

Whats the matter? Am i suppose to type it below @Mod, or upper? Below public class or upper?

Posted
  On 1/2/2014 at 8:53 PM, CJLetsGame said:

EventHandler wasnt implemented yet in 1.5.2 forge.

 

DoorCloser, is there any reason you dont start modding with 1.6.4? You might get better answers if you update.

 

I know, but there was alot of changes. I was already modding for 1.5.2. When i finish my mod, i'll port it to 1.6.4. :9

Posted
  On 1/2/2014 at 8:53 PM, CJLetsGame said:

EventHandler wasnt implemented yet in 1.5.2 forge.

 

DoorCloser, is there any reason you dont start modding with 1.6.4? You might get better answers if you update.

 

So, @PreInit made without errors. But still no sounds. I dont know where to put them. Is it supposed to be in sound3 or newsound in resources folder? I tried to put folder newsound in minecraft.jar, nothing worked. I did something wrong again? Check my codes please:

 

Event_Sound file:

 

  Reveal hidden contents

 

 

My mod file:

 

  Reveal hidden contents

 

 

My Entity file:

 

  Reveal hidden contents

 

Posted
  On 1/2/2014 at 9:04 PM, CJLetsGame said:

Im guessing like every other asset for mods, it goes in your mod's asset folder. Probably in a sub-folder called sounds.

 

ITS FINALLY WORKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I HAD TO PUT MY entity's sounds FOLDER IN resources/mod/sound FOLDER!!!! YEEEEEEEEEEEEEEEAAAAAAAAAAAH!!! THANKS EVERYONE!!!! THIS PROBLEM NOW SOLVED!!!!!!!!!!!!!!!!!!!!!

Posted
  On 1/2/2014 at 8:53 PM, CJLetsGame said:

EventHandler wasnt implemented yet in 1.5.2 forge.

 

Whoops, yeah, this.

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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