Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void performEffect(LivingEntity entity, int amplifier) {
- CompoundNBT entityData = entity.getPersistentData();
- if (!(entityData.getBoolean("lifebinding.lifeBound"))) {
- if (entity.isPotionActive(LifeBindingPotion.LIFE_BINDING_EFFECT.get())) {
- for (LivingEntity livingEntity : entity.world.getEntitiesWithinAABB(LivingEntity.class,
- entity.getBoundingBox().grow(3.0D))) {
- if (livingEntity.isAlive() && livingEntity != entity) {
- if (!(livingEntity instanceof PlayerEntity)) {
- entityData.putBoolean("lifebinding.lifeBound", true);
- livingEntity.removePotionEffect(LifeBindingPotion.LIFE_BINDING_EFFECT.get());
- livingEntity.getEntityWorld().playSound(null, (livingEntity).getPosition(),
- SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.HOSTILE, 0.5F, 1.0F);
- ((ServerWorld)livingEntity.world).spawnParticle(ParticleTypes.EXPLOSION, livingEntity.getPosX(),
- livingEntity.getPosYHeight(1.0D), livingEntity.getPosZ(), 8, 2.0D, 2.0D, 2.0D, 0.5D);
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment