How to create mushroom in mcreator?

Started by Hakann on

Topic category: Advanced modding

Last seen on 16:20, 17. Mar 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to create mushroom in mcreator?
Sat, 03/17/2018 - 10:37 (edited)

How to create mushroom (new plant) with code in mcreator (not big mushrom)? 

 

Edited by Hakann on Sat, 03/17/2018 - 10:37
Please stop using text…
Wed, 03/14/2018 - 17:52

Please stop using text formatting without purpose. It is meant to be used for highlighting important words, not the entire text.

 

You can create the plant using the plant option in the new mod dialog.

Last seen on 16:20, 17. Mar 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can not create mushroom…
Thu, 03/15/2018 - 15:11

You can not create mushroom with using option in the new mod dialog!

You can create mushroom only using code!!!

Please write the code of this.

Last seen on 13:32, 28. Aug 2021
Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What kind of mushroom are…
Thu, 03/15/2018 - 17:08

What kind of mushroom are you talking about? If you want a mushroom like minecraft vanilla one you choose the plant option and put in the texture. A mushroom is not a special element it is simply a plant.

You can make plants behave…
Thu, 03/15/2018 - 17:51

You can make plants behave mushroom like using the provided events with conditions.

Last seen on 16:20, 17. Mar 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please write the code of…
Fri, 03/16/2018 - 11:50

Please write the code of provided event 

Last seen on 16:20, 17. Mar 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please edit this code …
Sat, 03/17/2018 - 10:36

Please edit this code 

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;

import net.minecraft.world.gen.feature.WorldGenFlowers;
import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.NonNullList;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.Minecraft;
import net.minecraft.block.state.IBlockState;
import net.minecraft.block.SoundType;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.Block;

import java.util.Random;

public class mcreator_greenmushroom {

    public mcreator_greenmushroom() {
    }

    public static Block block;

    public static Object instance;

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
        block = (Block) (new BlockCustomFlower()).setHardness(0.01F).setResistance(2.0F).setLightLevel(0.0F).setUnlocalizedName("greenmushroom");
        block.setRegistryName("greenmushroom");
        ForgeRegistries.BLOCKS.register(block);
        ForgeRegistries.ITEMS.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
    }

    public void registerRenderers() {
    }

    public void load(FMLInitializationEvent event) {
        if (event.getSide() == Side.CLIENT) {
            Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
                    .register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("testenvironmentmod:greenmushroom", "inventory"));
        }
    }

    public void generateSurface(World world, java.util.Random randomGenerator, int chunkX, int chunkZ) {
        for (int i = 0; i < 20; i++) {
            int l6 = chunkX + randomGenerator.nextInt(16) + 8;
            int i11 = randomGenerator.nextInt(128);
            int l14 = chunkZ + randomGenerator.nextInt(16) + 8;
            (new WorldGenFlowers(((BlockFlower) mcreator_greenmushroom.block), BlockFlower.EnumFlowerType.DANDELION)).generate(world,
                    randomGenerator, new BlockPos(l6, i11, l14));
        }
    }

    public static class BlockCustomFlower extends BlockFlower {

        public BlockCustomFlower() {
            super();
            setSoundType(SoundType.GROUND);

            this.setCreativeTab(CreativeTabs.DECORATIONS);
        }

        @Override
        public BlockFlower.EnumFlowerColor getBlockType() {
            return BlockFlower.EnumFlowerColor.YELLOW;
        }

        @SideOnly(Side.CLIENT)
        @SuppressWarnings("unchecked")
        @Override
        public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
            for (BlockFlower.EnumFlowerType blockflower$enumflowertype : BlockFlower.EnumFlowerType.getTypes(this.getBlockType())) {
                list.add(new ItemStack(this, 1, blockflower$enumflowertype.getMeta()));
            }
        }

        @Override
        public int quantityDropped(Random par1Random) {
            return 1;
        }

        @Override
        public Item getItemDropped(IBlockState state, Random rand, int fortune) {
            return Item.getItemFromBlock(block);
        }
    }
}

Last seen on 16:20, 17. Mar 2018
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
no they should be placed on…
Sat, 03/17/2018 - 11:06

no they should be placed on a tree on a stone and under a certain light (like conventional mushrooms)