Help with adding potion to inventory [solved]

Started by ArcaneMortis on Sat, 03/26/2016 - 04:09

Topic category: Help with MCreator modding

Last seen on 05:14, 22. Jul 2019
Joined Aug 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help with adding potion to inventory [solved]
Sat, 03/26/2016 - 07:25 (edited)

I know this is probably a simple fix, but I am trying to add potions to the players inventory with an "on right clicked" event. Im not sure how mCreator handles potions (oredictionary. potionhandler. etc)

if(entity instanceof EntityPlayer)((EntityPlayer)entity).inventory.addItemStackToInventory(new ItemStack(Items.potionitem, 1));    //  I need Items.potionitem to be an "Awkward" potion not a "water bottle"

so if anyone can point me towards a list of potion ID's and how to place them at the end of the argument above, you shall have all my internets!

 

---- EDIT ---

after some tinkering I found that you just need to place the decimal value for the potion in the second numeral place following the "Items.potionitem" area so my line now reads as

if(entity instanceof EntityPlayer)((EntityPlayer)entity).inventory.addItemStackToInventory(new ItemStack(Items.potionitem, 1, 16));  //adds 1 awkward potion

Edited by ArcaneMortis on Sat, 03/26/2016 - 07:25