Advertisement
Guest User

Untitled

a guest
Oct 26th, 2015
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1. package com.mtndewey.ninjamod.entity;
  2.  
  3. import net.minecraft.entity.EntityLivingBase;
  4. import net.minecraft.entity.projectile.EntityThrowable;
  5. import net.minecraft.util.DamageSource;
  6. import net.minecraft.util.EnumParticleTypes;
  7. import net.minecraft.util.MovingObjectPosition;
  8. import net.minecraft.world.World;
  9.  
  10. public class EntityNinjaStar extends EntityThrowable {
  11.     public EntityNinjaStar(World par1World) {
  12.         super(par1World);
  13.     }
  14.  
  15.     public EntityNinjaStar(World par1World,
  16.             EntityLivingBase par2EntityLivingBase) {
  17.         super(par1World, par2EntityLivingBase);
  18.     }
  19.  
  20.     public EntityNinjaStar(World par1World, double par2, double par4,
  21.             double par6) {
  22.         super(par1World, par2, par4, par6);
  23.     }
  24.  
  25.     /**
  26.      * Called when this EntityThrowable hits a block or entity.
  27.      */
  28.     protected void onImpact(MovingObjectPosition movObjPos) {
  29.         if (movObjPos.entityHit != null) {
  30.  
  31.             float damage = 4;
  32.             movObjPos.entityHit.attackEntityFrom(
  33.                     DamageSource.causeThrownDamage(this, this.getThrower()),
  34.                     damage);
  35.         }
  36.         {
  37.             for (int i = 0; i < 8; ++i) {
  38.                 this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX, this.posY,
  39.                         this.posZ, 0.0D, 0.0D, 0.0D);
  40.             }
  41.             if (!this.worldObj.isRemote) {
  42.                 this.setDead();
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement