Advertisement
Guest User

Untitled

a guest
Aug 9th, 2015
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package com.halestormxv.entity;
  2.  
  3. import net.minecraft.entity.Entity;
  4. import net.minecraft.entity.EntityLivingBase;
  5. import net.minecraft.entity.projectile.EntityThrowable;
  6. import net.minecraft.util.MovingObjectPosition;
  7. import net.minecraft.world.World;
  8.  
  9. public class EntityGrenade extends EntityThrowable{
  10.  
  11.     public EntityGrenade(World p_i1776_1_) {
  12.         super(p_i1776_1_);
  13.         // TODO Auto-generated constructor stub
  14.     }
  15.    
  16.     public EntityGrenade(World world, EntityLivingBase entity){
  17.         super(world, entity);
  18.     }
  19.    
  20.     @Override
  21.     protected void onImpact(MovingObjectPosition var1) {
  22.         for(int i = 0; i < 10; i++){
  23.             this.worldObj.spawnParticle("portal", this.posX, this.posY, this.posZ, 0.9F, 0.9F, 0.9F);
  24.         }
  25.        
  26.         if(!this.worldObj.isRemote){
  27.             this.setDead();
  28.             if(!this.worldObj.isRemote){
  29.                 this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, 4.5F, true); //4.5F is explosion Strength
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement