How would I make a block that's like a hopper

Started by TheObserver on Wed, 08/12/2020 - 20:57

Topic category: Help with MCreator software

Last seen on 21:39, 20. Sep 2021
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How would I make a block that's like a hopper
Wed, 08/12/2020 - 20:57

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.

Last seen on 16:48, 17. Dec 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
On every tick, check if your…
Fri, 08/14/2020 - 11:31

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.

Last seen on 18:14, 12. Sep 2021
Joined Sep 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
And how would you know if…
Sat, 10/24/2020 - 14:04

And how would you know if the customized block has a full inventory?

Last seen on 16:25, 20. Sep 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
To make sure it doesn't have…
Wed, 09/08/2021 - 19:49

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!)