Jump to content

Recommended Posts

Posted

Hello, I have been having trouble getting unique subitem names for metadata blocks/items all night. New to modding minecraft, and I guess a lot just changed with 1.5 so.. that's just my luck

 

Anyway, I've made a real quick and dirty mod to illustrate my problem. Here are the code files I wrote just now:

 

Test.java

 

  Reveal hidden contents

 

 

BlockTest.java

 

  Reveal hidden contents

 

 

ItemBlockTest.java

 

  Reveal hidden contents

 

 

CommonProxy.java and ClientProxy.java

 

  Reveal hidden contents

 

 

If you run the mod, all 4 blocks show up in the creative section and the inventory as "Sub-item D".

 

What am I missing?

Posted

Thanks for the response. I went ahead and took your suggestion on the above code, and unfortunately I'm getting the same result.

 

This is what I am using now in place of the getItemDisplayName override:

    @Override
    public String getUnlocalizedName(ItemStack itemStack)
    {
    	return this.getUnlocalizedName() + subName[itemStack.getItemDamage()];
    }

Posted

Perfect! Thank you.

 

Here's the updated code for anyone interested:

 

Test.java

 

  Reveal hidden contents

 

 

ItemBlockTest.java

 

  Reveal hidden contents

 

  • 3 weeks later...

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.