Jump to content

Recommended Posts

Posted

So i have some custom armor in my mod, I would like to add potions of a certain type to that recipe, for example the 1 helmet gives you night vision, so i'd like the helmet to be crafted with a night vision potion, I've tried looking around but couldn't find any 1.9 tutorials for this. I know how to do recipes, just not sure on adding potions to it. My current line is below for one of my helmets.

 

GameRegistry.addRecipe(new ItemStack(SlurpiesDonglesItems.topaz_helmet), "  ", "TPT", "TRT", 'T', SlurpiesDonglesItems.hardened_topaz, 'R', SlurpiesDonglesItems.ruby_helmet, 'P', ***);

 

Where the ***'s are after the p at the end, is what i am not sure of what to put there to make the P in the quotes, know that it's supposed to be a Night Vision potion. If anyone could help me, i'd appreciate it, thank you.

Posted

You can create and pass an ItemStack as an argument.

 

I think it would be something like

 

NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("Potion", "minecraft:night_vision");
ItemStack potion = new ItemStack(Items.potion);
potion.setTagCompound(nbt);

 

May be a couple of mistakes there, but I am sure you can fix any.

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.