Jump to content

Dr_Derpy

Members
  • Posts

    6
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    <insert text here>

Dr_Derpy's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Alright, I've just applied a texture and a name to the effect, and everything is working perfectly after I fixed the code. Thank you so much!
  2. This is what I could get out of your code, and the potion effect game in game is potion/IbpEffect . The item still hurts me when I use it. public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if (entityplayer.getHealth() < entityplayer.getMaxHealth() ){ itemstack.damageItem(1, entityplayer); if (entityplayer.isPotionActive(RandomC.Ibp));{ entityplayer.attackEntityFrom(DamageSource.causePlayerDamage(entityplayer), 5); } } else { entityplayer.addPotionEffect((new PotionEffect(RandomC.Ibp.getId(), 100, 0))); entityplayer.heal(healAmount); }
  3. I switched the causePlayerDamage lines and the addPotionEffect lines around, but it would still damage me if I had the effect or not. The last section of code was to give the item back if the player used it at full health, but it didn't work. And, do you know how to name the potion effect in the en_US.lang file? Thanks in advance
  4. I tried to do something with the code you gave me, but every time I use the item, I just take damage, with or without the potion effect. Here is the bottom portion of code for my Ibuprofen item. public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { itemstack.damageItem(1, entityplayer); entityplayer.addPotionEffect((new PotionEffect(RandomC.Ibp.getId(), 5, 0))); if (entityplayer.isPotionActive(RandomC.Ibp)); entityplayer.attackEntityFrom(DamageSource.causePlayerDamage(entityplayer), 5); if (entityplayer.prevHealth >= 20) return itemstack; entityplayer.heal(healAmount); return itemstack;
  5. Again, I have no clue how to do this, so I think I made the Effect class correctly, but how do I make the item kill them when they have the effect, and how do I make the Ibuprofen give the effect?
  6. So I'm coding a sort of medicine mod, and I'm trying to make my Ibuprofen item give a "Painkiller Sickness" after using it once, and if it is used again during the time of the status effect, the player dies, or takes massive amounts of damage. I'm new to the whole Java coding thing, so any help would be appreciated. Thanks in advance!
×
×
  • Create New...

Important Information

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