sccreeper Posted June 21, 2020 Posted June 21, 2020 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 Quote
poopoodice Posted June 21, 2020 Posted June 21, 2020 override onLeftClickEntity and addPotionEffect to the living entity Quote
DevTech Posted June 21, 2020 Posted June 21, 2020 @Override public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) { target.addPotionEffect(new EffectInstance(Effects.WEAKNESS, 200, 0)); return super.hitEntity(stack, target, attacker); } Quote
sccreeper Posted June 23, 2020 Author Posted June 23, 2020 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? Quote
sccreeper Posted June 23, 2020 Author Posted June 23, 2020 It's fine, I have managed to get what I intended to work with PlayerInteractEvent instead. Quote
Recommended Posts
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.