Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Mod.EventBusSubscriber
- public class StrangleGrass extends BushBlock
- {
- public StrangleGrass(Properties properties) {
- super(properties);
- }
- @Override
- @Deprecated
- public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entity) {
- entity.attackEntityFrom(StrangeDamage.STRANGLEGRASS, 1.0F);
- }
- @SubscribeEvent
- public void strangleDeath(LivingDeathEvent death, World worldIn, BlockState state, BlockPos pos, Random random) {
- if (death.getSource() instanceof StrangeDamage) {
- BlockPos blockpos = pos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
- if(worldIn.getBlockState(blockpos) == Blocks.AIR.getDefaultState()) {
- worldIn.setBlockState(blockpos, OccultBlocks.deepgrass.getDefaultState());
- Occult.LOGGER.info("GrassMurder");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement