Jump to content

DanielDawn

Forge Modder
  • Posts

    62
  • Joined

  • Last visited

Everything posted by DanielDawn

  1. It's just that I want to be like most other professional mods, where it says zero and still works. But, thanks!
  2. Thank you, that's exactly what I thought. It turns out, the problem was with an unnecessary variable in my method... Like really dumb mistake. But, thanks! This really helped! Just in case anyone who stumbles upon this wants the code. For 1.7 public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(player.getCurrentArmor(3) != null){ ItemStack helmet = player.getCurrentArmor(3); //3 is for helmet if(helmet.getItem() == ModId.ArmorPiece){ //player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 50, 0)); if(!player.isPotionActive(Potion.regeneration.getId())) player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 50, 0)); } Thank you so much! Edit: Is there anyway I can have the timer simply say 0:00 all the time?
  3. I'm doing it wrong... What should I put in the parentheses? I've tried Potion.regeneration, potion.regeneration, Potion.regeneration.getId(), and potion. if(!player.isPotionActive(Potion.regeneration)) Oh and I used ! because it basically asks if the player doesn't have regeneration, then give the player regeneration. if(!player.isPotionActive()) player.addPotionEffect(new PotionEffect(potion.regeneration.getId(), 50, 0)); if(player.isPotionActive(potion.regeneration.getId())) If I can figure out how to use this properly, this will definitely be better than the old tick if statement. Thank you though, this really helps.
  4. Okay so, I need a way to have the regeneration effect refresh like every 50 ticks so it can do its job while having my armor use the onArmorTick method. Because if it's just set to 0 ticks and is constantly on 0 it won't do anything but play the animation and instantly heal. public void onArmorTick(World world, EntityPlayer player, Potion potion, ItemStack itemStack) { if(player.getCurrentArmor(3) != null){ ItemStack helmet = player.getCurrentArmor(3); if(helmet.getItem() == SmallEnhancements.regeneration_charm){ player.addPotionEffect(new PotionEffect(Potion.regeneration.getId(), 50, 0)); } Any help is greatly appreciated, but code is favored. I'd be happy to provide additional information upon request.
  5. But, I currently use 1.7.10 and find NEI to be very useful.
  6. Oh and I do use NEI. So would it not work at all if I was running NEI?
  7. Thank you for the quick reply. How can I make my message customizable in the lang file? Do I just put item.documentation.line1?
  8. Hello, thank you for taking the time to read this. I'd like to add short descriptions that work with the language files to vanilla items. So I can list how many hunger bars a food fills and such or add a description to rarities such as diamonds I'd preferably like to add this code in my base class. I'm still new with coding, and have only done basic things. (Ores, Materials, Effect Swords, Effect Helmets, Right Click Special Swords, Increasing maximum stack size for potions, and creating a block that negates fall damage.)
×
×
  • Create New...

Important Information

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