Guest User

Gun Bullet Entity Class

a guest
Aug 2nd, 2014
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. package naculis.mod;
  2.  
  3. import net.minecraft.entity.EntityLivingBase;
  4. import net.minecraft.entity.projectile.EntityThrowable;
  5. import net.minecraft.util.MovingObjectPosition;
  6. import net.minecraft.world.World;
  7.  
  8. public class EntityBlasterBolt extends EntityThrowable
  9. {
  10.    
  11.    
  12.    
  13.  
  14.    
  15.    
  16.     private float explosionRadius;
  17.     public EntityBlasterBolt(World par1World)
  18.     {
  19.         super(par1World);
  20.     }
  21.     public EntityBlasterBolt(World par1World, EntityLivingBase par2EntityLivingBase)
  22.     {
  23.         super(par1World, par2EntityLivingBase);
  24.         motionX *= 6.0F;
  25.         motionY *= 6.0F;
  26.         motionZ *= 6.0F;
  27.     }
  28.     public EntityBlasterBolt(World par1World, double par2, double par4, double par6)
  29.     {
  30.         super(par1World, par2, par4, par6);
  31.         motionX *= 6.0F;
  32.         motionY *= 6.0F;
  33.         motionZ *= 6.0F;
  34.     }
  35.     @Override
  36.     protected void onImpact(MovingObjectPosition par1MovingObjectPosition){
  37.         // TODO Auto-generated method stub
  38.         this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true);            
  39.         this.setDead();
  40.            
  41.         }
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment