diff --git a/src/main/java/com/fi0x/deepmagic/blocks/BlockFluid.java b/src/main/java/com/fi0x/deepmagic/blocks/BlockFluid.java index ffddd422..beb37c5f 100644 --- a/src/main/java/com/fi0x/deepmagic/blocks/BlockFluid.java +++ b/src/main/java/com/fi0x/deepmagic/blocks/BlockFluid.java @@ -4,8 +4,14 @@ import com.fi0x.deepmagic.init.ModItems; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.MobEffects; import net.minecraft.item.ItemBlock; +import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumBlockRenderType; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; @@ -30,4 +36,14 @@ public EnumBlockRenderType getRenderType(@Nonnull IBlockState state) { return EnumBlockRenderType.MODEL; } + + @Override + public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) + { + if(entityIn instanceof EntityLivingBase) + { + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 30*20, 0, false, true)); + ((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.SPEED, 30*20, 0, false, true)); + } + } }