Posted July 28, 201312 yr 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?
July 28, 201312 yr Author 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) { } }
July 28, 201312 yr Author 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.
July 28, 201312 yr Author I have done that too. None of it is working. As I've said I have all 5 of my other mods setup the exact same way and they all function perfectly but this one will not.
July 28, 201312 yr Man, if you have 6 mods doing the same thing, why not merging them together ? It would get rid of this issue and be more efficient.
July 28, 201312 yr Author 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.
November 7, 201311 yr Could you share what the solution was? I'm having the same problem and cannot figure out what is wrong. Long time Bukkit & Forge Programmer Happy to try and help
November 7, 201311 yr The main issue is registering the entity twice. Then, the EntityRegistry.registerModEntity method appends the modid before the entity unlocalized name. Finally, the LanguageRegistry is deprecated. You should use the vanilla way with .lang files.
November 7, 201311 yr When I get home, I'll dig around and try that method. If you have a chance, could you provide an example of the working part? Long time Bukkit & Forge Programmer Happy to try and help
November 7, 201311 yr 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.
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.