Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.mtndewey.ninjamod.entity;
- 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.MovingObjectPosition;
- import net.minecraft.world.World;
- public class EntityNinjaStar extends EntityThrowable {
- public EntityNinjaStar(World par1World) {
- super(par1World);
- }
- public EntityNinjaStar(World par1World,
- EntityLivingBase par2EntityLivingBase) {
- super(par1World, par2EntityLivingBase);
- }
- public EntityNinjaStar(World par1World, double par2, double par4,
- double par6) {
- super(par1World, par2, par4, par6);
- }
- /**
- * Called when this EntityThrowable hits a block or entity.
- */
- protected void onImpact(MovingObjectPosition movObjPos) {
- if (movObjPos.entityHit != null) {
- float damage = 4;
- movObjPos.entityHit.attackEntityFrom(
- DamageSource.causeThrownDamage(this, this.getThrower()),
- damage);
- }
- {
- for (int i = 0; i < 8; ++i) {
- this.worldObj.spawnParticle(EnumParticleTypes.CRIT, this.posX, this.posY,
- this.posZ, 0.0D, 0.0D, 0.0D);
- }
- if (!this.worldObj.isRemote) {
- this.setDead();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement