Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] lang file not working for entities
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
MSpace-Dev

[1.12.2] lang file not working for entities

By MSpace-Dev, November 12 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

MSpace-Dev    12

MSpace-Dev

MSpace-Dev    12

  • Creeper Killer
  • MSpace-Dev
  • Members
  • 12
  • 180 posts
Posted November 12

Hey all,

 

I'm trying to get my spawn eggs to not display as "entity.mob_name.name", but rather as "Spawn mob_name" like Vanilla's spawn eggs. Here is the necessary information.

 

InitEntities.class

public class InitEntities
{

	private static int id = 1500;

	public static void register()
	{
		registerEntity("mob_id", "Mob Name", EntityMob.class, 16167425, 16775294);

		Utils.getLogger().info("Entities Registered");
	}

	private static void registerEntity(String nameId, String entityName, Class<? extends Entity> entityClass, int eggPrimary, int eggSecondary)
	{
		EntityRegistry.registerModEntity(new ResourceLocation(Reference.MODID, nameId), entityClass, entityName, ++id, Reference.MODID, 64, 1, false, eggPrimary, eggSecondary);
	}
}

 

Main class

public static final CreativeTabs creativeTab = new CreativeTabs(CreativeTabs.getNextID(), "modid")
{
    @Override
    @SideOnly(Side.CLIENT)
    public void displayAllRelevantItems(NonNullList<ItemStack> itemList)
  {
		super.displayAllRelevantItems(itemList);
		itemList.add(getSpawnEgg("mob_id"));
	}
};

 

en_us.lang (I've tried both of these separately. No luck.) [All other translations are working fine]

#### Entities ####
entity.mod_id.mob_id.name=Mob Name

entity.mob_id.name=Mob Name

 

Thanks.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6687

diesieben07

diesieben07    6687

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6687
  • 45707 posts
Posted November 12

First of all use EntityEntryBuilder and the registry events to register your entities.

The name must contain your ModID, otherwise it will cause conflicts.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MSpace-Dev    12

MSpace-Dev

MSpace-Dev    12

  • Creeper Killer
  • MSpace-Dev
  • Members
  • 12
  • 180 posts
Posted November 12

Alright, I've moved everything to being registered through the registry event and EntityEntryBuilder.

 

My entities are exactly the same in world, so it's working. The lang file is still not working for them though.

 

RegistryEventHandler

@SubscribeEvent
public static void registerEntities(RegistryEvent.Register<EntityEntry> event)
  {
  final IForgeRegistry<EntityEntry> registry = event.getRegistry();

  for (final EntityEntry entityEntry : ModEntities.ENTITIES)
  {
  	registry.register(entityEntry);
  }
}

 

ModEntities

public class ModEntities
{
	private static int id = 1500;

	public static final EntityEntry[] ENTITIES = {
			getEntityEntry("mob_name", "Mob Name", EntityMob.class, 16167425, 16775294)
	};

	private static EntityEntry getEntityEntry(String nameId, String entityName, Class<? extends Entity> entityClass, int eggPrimary, int eggSecondary)
	{
		return EntityEntryBuilder.create()
				.entity(entityClass)
				.id(new ResourceLocation(Reference.MODID, nameId),++id)
				.name(entityName)
				.tracker(64, 1, false)
				.egg(eggPrimary, eggSecondary)
				.spawn(EnumCreatureType.MONSTER, 0, 0, 0, Biomes.VOID)
				.build();
	}
}

 

en_us

#### Entities ####
entity.mod_id.mob_name.name=Mob Name

entity.mob_name.name=Mob Name

 

Am I missing something?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6687

diesieben07

diesieben07    6687

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6687
  • 45707 posts
Posted November 12

Your entity name shoudl be all lowercase and contain your mod ID.

  • Quote

Share this post


Link to post
Share on other sites

MSpace-Dev    12

MSpace-Dev

MSpace-Dev    12

  • Creeper Killer
  • MSpace-Dev
  • Members
  • 12
  • 180 posts
Posted November 12

Oh, I understand now. Something like modid_mob_name ?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6687

diesieben07

diesieben07    6687

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6687
  • 45707 posts
Posted November 12
40 minutes ago, MSpace-Dev said:

Oh, I understand now. Something like modid_mob_name ?

Yes, for example.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DaemonUmbra
      Forge 28.1.10 won't show on launcher + 28.1.0 fails to work

      By DaemonUmbra · Posted 3 minutes ago

      Where are you looking in the launcher? I suspect you are looking at Profiles/Installations rather than Versions
    • Simon_kungen
      [1.14.4] Sync ItemStack Capability Data + Multi-Capability Provider casting error

      By Simon_kungen · Posted 12 minutes ago

      So yeah... looks like none of my questions has been answered lately. Should I give up on capabilities for now?
    • TheGreenSquarez
      Forge 28.1.10 won't show on launcher + 28.1.0 fails to work

      By TheGreenSquarez · Posted 51 minutes ago

      here's the screenshot.
    • TheGreenSquarez
      Forge 28.1.10 won't show on launcher + 28.1.0 fails to work

      By TheGreenSquarez · Posted 53 minutes ago

      I'm quite sure it just updated to the latest version.
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 1 hour ago

      Ok, i want try Something, pls wait.
  • Topics

    • TheGreenSquarez
      4
      Forge 28.1.10 won't show on launcher + 28.1.0 fails to work

      By TheGreenSquarez
      Started Yesterday at 11:21 AM

    • Simon_kungen
      1
      [1.14.4] Sync ItemStack Capability Data + Multi-Capability Provider casting error

      By Simon_kungen
      Started 22 hours ago

    • DragonITA
      33
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA
      Started Monday at 10:06 AM

    • jun2040
      1
      Game crashing when the block is activated

      By jun2040
      Started 1 hour ago

    • Prasodym
      7
      produces unregistered item minecraft:wooden_door

      By Prasodym
      Started April 28

  • Who's Online (See full list)

    • DaemonUmbra
    • Cerandior
    • Choonster
    • Simon_kungen
    • DragonITA
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12.2] lang file not working for entities
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community