Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8.9] Custom Item Change


Monstrous_Apple
 Share

Recommended Posts

Okay so I did what you said, and I put the color change here:

GameRegistry.registerItem(ObsidianStick = new MAItem("§4ObsidianStick"), "ObsidianStick");

And this happens:

width=316 height=54https://scontent-lhr3-1.xx.fbcdn.net/v/t34.0-12/13277907_1002269206489629_433977824_n.png?oh=80cfcfe2aa321bb150445d8995a18a6b&oe=57438F9A[/img]

 

It makes the name go from "Obsidian Stick" with no colour to "item.ObsidianStick.name" with most of it red, can you tell me what I did wrong please?

Link to comment
Share on other sites

You should put that in your language file.

 

Sorry, I was under wrong impression. I mean since registered name points at name in lang, why not return colorized name from lang file.

 

I was wrong :)

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

You actually shouldn't. Language files have no business with formatting codes. Override

getItemStackDisplayName

in your Item and prepend one of

EnumChatFormatting

to what the super method returns.

 

Example (pseudocode):

 

return EnumChatFormatting.GREEN + super.getItemStackDisplayName 

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

 Share



×
×
  • Create New...

Important Information

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