Jump to content

(SOLVED)Mob Names / Language Registry


MorpheusZero

Recommended Posts

So i searched and couldn't find anything. I have about 5 or 6 small mods and almost all of them spawn in a custom version of a vanilla mob. Each mob in-game shows the regular names when you are killed by them or spawn eggs. (Killed by Creeper. Killed by Zombie, etc)

 

Well this one mod, I cannot figure out why the name of my mob shows as for example, "Killed by entity.rebelsnowman.name" I use basically identical code for all of them and this one out of 6 doesn't work and it's making my brain explode that I can't figure it out.

 

LanguageRegistry.instance().addStringLocalization("entity."+COREUtil.modName5 +".EntityMorphSnowman.name", COREUtil.entityNameSnowman0);

 

Help please?

Link to comment
Share on other sites

I tried that. I'm not sure what the problem is. All of my mods use this exact same code with the COREUtil.modName<NUMBER> in them. I tried it without using my COREUtil like you mentioned above but it always looks the same in-game.

 

I've tried writing about 5 different ways and to no avail. I just can't comprehend why ALL 5 of my other mods this code works fine but this one doesn't.

 

@Mod(modid = COREUtil.modID5, 
name = COREUtil.modName5, 
version = COREUtil.versionNumber5, 
dependencies = COREUtil.modDependancies5)

@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class RebelSnowmenBase
{
public static boolean configFireArrows;
public static int configHealth;


@SidedProxy(
		clientSide = COREUtil.proxyClient,
		serverSide = COREUtil.proxyServer)
public static CommonProxy proxy;




@EventHandler
    public void preModInit(FMLPreInitializationEvent event) 
{

        /**
         * Handles configuration file
         */
        Configuration config = new Configuration(event.getSuggestedConfigurationFile());

        // loading the configuration from its file
        config.load();
        

        configFireArrows = config.get(Configuration.CATEGORY_GENERAL, "FIERY_ARROWS_AT_NIGHT", false).getBoolean(true);
        configHealth = config.get(Configuration.CATEGORY_GENERAL, "SNOWMAN_MAX_HEALTH", 15).getInt();

        // saving the configuration to its file
        config.save();
    }

@EventHandler
    public void modInit(FMLInitializationEvent event) 
{
	/**
	 * Register MorphSnowman & Create Spawn Egg
	 */
    	
        EntityRegistry.registerGlobalEntityID(EntityMorphSnowman.class, "RebelSnowman", EntityRegistry.findGlobalUniqueEntityId(), 0xFFFFFF, 0x000000);
        EntityRegistry.registerModEntity(EntityMorphSnowman.class, "RebelSnowman", 3, this, 64, 3, true);
        
	EntityRegistry.addSpawn(EntityMorphSnowman.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.taiga, BiomeGenBase.taigaHills);


	LanguageRegistry.instance().addStringLocalization("entity."+COREUtil.modName5 +".EntityMorphSnowman.name", COREUtil.entityNameSnowman0);
    }
    
@EventHandler
    public void modsLoaded(FMLPostInitializationEvent event) 
{
    	
    }

    
}

Link to comment
Share on other sites

Thanks for your willingness to help but nothing is working.

 

LanguageRegistry.instance().addStringLocalization("entity.rebelsnowmen.RebelSnowman.name", "RebelSnowman");

 

I've switched things around a few dozen times to make it work and to no avail. I'm just going to scrap the project. I'm too frustrated with why my other mods work perfectly like this and this one doesn't.

 

Thanks.

Link to comment
Share on other sites

I have 6 mods that all do different things to different mobs. But the language registry code is basically the same. But I figured it out now. I spent two days trying to find a complex issue to my coding and it turns out it was something simple that I was overlooking.

Link to comment
Share on other sites

  • 3 months later...

Let's say you want to register:

EntityRegistry.registerModEntity(CustomEntity.class, "RegistrationName", 1, this, 80, 3, true);

Then, assuming your mod id is "modid":

In a .lang file, located in assets/modid/lang/
entity.modid.RegistrationName.name=Human language-dependent readable name

You need to name the .lang file with language code, like "en_US".

I prefer using UTF-8 encoding for the .lang file, and leave a blank line at the beginning.

Link to comment
Share on other sites

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.