Advertisement
Guest User

Untitled

a guest
Sep 4th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.19 KB | None | 0 0
  1. import net.minecraft.entity.EntityLivingBase;
  2. import net.minecraft.entity.projectile.EntityThrowable;
  3. import net.minecraft.util.DamageSource;
  4. import net.minecraft.util.EnumParticleTypes;
  5. import net.minecraft.util.math.RayTraceResult;
  6. import net.minecraft.world.World;
  7.  
  8. public class EntityMagicBolt extends EntityThrowable
  9. {
  10.     public EntityMagicBolt(World world)
  11.     {
  12.         super(world);
  13.     }
  14.    
  15.     public EntityMagicBolt(World world, EntityLivingBase entity)
  16.     {
  17.         super(world, entity);
  18.     }
  19.    
  20.     public EntityMagicBolt(World world, double x, double y, double z)
  21.     {
  22.         super(world, x, y, z);
  23.     }
  24.    
  25.     protected float getGravityVelocity()
  26.     {
  27.         return 0.0F;
  28.     }
  29.    
  30.     @Override
  31.     protected void onImpact(RayTraceResult result)
  32.     {
  33.         float damage = 20;
  34.         if (result.entityHit != null)
  35.         {
  36.             result.entityHit.setFire(5);
  37.             //result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), damage);
  38.         }
  39.         setDead();
  40.     }
  41.    
  42.     public void onUpdate()
  43.     {
  44.         super.onUpdate();
  45.         this.worldObj.spawnParticle(EnumParticleTypes.SPELL, this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ, -this.motionX, -this.motionY + 0.2D, -this.motionZ, new int[0]);
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement