Blocks that can have Blocks/Items placed in/on them, let me explain.

Started by KingBugz on

Topic category: Help with modding (Java Edition)

Last seen on 05:06, 6. Jul 2023
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Blocks that can have Blocks/Items placed in/on them, let me explain.

Okay so pretty much I am wondering how you can make a block that when right clicked on with another block or item it places that block/item on it. like if I have a jar that when you use a cookie on it you now see the cookie in it. Or the best example I can give, Bibliocraft's display blocks, where you can place your tools/weapons in them and see them, but click on the item and take just that item out and no longer see it in the block.

Last seen on 00:30, 24. Aug 2023
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This would be hard to do…
Tue, 09/24/2019 - 22:48

This would be hard to do with any item, but if you have a small handful of items it works with, then it should be fine.

First, you make a model of the empty container. Then, you make a bunch of other models of the container each filled with a different item you want to work with the container.

Now, go into MCreator and make each model for the container into its own unique block (the "Duplicate" function on the sidebar will come in handy here).

Next, make a procedure that detects the "item in entity's main hand" to be an item that you want to be able to put in the container; if true, then place the respective filled version of the container at the block's x y z. Make this procedure activate when the block is right-clicked.

Example: An empty jar. If the "item in entity's main hand" is a cookie, then "place block at x y z" the filled cookie jar. Make sure to remove the item from the player's hand.

Last seen on 05:06, 6. Jul 2023
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the reply,…
Wed, 09/25/2019 - 00:47

Thank you for the reply, unfortunately the issue im having is being able the click on the block with say 2 items "placed" in it and only getting the item you click on, And not the other.

This would be possible with…
Thu, 09/26/2019 - 22:06

This would be possible with custom models however the floating mechanics where the items rotate would not be possible due to how Mojangs items and blocks coexist.

However you can make a custom 3d model using cubik studio or any other modeler of your chose, I personally like Cubik for making models it's easy to learn and make models quickly however block bench and MrCrayfishes model creator are both free if you don't have the coin to buy Cubik Studio.

When you make your jar you will want to have a mesh inside of the part that people a pane would do fine, resize the texture down to the meshes scale for then make sure to UV map the texture.

After you have your desired look for any item in the jar you can just update the texture for the item on the inside to look like what you want to display in the jar.

To display different models you can update the block state by right-clicking on the item to remove or add the new block and consume or give the item back depending on what block its displaying.

Next week I will be doing an introduction video for my channel on block states I and eventually working up to more complex projects, this could be a future video, once I get through some 1.14 stuff.

Other than that I can't think of any way to place an item in the block without it despawning or glitching out because of how it generally works with items in blocks.