Posted November 3, 20213 yr Hi I would like to how how it is so that when a mob hits you it gives you the potion (poison) effect for 4 seconds
November 4, 20213 yr First off, override the hurt method. You'll get the DamageSource from which you can get the entity. After that do a null check on it and check if it's an instance of LivingEntity (or Mob). If it is, you can apply the effect.
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.