Get block in inventory of block

Published by thebebist on Fri, 06/29/2018 - 11:25
Status
Works as designed
Product/platform
Not applicable
Priority
Normal
Issue description

i was trying to make a block placer but i noticed that the get item in inventory of block dont have the abillity to check for blocks in inventory, so can you make a little change to that prosedure so it can check for blocks in inventory to.

Issue comments

You can check for the block in inventory. Use block/item comparator block and use get the block in player's inventory.

but then it dosent work for all blocks in the game if it worked as i suggested above it would work for blocks from other mods to

and also i cant make the place block prosedure use the get item from inventory prosedure to make it place that block 

I'm pretty sure you misunderstood what this player meant, especially given how you mentioned the "player's inventory" when the question is about a block's inventory, not the player's. I tried to do essentially the same thing just now. I've created a Block Placer block that has a single input slot where the user can insert any item or block. Then what I want to do is take that inputted block from the Block Placer and place that inputted block in front of the Block Placer in the world. I'm not checking for a specific item or block; I want to be able to place whatever block is inputted into the Block Placer, and if it is an item (not a block) then I would spawn a gem for it. The problem is, the only way to get the block out of slot 0 of the inventory of the Block Placer is using the following procedure:

[View Image of the Procedure]

As you can see from the icons in the top right of that procedure in the image above, it is not possible to put this procedure within the "Place block at x y z" procedure. That's because the item from slot 0 could be a block OR an item, and it is not possible to "place" an item down as a block. I can only spawn a gem for the item, but what I want to do is place the item (if the item is a block). Is there a way to convert the item obtained from the above procedure into a block (if it is a block) and then place it? I am NOT referring to "checking for a specific block" or "how to spawn a gem". For example, if I insert one Cobblestone into the Block Placer then the Block Placer should place a Cobblestone block at x + 1, y, z. If I instead insert a non-block item such as a sword, it will spawn a gem for it. I know how to check if the item is a block or not, but I do not know how to place that specific item if it turns out to be a block. I have already viewed all of the tutorials and gone through many forum posts, and this problem is not addressed anywhere. Please let us know if doing this is possible, and if it is possible, show us how to do it or link to a specific video or webpage that explains how to do this. Thanks. I apologize for bringing this subject up again after nearly two years (it is possible that this issue is outdated given it is 2 years old but there are still no answers to be found anywhere in sight).



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.