Jump to content

Recommended Posts

Posted (edited)

Hi all!

I have a mod that registers this recipe in the init method (when FMLInitializationEvent is fired):

ItemStack output = new ItemStack(Items.WRITTEN_BOOK);
NBTTagCompound compound = new NBTTagCompound();
output.setTagCompound(compound);
compound.setTag("title", new NBTTagString(new TextComponentTranslation("giacomostravelogue.title").getFormattedText()));
compound.setBoolean("giacomostravelogue", true);

ResourceLocation name = new ResourceLocation(MODID + ":travelogue_recipe");
ResourceLocation group = null;
Ingredient ingredient1 = Ingredient.fromItem(Items.COMPASS);
Ingredient ingredient2 = Ingredient.fromItem(Items.WRITABLE_BOOK);
GameRegistry.addShapelessRecipe(name, group, output, ingredient1, ingredient2);

 

As you can see the tag "title" has a value that depends on the language.

Is there a way to put in the json recipe something like that? 

 

Edited by Zacomat

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.