Minecraft – Item sorter with multiple items per tick

minecraft-java-editionminecraft-modsminecraft-redstone

General Info
I'm playing on a server where they modified the hoppers to pass 8 items per tick instead of 1.

The system I want to build
I'm working on a casino game. User tosses 1 item into a hopper. This activates the casino making the user win or lose.

The problem
An item sorter is required to prevent the user from tossing in different items. Whether this is a hopper that only allowes 1 type of item to enter or 1 that filters out different item types does not matter.

The problem is the hoppers passing 8 items per tick. Say there are 18 stacked items inside a hopper. 1 is tossed in, activating the redstone signal. Instead of that 1 item passing through to the next hopper, 8 are passed through at once, leaving only 11 stacked items into the "sorter hopper". So now the next player would have to toss in 8 items instead of 1 in order for it to activate the redstone signal again.

Is there some way I can solve this issue?

Some extra info that might be usefull
The game doesn't require an item sorter to work. Without redstone, a single item gets passed through the hoppers just fine. I just need to prevent players from tossing in other items than the one required. So any solution to that end is perfect.

What I've tried myself
I've tried the classic item sorter method passing "wrong" items on to a different hopper and I've tried the "1 item type only" method where the input hopper only accepts that item type. Both resulted in the same issue.

Best Answer

This is the circuit I had in mind:

circuit

It's actually pretty simple: Put one comparator on the hopper before your standard sorting system and one on the hopper after it. Then you combine them with an AND gate where one side is delayed and one side is inverted.

The idea: An item that goes through the hopper before the sorting system (which are all items that go through the system) activate the first comparator and with a delay deactivates the first redstone torch, the redstone next to it and activates the second redstone torch and the lamp. But when an item also goes through the hopper after the sorting system (which is everything except soul sand in my example), then it activates the second comparator and keeps the redstone line active, thereby keeping the second redstone torch and the lamp inactive. The timing is set up so that the first redstone lamp toggling and the repeater on the second comparator activating happen at almost the same time. There is one game tick delay because of hopper speed, but the redstone torch luckily ignores one tick off pulses.
This means that only soul sand going through the system will activate the lamp, which is exactly what you wanted. What happens inside the sorting system doesn't matter for this circuit, as long as it takes all soul sand items and nothing else.

Of course you also have to make sure that your sorter doesn't lose its only soul sand item, for that you just need to put 8 of the to be sorted item into the first slot instead of one:

sorter

This circuit relies on the speed of hopper lines. I assume your modded hoppers just process batches of 8 and aren't actually faster in sending items through hopper lines. If they are, you have to adjust the repeaters on the first comparator accordingly.

This circuit can also be put on the same side as the sorting circuit, for that you just need to replace the first piece of redstone dust after the second comparator with another repeater and increase the delay in the first comparator by one more tick. I didn't do it in the screenshot to make the circuit clearer.