SHARE
TWEET

Magmablock properites

a guest Sep 8th, 2018 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn)
  3.     {
  4.         if (!entityIn.isImmuneToFire() && entityIn instanceof EntityLivingBase && !EnchantmentHelper.hasFrostWalkerEnchantment((EntityLivingBase)entityIn))
  5.         {
  6.             entityIn.attackEntityFrom(DamageSource.HOT_FLOOR, 1.0F);
  7.         }
  8.  
  9.         super.onEntityWalk(worldIn, pos, entityIn);
  10.     }
  11.  
  12.     public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
  13.     {
  14.         BlockPos blockpos = pos.up();
  15.         IBlockState iblockstate = worldIn.getBlockState(blockpos);
  16.  
  17.         if (iblockstate.getBlock() == Blocks.WATER || iblockstate.getBlock() == Blocks.FLOWING_WATER)
  18.         {
  19.             worldIn.setBlockToAir(blockpos);
  20.             worldIn.playSound((EntityPlayer)null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
  21.  
  22.             if (worldIn instanceof WorldServer)
  23.             {
  24.                 ((WorldServer)worldIn).spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.25D, (double)blockpos.getZ() + 0.5D, 8, 0.5D, 0.25D, 0.5D, 0.0D);
  25.             }
  26.         }
  27.     }
  28.  
  29.     public boolean canEntitySpawn(IBlockState state, Entity entityIn)
  30.     {
  31.         return entityIn.isImmuneToFire();
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top