Advertisement
HalestormXV

Untitled

Jul 17th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.35 KB | None | 0 0
  1. public class EntityCelestialBolt extends EntityThrowable {
  2.     public static final float explosionPower = 0.75F;
  3.  
  4.     public EntityCelestialBolt(World world) {
  5.         super(world);
  6.     }
  7.  
  8.     public EntityCelestialBolt(World world, EntityLivingBase entity) {
  9.         super(world, entity);
  10.     }
  11.  
  12.     private void explode() {
  13.         int bx = (int) posX;
  14.         int by = (int) posY;
  15.         int bz = (int) posZ;
  16.         world.createExplosion(this, posX, posY, posZ, 0.75F, true);
  17.         setDead();
  18.     }
  19.  
  20.     @Override
  21.     public void onUpdate() {
  22.         super.onUpdate();
  23.         if (ticksExisted > 20) {
  24.             explode();
  25.         }
  26.  
  27.         for (int i = 0; i < 10; i++) {
  28.             double x = (double) (rand.nextInt(10) - 5) / 8.0D;
  29.             double y = (double) (rand.nextInt(10) - 5) / 8.0D;
  30.             double z = (double) (rand.nextInt(10) - 5) / 8.0D;
  31.             world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, posX, posY, posZ, x, y, z);
  32.         }
  33.     }
  34.  
  35.     @Override
  36.     protected float getGravityVelocity() {
  37.         return 0.005F;
  38.     }
  39.  
  40.     @Override
  41.     protected void onImpact(RayTraceResult result)
  42.     {
  43.         {
  44.             if (result.entityHit != null)
  45.             {
  46.                 //this.doAwesomeEffectMethodHereWhenIWork(result);
  47.             }
  48.             this.setDead();
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement