Jump to content

Recommended Posts

Posted (edited)

I've got a block that has a randomized name and I need to be able to change what the player sees in their inventory to that name instead of tile.x.name

 

Is there any way to do that that doesn't involve putting every possible name that can come from my random name generator into the lang file?

Edited by myriath
Solved
Posted

Is it truly random or is it a game of pick a name from piles A, B, and C, your item's name is now ABC

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 9/5/2019 at 7:23 AM, ZigTheHedge said:

It won't be translated, right? If so, what's the problem? Just return your translated name from Block::getUnlocalizedName override.

Expand  

When I do that the name turns into x.name in the inventory, how would I get rid of the .name part?

Posted

It seems as though this would work, however I don't know how to get the name into the custom ItemBlock class and into the registry. Overriding works fine for a static name, but I don't know how I'd update it from the Main class of the mod.

Posted
  On 9/5/2019 at 10:43 PM, myriath said:

into the registry

Expand  

No you dont do this.

 

  On 9/5/2019 at 10:43 PM, myriath said:

Main class of the mod.

Expand  

Make a variable? What are you trying to do from an end user perspective? 

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 9/5/2019 at 11:08 PM, Animefan8888 said:

Make a variable? What are you trying to do from an end user perspective? 

Expand  

The user will see a randomly generated name for the ore and it's respective items. Say the random name is blah, you'll get Blah ore, Blah ingot, blah chestplate, etc.

 

  On 9/5/2019 at 11:08 PM, Animefan8888 said:

No you dont do this.

Expand  

How do I get the game to realize the block should use the custom ItemBlock class for it's name? Currently I'm trying to use GameRegistry.registerBlock with the block, it's respective itemblock class, and the block's unlocalized name as it's parameters. Is that not how it's supposed to be registered?

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.