Posted August 28, 201312 yr For some reason, I cannot get addPotionEffect to work correctly. The method that I had working in 1.5.2: [/code public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { if (entity instanceof EntityLiving) { EntityLiving entityLiving = (EntityLiving) entity; entityLiving.addPotionEffect(potionEffect); } return false; } And this is the code for the item. [code] thoriumSword = new ItemPotionSword(ItemIds.THORIUM_SWORD_ID, TOOL_THORIUM, Strings.THORIUM_SWORD_NAME, new PotionEffect(Potion.wither.id, 1000, 1, true), Strings.TEXTURE_FOLDER + ":" + Strings.THORIUM_SWORD_NAME); Note: I stepped through it and nothing went wrong, it just didn't work for some reason. Also, it will occasionally work, but other times it won't work. Source: https://github.com/Shalashalska/Melior-Metallum/blob/master/metallum_common/metallum/item/ItemPotionSword.java Edit: Now it started working properly again.
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.