Posted June 30, 201312 yr I made artifact that restores health. Did it all in OnTickInGame. But when I remove the effect remains. Code in OnTickInGame: if(mc.thePlayer.inventory.getStackInSlot(6 - 6) != null && mc.thePlayer.inventory.getStackInSlot(6 - 6).itemID == Items.artSoul.itemID ) { mc.thePlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 100, 0, true)); }
June 30, 201312 yr When you remove what the effect remains? The code? The item? BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
June 30, 201312 yr Wouldn't this add 100 ticks to the potion duration on every single tick? Thus making the effect last 100 times longer than however you had it equipped for? You should try having it check to see if the potion effect is already active before applying it again. Here's the code I used for one of my items: if (!player.isPotionActive(Potion.jump)) { player.addPotionEffect(new PotionEffect(Potion.jump.id, 500, 1)); }
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.