Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. @Mod.EventBusSubscriber
  2. public class StrangleGrass extends BushBlock
  3. {
  4.  
  5. public StrangleGrass(Properties properties) {
  6. super(properties);
  7.  
  8. }
  9.  
  10. @Override
  11. @Deprecated
  12. public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entity) {
  13. entity.attackEntityFrom(StrangeDamage.STRANGLEGRASS, 1.0F);
  14.  
  15. }
  16.  
  17. @SubscribeEvent
  18. public void strangleDeath(LivingDeathEvent death, World worldIn, BlockState state, BlockPos pos, Random random) {
  19. if (death.getSource() instanceof StrangeDamage) {
  20. BlockPos blockpos = pos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
  21. if(worldIn.getBlockState(blockpos) == Blocks.AIR.getDefaultState()) {
  22. worldIn.setBlockState(blockpos, OccultBlocks.deepgrass.getDefaultState());
  23. Occult.LOGGER.info("GrassMurder");
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement