Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

In the new update I'm making a simple mod, and right now the problem is I cant get the language file to work. Heres how I have it saved:

 

src/main/resources/assets/colormod/lang/en_US.lang

 

here is my lang file:

item.greenPickaxe.name =Green Pickaxe

 

and here is my mod file:

package com.mjj.colormod;

import com.mjj.colormod.handler.ItemHandler;
import com.mjj.colormod.items.GreenPickaxe;

import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;

@Mod(modid = ColorMod.modid , version = ColorMod.version)
public class ColorMod 
{
public static final String modid = "colormod";
public static final String version = "1.7.2";


        @EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	//Item handler, handles all items
		ItemHandler.loadItems();
}
}

 

Heres my pickaxe code:

package com.mjj.colormod.items;

import com.mjj.colormod.ColorMod;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;

public class GreenPickaxe extends ItemPickaxe
{
public GreenPickaxe(ToolMaterial material) 
{
	super(material);
	setUnlocalizedName("greenPickaxe");
	setTextureName(ColorMod.modid + ":" + getUnlocalizedName().substring(5));
	setCreativeTab(CreativeTabs.tabTools);
}
}

 

And just in case you need it here is my ItemHandler:

package com.mjj.colormod.handler;

import com.mjj.colormod.items.GreenPickaxe;

import cpw.mods.fml.common.registry.GameRegistry;

import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;

public class ItemHandler 
{
//Tools
public static Item greenPickaxe;

//Items

//Armor

//Materials
static ToolMaterial greenMaterial = EnumHelper.addToolMaterial("greenMaterial", 2, 255, 6.0F, 2.0F, 15);

public static void loadItems()
{
	//Tools
	greenPickaxe = new GreenPickaxe(greenMaterial);

	GameRegistry.registerItem(greenPickaxe, "greenPickaxe");

	//Items

	//Armor

}
}

 

The problem is in game the weapon name is: item.greenPickaxe.name

 

As far as I know I have everything correct, thats why im confused. If you need anymore of my code posted please respond and I will send it. Thanks

 

~vandy22

item.greenPickaxe.name =Green Pickaxe

 

Have you tried

item.greenPickaxe.name=Green Pickaxe

(without the space before the equals).

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Thank you it worked  :) . Such a dumb mistake

 

Actually it is a dumb implementation -- it shouldn't be sensitive to final white space near the = assignment.  Pretty much every person does this wrong the first time, and then again later when they forget.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Yes, it is quite annoying. But then again...

 

At any rate, it could be implemented a bit better, that is for sure.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

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...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.