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

For plugin-testing purposes (currently), I've written something that can dynamically create simple items based on either the contents of a configuration file, or in-game commands (that, along with creating said item, add the right details to the configuration file), and use a command or output a message when used on things. I've run into a couple of minor issues with this - they work, but they only have unlocalised names, and .

 

First, items created from either the configuration file or in-game commands only have unlocalised names; since the unlocalised name is different for each item, and since these items aren't made in advance, the EN_lang file doesn't contain a proper name for them. Is there a way to give items proper names when created, since I don't know what names are going to be used in advance?

 

Second, items created via in-game commands function properly, but don't have the expected item graphic, instead acting as if they have no graphic. If the server is restarted and the item created from the configuration file, they do. Is this a result of attempting to register an item too late, and, again, is there a way to fix this?

 

Possibly relevant: constructor of basic item

	public ItemMagicWand(String name, String newCommand)
{
	setUnlocalizedName(MagicWands.MODID + "_" + name);
	setTextureName(MagicWands.MODID + ":" + "magicWand");
	GameRegistry.registerItem(this, name);
	setCreativeTab(CreativeTabs.tabMisc);

	command = newCommand;
	if(command.charAt(0) == "/".toCharArray()[0])
		isCommand = true;
	else
		isCommand = false;
}

I'm not entirely sure your approach, but you may be able to utilize

        @Override
public String getItemStackDisplayName(ItemStack stack){
	return "whatever"";	
}

 

Or an equivalent...

I'll need help, and I'll give help. Just ask, you know I will!

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.