Jump to content

Recommended Posts

Posted

Hello everyone.

 

I would like to know if it is possible, and if so, how I can use EnumChatFormatting for an item/block name that is named from a .lang file. I would like to colour the name of the block, and I know that this was possible with LanguageRegistry

 

Thanks.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Posted

Like this?

        public String getItemStackDisplayName(ItemStack stack) {
	return EnumChatFormatting.FormatCode + this.getItemStackDisplayName(stack);
}

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Posted

Nevermind.... that caused a stackoverflow. I guess I should have seen that that was a recursive method.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

Posted

So...

public String getItemStackDisplayName(ItemStack stack) {
return EnumChatFormatting.AQUA + super.getItemStackDisplayName(stack);
}

Using the super method.

I ask complicated questions, and apparently like to write really long detailed posts. But I also help others when I can.

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.