Jump to content

XmorpH

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by XmorpH

  1. So there is an other way that I can make my item? I'm really stuck
  2. Why not? I want my item behavies like a vanilla instant health potion. The only thing I want is somebody help Here's my code extending ItemFood working: public class ItemCustomDrink extends ItemFood implements IHasModel { public ItemCustomDrink(String name, int amount, boolean isWolfFood) { super(amount, isWolfFood); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.BREWING); setAlwaysEdible(); setMaxStackSize(20); ModItems.ITEMS.add(this); } @Override public void registerModels() { Main.proxy.registerItemRenderer(this, 0, "inventory"); } @Override public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.DRINK; } } And this is my Item: public class ItemEstusFlask extends ItemCustomDrink { public ItemEstusFlask(String name, int amount, boolean isWolfFood) { super(name, amount, isWolfFood); } @Override protected void onFoodEaten(ItemStack itemStack, World worldIn, EntityPlayer player) { if (!worldIn.isRemote) { player.addPotionEffect(new PotionEffect(MobEffects.INSTANT_HEALTH, 100, 1)); } } }
  3. It is because it's just one single "Potion" right? So extending ItemFood is better.
  4. Well, I figured it out extending ItemFood and it worked as I want, only with the problem that the Potion Icon didn't show up. Now, if you can help me extending ItemPotion this time, I would be very grateful. Just to see what is best to do. Thanks again.
  5. I know that I just created the item, and then I will have to put the heal parameters, but my problem is that in-game didn't show up the drink animation and I wonder if my code is missing something.
  6. Hello everyone I need help please! In my mod I'm trying to make a drinkable Potion that heals player (more specifically an Estus Flask) but I'm in trouble with the code and functionality of the item, I know that I have to make a ItemFood for that and change the animation to EnumAction.DRINK but didn't work for me, if anyone could help me with the code of what to do next I will be very grateful. Thanks! This is my code so far: package com.xmorph.craftsoulsmod.items; import javax.annotation.Nonnull; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; public class ItemEstusFlask extends ItemFood { public ItemEstusFlask(String name, int amount, float saturation, boolean isWolfFood) { super(amount, saturation, isWolfFood); this.setAlwaysEdible(); this.setMaxStackSize(1); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.FOOD); } @Override @Nonnull public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.DRINK; } }
  7. Okay I understand, sorry!
  8. Hi! I'm new in Forge Modding and I want to know how to make a Potion (an instant health Potion) but I can't figure out how to code it. I tried making a food and add in the Item Class an EnumAction for drink, but didn't work So I just want to make a Potion that instantly cures the player (like the vanilla with other texture). Please help me, I would appreciate it so much. This is my Item class so far: import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class estusFlask extends Item { public estusFlask() { this.setCreativeTab(CreativeTabs.tabMisc); } @Override public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.drink; } }
  9. Hi! Sorry I'm quite new in Forge Modding and I want to know if you solved this problem because I also want to make a Potion (more specifically an instant health potion) but this is so difficult and confusing and I can't found a proper tutorial I tried making a food as you said, but I want it to be like a normal potion (drinkable) Can you please help me? I would appreciate it!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.