Skip to content
Matias Bjarland edited this page Dec 6, 2017 · 4 revisions

Resources: Language files

Requirements

  • A mod.
  • Something to add names to (such as a block or item).

Instructions

  • This section won't have much programming in it, but is here to explain how to add language files to your mod. If you have already modded Minecraft before, this is the same as with java and you can skip this tutorial. Otherwise, read on.

  • If you've been following the previous tutorials, you now have an item and/or block in your mod. However, it's named something weird in game like tile.test-block.name instead of, say, "Test Block". In order to change this, we need to create a lang (or language) file.

  • The first thing we have to do is create the file itself. This needs to be in a certain location, namely in the src/main/resources/assets//lang folder. If any of those folders don't exist, make them, so that you have a file path like that.

  • Inside of your lang folder, create a new file called "en_US.lang". This file represents users using English (and using a version from the United States). There are many other files, and the reason these lang files exist is to make it easy for other people to translate your mod into another language. While in English your block's name might be "Test Block", in another language it could be something else.

  • After creating this file, open it up with any text editor. The syntax looks something like this:

<unlocalized name>=<localized name>
  • The unlocalized name for something, is that weird text you get when hovering over it in game. For items, it's something like item..name, and for blocks it's something like tile..name. After that, you provide the localized name, or the name that you ACTUALLY want to be displayed.

  • Here's an example of adding our block and item from the previous tutorials to our lang file:

item.test-item.name=Test Item
tile.test-block.name=Test Block

Clone this wiki locally