Jump to content

[Solved] using your en_US file for custom strings


Casual Dutchman

Recommended Posts

Ik want some words to be translate-able, (if that's a word) but they language file does not let me.

I used the

container.customname

and than put that in the en_US.lang file

container.customname=Custom Name
item.things.name=Things

That is working! But now i tried something different.

I wanted my entity to say something in the chat on interaction.

so I typed this:

par1EntityPlayer.addChatMessage(new ChatComponentText("[" + entity.modid.mobname.name + "] " + "entity.go"));

When I run the game my mob will tell me: [entity.modid.mobname.name] entity.go.

This is not what I wanted, I wanted it to be: [Name] Go

Name is the name of the mob, the name is located in the language file.

Go is the string I wanted the mob to say, this is located in my language file too.

 

What do I need to have or do?

There is nothing strange in my class.

Coding, Testing, Smiling, Publishing!

Link to comment
Share on other sites

I found it!

Just use the same methode as normal minecraft uses, it will also use the custom language file.

 

"[" + I18n.format("entity.modid.mobname.name", new Object[0]) + "] " +  I18n.format("entity.go", new Object[0])));

 

Now my mob says: [Name] Let's go!

 

It Worked

Coding, Testing, Smiling, Publishing!

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.