Posted June 21, 20205 yr I want to make a item, which when a entity is attacked with it, it gives that entity a potion effect. Any help would be greatly appreciated, Oscar
June 21, 20205 yr @Override public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { target.addPotionEffect(new EffectInstance(Effects.WEAKNESS, 200, 0)); return super.hitEntity(stack, target, attacker); }
June 23, 20205 yr Author I can't get that to work, IntelliJ keeps on saying that it can't override the superclass method. Do you know how to fix this?
June 23, 20205 yr Author It's fine, I have managed to get what I intended to work with PlayerInteractEvent instead.
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.