Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.projectile.EntityThrowable;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraft.util.math.RayTraceResult;
- import net.minecraft.world.World;
- public class EntityMagicBolt extends EntityThrowable
- {
- public EntityMagicBolt(World world)
- {
- super(world);
- }
- public EntityMagicBolt(World world, EntityLivingBase entity)
- {
- super(world, entity);
- }
- public EntityMagicBolt(World world, double x, double y, double z)
- {
- super(world, x, y, z);
- }
- protected float getGravityVelocity()
- {
- return 0.0F;
- }
- @Override
- protected void onImpact(RayTraceResult result)
- {
- float damage = 20;
- if (result.entityHit != null)
- {
- result.entityHit.setFire(5);
- //result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), damage);
- }
- setDead();
- }
- public void onUpdate()
- {
- super.onUpdate();
- 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]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement