3D model with inventory

Published by Mr_dsa1 on Sun, 11/04/2018 - 12:51
Won't fix
Issue description

I recently faced the problem of creating a 3D model (block) with inventory.
I create a block, export the mod, everything is fine, but only when I turn on the inventory I get out an error and in the error says that my block can not have an inventory. How to make your custom block has its inventory ?

P.s Sorry for bad English. 

Screen - https://www.screencast.com/t/pg0PXp6S

Grandle log:

F:\Install\MCreator\MCreator173\forge\build\sources\java\mod\mcreator\mcreator_bedsideTable.java:194: error: method createNewTileEntity(World,int) is already defined in class BlockBedsideTable
        public TileEntity createNewTileEntity(World var1, int var2) {
F:\Install\MCreator\MCreator173\forge\build\sources\java\mod\mcreator\mcreator_bedsideTable.java:342: error: class TileEntityCustom is already defined in class mcreator_bedsideTable
    public static class TileEntityCustom extends TileEntity implements IInventory {
F:\Install\MCreator\MCreator173\forge\build\sources\java\mod\mcreator\mcreator_bedsideTable.java:114: error: cannot find symbol
                for (int i1 = 0; i1 < tilecustom.getSizeInventory(); ++i1) {
  symbol:   method getSizeInventory()
  location: variable tilecustom of type TileEntityCustom
F:\Install\MCreator\MCreator173\forge\build\sources\java\mod\mcreator\mcreator_bedsideTable.java:115: error: cannot find symbol
                    ItemStack itemstack = tilecustom.getStackInSlot(i1);
  symbol:   method getStackInSlot(int)
  location: variable tilecustom of type TileEntityCustom
F:\Install\MCreator\MCreator173\forge\build\sources\java\mod\mcreator\mcreator_bedsideTable.java:159: error: incompatible types: TileEntityCustom cannot be converted to IInventory
                return Container.calcRedstoneFromInventory((TileEntityCustom) tileentity);
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
5 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Attachment Size
This is my workspace28.17 KB 28.17 KB

Issue comments

MCreator 1.7.3 is very old and has some bugs that most likely won't be fixed for Minecraft 1.7.10. Consider using a newer version of MCreator.

For this case, it could be if you have gravity enabled on your block. You can attach the workspace file and I will see if I can help.

You can attach the workspace to this ticket. But first, try disabling gravity as this should fix this bug. In 1.7.10, you can't make blocks with containers that have gravity.

Sorry I was wrong, gravity is off

And i attached my workspace to the ticket. 

Ok I have checked the code and I can confirm MCreator 1.7.3 does not support custom 3D models with inventory. You can use one or another only unfortunately and as this version will not get any support more, there is not much that can be done, unfortunately.

Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.