A block that acts as a hopper

Started by Barcat0 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A block that acts as a hopper

I'm working on a tycoon-like mod that uses a collector to collect items from a conveyor belt, but I currently have to use a hopper to get items into it. How would I make the collector itself actually collect the items like a hopper? 

I've been stumped googling that I've decided to resort to the forums.

Can anyone help?

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try finding item entities…
Fri, 07/07/2023 - 15:33

Try finding item entities that are above the block, and putting them into the block's inventory if there are any. Then check if there is a container directly below the block, and deposit items there.

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But how would I actually go…
Fri, 07/07/2023 - 16:04

But how would I actually go about grabbing whatever item is above it as well as putting it in its inventory?

 

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, update: I got something…
Sat, 07/08/2023 - 17:51

So, update: I got something working after many failed attempts, however, it's now replacing the item in there and adding one.

 

For instance:
 

there is 20 cobblestone in it's slot. 1 piece of coal is collected, and the total is now 21 coal. AKA it's replacing the first slot, no matter if it's already taken up, and replacing it with it;s own and adding +1 to it...

 I don't know how to fix it without breaking it.

Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Got it fixed, eventually...  
Sat, 07/08/2023 - 20:23

Got it fixed, eventually...

 

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How did you do it Barcat0?…
Fri, 09/08/2023 - 10:17

How did you do it Barcat0? If you don't mind me asking, I would love to know.