Advertisement
Guest User

EntityCard

a guest
Mar 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.80 KB | None | 0 0
  1. package com.izako.HunterX.items.entities;
  2.  
  3. import net.minecraft.entity.EntityLivingBase;
  4. import net.minecraft.entity.monster.EntityBlaze;
  5. import net.minecraft.entity.projectile.EntityThrowable;
  6. import net.minecraft.util.DamageSource;
  7. import net.minecraft.util.EnumParticleTypes;
  8. import net.minecraft.util.datafix.DataFixer;
  9. import net.minecraft.util.math.RayTraceResult;
  10. import net.minecraft.world.World;
  11. import net.minecraftforge.fml.relauncher.Side;
  12. import net.minecraftforge.fml.relauncher.SideOnly;
  13.  
  14. public class EntityCard extends EntityThrowable {
  15.       public EntityCard(World worldIn)
  16.         {
  17.             super(worldIn);
  18.         }
  19.  
  20.         public EntityCard(World worldIn, EntityLivingBase throwerIn)
  21.         {
  22.             super(worldIn, throwerIn);
  23.         }
  24.  
  25.         public EntityCard(World worldIn, double x, double y, double z)
  26.         {
  27.             super(worldIn, x, y, z);
  28.         }
  29.  
  30.         public static void registerFixesCard(DataFixer fixer)
  31.         {
  32.             EntityThrowable.registerFixesThrowable(fixer, "Card");
  33.         }
  34.  
  35.         /**
  36.          * Handler for {@link World#setEntityState}
  37.          */
  38.         @SideOnly(Side.CLIENT)
  39.         public void handleStatusUpdate(byte id)
  40.         {
  41.             if (id == 3)
  42.             {
  43.                 for (int i = 0; i < 8; ++i)
  44.                 {
  45.                     this.world.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
  46.                 }
  47.             }
  48.         }
  49.  
  50.         /**
  51.          * Called when this EntityThrowable hits a block or entity.
  52.          */
  53.         protected void onImpact(RayTraceResult result)
  54.         {
  55.             if (result.entityHit != null)
  56.             {
  57.                 int i = 0;
  58.  
  59.             }
  60.  
  61.             if (!this.world.isRemote)
  62.             {
  63.                 this.world.setEntityState(this, (byte)3);
  64.                 this.setDead();
  65.             }
  66.         }
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement