put this in your liquid code. Press Edit Source code or View source. Something along those lines.
find:@Override public IIcon getIcon(int side, int meta) { IIcon result = stillIcon; if (side == 1) { result = flowingIcon; } return result; }
then put this:
@Override public void onEntityCollidedWithBlock( World world, int x, int y, int z, Entity entity ) { if (entity instanceof EntityLivingBase) { ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 1)); } }
this gives anything that goes in the liquid regen. but you can put wither to cause damage or poisen or whatever.
Good idea
mess around you might find a way to do it
put this in your liquid code. Press Edit Source code or View source. Something along those lines.
find:@Override
public IIcon getIcon(int side, int meta) {
IIcon result = stillIcon;
if (side == 1) {
result = flowingIcon;
}
return result;
}
then put this:
@Override
public void onEntityCollidedWithBlock( World world, int x, int y, int z, Entity entity ) {
if (entity instanceof EntityLivingBase) {
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 1));
}
}
this gives anything that goes in the liquid regen. but you can put wither to cause damage or poisen or whatever.
How to make liquid generation in world
KBEHAN please edit this code
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.client.model.ModelLoader; import net.minecraft.world.World; import net.minecraft.util.ResourceLocation; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemBucket; import net.minecraft.item.Item; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.block.state.IBlockState; import net.minecraft.block.material.Material; import java.util.Random; public class mcreator_acid { public static Object instance; static { FluidRegistry.enableUniversalBucket(); } public mcreator_acid() { } public static BlockFluidClassic block = null; public static ItemBucket item = null; public void preInit(FMLPreInitializationEvent event) { ResourceLocation still = new ResourceLocation("blocks/acid"); ResourceLocation flowing = new ResourceLocation("blocks/acidflow"); Fluid fluid = new Fluid("acid", still, flowing).setLuminosity(0).setDensity(1000).setViscosity(1000).setGaseous(false); FluidRegistry.registerFluid(fluid); FluidRegistry.addBucketForFluid(fluid); block = new BlockFluidClassic(fluid, Material.WATER); block.setUnlocalizedName("acid"); block.setRegistryName("fluid." + block.getFluid().getName()); GameRegistry.registerBlock(block); if (event.getSide() == Side.CLIENT) { Item item = Item.getItemFromBlock(block); ModelBakery.registerItemVariants(item); final ModelResourceLocation loc = new ModelResourceLocation("TestEnvironmentMod:acid", "acid"); ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { return loc; } }); ModelLoader.setCustomStateMapper(block, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return loc; } }); } } public void load(FMLInitializationEvent event) { } public void generateNether(World world, Random random, int chunkX, int chunkZ) { } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { } public int addFuel(ItemStack fuel) { return 0; } public void registerRenderers() { } public void serverLoad(FMLServerStartingEvent event) { } }@#3
KBEHAN please edit this code
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.client.model.ModelLoader; import net.minecraft.world.World; import net.minecraft.util.ResourceLocation; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemBucket; import net.minecraft.item.Item; import net.minecraft.client.renderer.block.statemap.StateMapperBase; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.block.state.IBlockState; import net.minecraft.block.material.Material; import java.util.Random; public class mcreator_acid { public static Object instance; static { FluidRegistry.enableUniversalBucket(); } public mcreator_acid() { } public static BlockFluidClassic block = null; public static ItemBucket item = null; public void preInit(FMLPreInitializationEvent event) { ResourceLocation still = new ResourceLocation("blocks/acid"); ResourceLocation flowing = new ResourceLocation("blocks/acidflow"); Fluid fluid = new Fluid("acid", still, flowing).setLuminosity(0).setDensity(1000).setViscosity(1000).setGaseous(false); FluidRegistry.registerFluid(fluid); FluidRegistry.addBucketForFluid(fluid); block = new BlockFluidClassic(fluid, Material.WATER); block.setUnlocalizedName("acid"); block.setRegistryName("fluid." + block.getFluid().getName()); GameRegistry.registerBlock(block); if (event.getSide() == Side.CLIENT) { Item item = Item.getItemFromBlock(block); ModelBakery.registerItemVariants(item); final ModelResourceLocation loc = new ModelResourceLocation("TestEnvironmentMod:acid", "acid"); ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() { @Override public ModelResourceLocation getModelLocation(ItemStack stack) { return loc; } }); ModelLoader.setCustomStateMapper(block, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return loc; } }); } } public void load(FMLInitializationEvent event) { } public void generateNether(World world, Random random, int chunkX, int chunkZ) { } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { } public int addFuel(ItemStack fuel) { return 0; } public void registerRenderers() { } public void serverLoad(FMLServerStartingEvent event) { } }