How to make liquid could cause damage to the entity

Started by Avak on Fri, 08/04/2017 - 14:15

Topic category: Help with MCreator software

Last seen on 20:00, 11. Aug 2017
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make liquid could cause damage to the entity
Fri, 08/04/2017 - 14:15

How to make liquid could cause damage to the entity

Last seen on 19:28, 24. May 2019
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Good idea
Fri, 08/04/2017 - 20:56

Good idea

Last seen on 19:28, 24. May 2019
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
mess around you might find a
Fri, 08/04/2017 - 20:57

mess around you might find a way to do it

Last seen on 23:21, 14. Apr 2019
Joined Jul 2015
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
put this in your liquid code.
Fri, 08/04/2017 - 23:02

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.

 

Last seen on 20:00, 11. Aug 2017
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make liquid generation
Sat, 08/05/2017 - 08:01

How to make liquid generation in world

Last seen on 20:00, 11. Aug 2017
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
KBEHAN please edit this code
Sat, 08/05/2017 - 08:40

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) { }   }
Last seen on 20:00, 11. Aug 2017
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:put this in your liquid code.
Sat, 08/05/2017 - 08:42

@#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) { }   }