Advertisement
jayhillx

BindingEffect 01

May 4th, 2021
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. public void performEffect(LivingEntity entity, int amplifier) {
  2. if (entity.isPotionActive(LifeBindingPotion.LIFE_BINDING_EFFECT.get())) {
  3. for (LivingEntity livingEntity : entity.world.getEntitiesWithinAABB(LivingEntity.class,
  4. entity.getBoundingBox().grow(3.0D))) {
  5. if (livingEntity.isAlive() && livingEntity != entity) {
  6. if (!(livingEntity instanceof PlayerEntity && ((PlayerEntity) livingEntity).isCreative())) {
  7. if (livingEntity.isPotionActive(LifeBindingPotion.LIFE_BINDING_EFFECT.get())) {
  8. livingEntity.removePotionEffect(LifeBindingPotion.LIFE_BINDING_EFFECT.get());
  9.  
  10. ((ServerWorld)livingEntity.world).spawnParticle(ParticleTypes.EXPLOSION, livingEntity.getPosX(),
  11. livingEntity.getPosYHeight(1.0D), livingEntity.getPosZ(), 8, 1.0D, 1.0D, 1.0D, 0.0D);
  12. }
  13. }
  14. }
  15. }
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement