39 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package net.minecraft.world.effect;
 | |
| 
 | |
| import net.minecraft.core.particles.ParticleTypes;
 | |
| import net.minecraft.server.level.ServerLevel;
 | |
| import net.minecraft.sounds.SoundEvents;
 | |
| import net.minecraft.world.entity.Entity;
 | |
| import net.minecraft.world.entity.LivingEntity;
 | |
| import net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge;
 | |
| import net.minecraft.world.level.Level;
 | |
| 
 | |
| class WindChargedMobEffect extends MobEffect {
 | |
| 	protected WindChargedMobEffect(MobEffectCategory mobEffectCategory, int i) {
 | |
| 		super(mobEffectCategory, i, ParticleTypes.SMALL_GUST);
 | |
| 	}
 | |
| 
 | |
| 	@Override
 | |
| 	public void onMobRemoved(ServerLevel level, LivingEntity entity, int amplifier, Entity.RemovalReason reason) {
 | |
| 		if (reason == Entity.RemovalReason.KILLED) {
 | |
| 			double d = entity.getX();
 | |
| 			double e = entity.getY() + entity.getBbHeight() / 2.0F;
 | |
| 			double f = entity.getZ();
 | |
| 			float g = 3.0F + entity.getRandom().nextFloat() * 2.0F;
 | |
| 			level.explode(
 | |
| 				entity,
 | |
| 				null,
 | |
| 				AbstractWindCharge.EXPLOSION_DAMAGE_CALCULATOR,
 | |
| 				d,
 | |
| 				e,
 | |
| 				f,
 | |
| 				g,
 | |
| 				false,
 | |
| 				Level.ExplosionInteraction.TRIGGER,
 | |
| 				ParticleTypes.GUST_EMITTER_SMALL,
 | |
| 				ParticleTypes.GUST_EMITTER_LARGE,
 | |
| 				SoundEvents.BREEZE_WIND_CHARGE_BURST
 | |
| 			);
 | |
| 		}
 | |
| 	}
 | |
| }
 |