Started by
TheObserver
on
Topic category: Help with MCreator software
I wanted to make a block that after 10 seconds, breaks the block above it (as long as it can be broken in survival mode) and puts the item in a free slot. I can't seem to figure out how to make it collect the block it breaks above it.
On every tick, check if your hopper block's inventory isn't full.
Then, check if there's an item entity on top of the block. Get the item from the item entity (a block in the item procedures tab), and add it to your block's inventory in a free slot (This could be done with a for() loop, if you know how to do them). Despawn the item entity.
And how would you know if the customized block has a full inventory?
To make sure it doesn't have a full inventory, you would have to do a get number of items from slot procedure and if it is 64, then make it do nothing. I would recommend having the items go into your "hopper" in a timed order. by checking how many items and what type of item is in the first slot, if there are any items that aren't the item being put into the hopper or there is a full slot, make the hopper take the item that it is trying to suck in and put that item in the second slot instead of the first. so on, so fourth. You would probably also want the block to be directional just like a hopper by having the hopper be an item you hold and when you click on a block it runs a procedure to determine what direction of the hopper to place down. this means having 2 different orientations of the block in block form but put none of those in creative tabs and don't give them a recipe either because it's based on the item not the block. the reason why two and not 5 is because you can have the block be directional and that gets rid of 4 of the directions then all you have to do is make the one that faces down. (sorry for the long response. trying to be as detailed as possible to help out!)
my mcreator plugin contains procedural blocks that can help.