[SPIGOT-333] Hopper logic is flawed and is breaking sorting machines Created: 31/Dec/14  Updated: 11/Dec/17  Resolved: 08/Mar/15

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: You-dont Neaddis Assignee: Thinkofname
Resolution: Fixed Votes: 18
Labels: 1.8, bug, hopper, sorting
Environment:

FragNet hosting service with 1.5GB of RAM running Spigot build git-Spigot-13716d9-0899683 (Minecraft 1.8 with 1.8-R0.1-Snapshot A.P.I.)


Plugin: N/A

 Description   

https://www.youtube.com/watch?v=KT8KPoF3jx0

We created a sorting machine design based on the one in the video above. It works in single player vanilla Minecraft and it works on the old CraftBukkit 1.7 version without plugins, but it does not work with Spigot's 1.8 builds without plugins.

The problem seems to be with hopper logic. In the setup shown in the video, which is the same setup used in the system we tried when we came across this bug, hoppers are connected sideways in a chain across the top level while another set of hoppers below those which are not connected to each other contain 21 stackable items. In vanilla Minecraft and in older CraftBukkit versions, items will pass through the top hopper chain and when the hopper below them contains at least one stack that the item can stack with (i.e. an item of the same type), the item will pass into the hopper below rather than into the next hopper in the chain. However, in Spigot, this only happens sometimes. We have yet to determine whether it depends on the location of the unit or the type of item, but certain items sort consistently with sound hopper logic while others consistently continue through the chain when they should drop out. We have yet to find any pattern as to those tendencies, but they are consistent with the position and item type for that unit of the sorting machine.



 Comments   
Comment by Phoenix616 [ 08/Mar/15 ]

@You-dont Neaddis Firstly, since you obviously haven't heard, CraftBukkit gets build alongside Spigot when you run the Buildtools because Spigot directly patches CraftBukkit instead of rewriting all of it's code.

Secondly, the optimizations you speak of break some Vanilla behavior. If you want Vanilla behavior and the benefit of the Bukkit API you can just use CraftBukkit even though it is obviously recommend by the Spigot team to use Spigot.

Finally, your comment doesn't make sense as I showed you that you can still use CraftBukkit which got mostly solely updated by ToD to 1.8, huge thanks to him for that!

Comment by Thinkofname [ 08/Mar/15 ]

Onoe of the hopper patches was removed in 1.8.3, hopefully this is fixed

Comment by You-dont Neaddis [ 21/Feb/15 ]

@Weiyuan Zhu This does look like the same bug to me; all the details mentioned in that posted report match the ones my server has been experiencing.

Comment by You-dont Neaddis [ 21/Feb/15 ]

@Phoenix616 Firstly, since you obviously haven't heard, CraftBukkit is dead. It was taken down by a D.M.C.A. notice that almost took Spigot with it. CraftBukkit does not and will not have a 1.8 version. Therefore, for the time being at least, it's use Spigot or go back to vanilla and render all of the custom plugins I myself have written useless on my own server.

Secondly, optimizations are not bad at all; in fact, Minecraft and the former server modding A.P.I. CraftBukkit could use a million of them. I've seen their code; it's unbelievably awful. However, when those optimizations break the game, they're no good. It would still be nice for them to have it as an option for, say, minigames servers that don't use hoppers in that specific way and would therefore be unaffected by its difference of logic, but as it stands right now, this is nothing short of a defect in Spigot that affects anyone and everyone who wants to make sorters or similarly complex hopper systems. Spigot is not its own game; it's a Minecraft modding system. Deviations from Minecraft vanilla mechanics not changed intentionally by a setting set by the server admin(s) and not caused by plugins (with some obvious exceptions, like bug fixes to vanilla mechanics) are Spigot bugs. As it stands now, I have still not seen a surefire way to even ensure vanilla mechanic compatibility for this issue; suggestions have been made, but each one seems to work for some, work imperfectly for others, and be completely ineffectual for the rest. In short, this bug breaks vanilla Minecraft mechanics out of the box and does not give us a sure way to fix it.

Finally, on a personal note, I would like you to note that your comment on my report of a bug is basically the equivalent of "This is how Spigot is and if you don't like it, go back to CraftBukkit." Not only can I not do that, as I mentioned in the first point, but I would like to say that that's also incredibly rude and I don't appreciate it one bit. A bug is a bug; don't take it personally. I'm not saying that Spigot is awful and terrible because of this one bug and all its developers are stupid; in fact, I've seen md_5's work and I think it's, if nothing else, much more intelligent design than either CraftBukkit or Minecraft could have ever come up with looking at their code and history. However, I felt it my duty to report this for me, the people who play on my server and others using Spigot, and to the developers to help them ensure that their product is as helpful and useful as possible. When I developed Bukkit plugins, I appreciated it when people reported bugs to me; I didn't try to brush it off saying 'you can just use something else'. I should hope all developers of anything would do the same.

Comment by Weiyuan Zhu [ 21/Feb/15 ]

https://hub.spigotmc.org/jira/browse/SPIGOT-525
same problem, but no response......

Comment by William Twentyman [ 21/Feb/15 ]

That's just it. For 1.8, you can NOT use CraftBukkit for vanilla behavior. It doesn't exist past 1.7.10.

Comment by Phoenix616 [ 21/Feb/15 ]

@REALDrummer Spigot offers out of the box optimization (which the hopper settings are) and it is not the goal to have everything behave exactly like in Vanilla. If you want Vanilla behavior without optimization you can use CraftBukkit as always.

Comment by indexc [ 21/Feb/15 ]

after reading http://www.spigotmc.org/wiki/spigot-configuration-spigot-yml/ our server tried thees setting and it worked fine

hopper-alt-ticking: false
ticks-per:
hopper-transfer: 8
hopper-check: 0
hopper-amount: 1

Comment by cz [ 21/Feb/15 ]

I've had the same experience as You-dont Neaddis. It seems adjusting the settings helps (I've tried many with varying levels of success), but it is not a permanent solution as unloading those chunks seems to bring the issue back upon return. After making a huge 100+ item sorter, it'd be nice if it worked reliably.

Comment by You-dont Neaddis [ 21/Feb/15 ]

Absolutely. No optimization that causes the system to deviate from vanilla should be enabled by default. Besides that, there is no comment in the config even telling you what the vanilla settings are. One commenter earlier gave what they thought were the default settings, but those settings did not the resolve my issues. I had to use different settings, and even those seem to have slowed down the sorter (though to be honest, I may be imagining that, but it certainly seems that way.)

Comment by William Twentyman [ 20/Feb/15 ]

I mostly got things working by choosing "vanilla" settings. I think the concern, for me, is that people coming from Bukkit are going to expect things to work like in vanilla, but move to Spigot for 1.8. While I totally understanding having optimizations, having ones that break things by default seems like an odd choice. If an initial install instead represented vanilla, with the option to optimize for certain efficiencies seems like a better choice. That way, people can choose to risk things breaking, rather than have them "broken" by "default".

Comment by MyPictures [ 20/Feb/15 ]

You will probably need to adjust the hopper ticks in the spigot config to be same as vanilla which will drop performance but should let that machine work as intended.

Comment by Johnny Mangos [ 20/Feb/15 ]

As a temporary (and actually I may just stick to this) way around the broken hoppers, which break filtering, I am using this plugin: http://dev.bukkit.org/bukkit-plugins/sortinghopper/

It works as intended for sorting items!

Comment by You-dont Neaddis [ 20/Feb/15 ]

Indeed. It seems there is no one sure-fire way to fix this on a given server. Some servers seem to work better with different settings and some servers don't seem to work at all. This is definitely an issue that needs to be resolved, especially for the sake of plugins that try to utilize hoppers in some way. Lots of hopper-based redstone contraptions, especially sorters, are easily broken by this flaw. It is not trivial.

Comment by Jumpin Carrot [ 20/Feb/15 ]

My plugin broken because of this!

Comment by Piotr Petrus [ 20/Feb/15 ]

md_5 thinkofdeath Can we ask for a comment if this is indeed trivial and has no priority to be fixed?

Comment by You-dont Neaddis [ 16/Feb/15 ]

Some fixes seem to work for some people while others had to tweak other things to make it work. Also, it may just be my imagination, but my setup seems imperfect; it seems to have no issues per se, but hoppers seem to transfer items slower. That may just be my imagination.

In any case, various fixes do different things for different servers, but all around, hoppers clearly have some issues. If we could get SOMEONE from Spigot here, that would be great. This is NOT resolved.

Comment by Johnny Mangos [ 16/Feb/15 ]

I am also having this issue. It looks to me that every other hopper when chained together is broken. I haven't tired the fixes listed here yet, however I will be soon!

Comment by You-dont Neaddis [ 27/Jan/15 ]

I agree; fixes for this seem to vary and none seem perfect. To any moderators reading this: this bug is UNRESOLVED! Please fix this!

Comment by Chadrick [ 27/Jan/15 ]

that fix did not seem to fix my hoppers either not sure whats going on or why its nto being patched but no hoppers = most redstone devices not working

Comment by Phoenix616 [ 13/Jan/15 ]

Could be that they started the counts from 1 rather then 0 in the 1.8 builds so 8 is now 7.

Normally 8 always was like vanilla behavior and should be the default.

Comment by You-dont Neaddis [ 03/Jan/15 ]

@Piotr Petrus Actually, for me, the default settings were the same as that except that `hopper-alt-ticking` was set to `false`.

@val59000 Thank you very much for your comment. Those settings did not fix the issue immediately, but you pointed me in the right direction. I messed with it and finally fixed it using the same settings, but with values of 7 for `hopper-transfer` and `hopper-check` rather than 8, i.e.
```
hopper-alt-ticking: true
ticks-per:
hopper-transfer: 7
hopper-check: 7
hopper-amount: 1
```
I don't understand why Spigot doesn't use these setting by default if other settings mess up hopper logic. I don't care if it's slightly optimized; it's broken.
Anyway, thank you for your comment. I would still advise Spigot to make these setting the default or fix their optimized logic.

Comment by val59000 [ 03/Jan/15 ]

Maybe you have a plugin that affects hoppers. I don't have any difference with vanilla behavior since I changed my config to theses options.

Comment by Piotr Petrus [ 03/Jan/15 ]

@val59000 That’s default settings. Also, it goes:

    hopper-alt-ticking: true
    ticks-per:
      hopper-transfer: 8
      hopper-check: 8
    hopper-amount: 1
Comment by val59000 [ 03/Jan/15 ]

Spigot changes the behavior of hoppers ticks and thus, breaks a lot of redstone delay-based machines.
To make hoppers works like in Vanilla but still saving ressources when they are idle, I recommend you to use this config in spigot.yml :

hopper-alt-ticking: true
ticks-per:
hopper-transfer: 8
hopper-check: 8
hopper-amount: 1

And you'll be fine with your item sorter

Comment by William Twentyman [ 01/Jan/15 ]

I'm using an updated sorter that has the same problem. It appears that only about half the "filter" hoppers get a chance to suck down their items before the hopper above pushes the item sideways again. I rename sticks to "Sort Stick" to block the last 4 slots of the hopper, and feed items in. The result is every other hopper isn't filled. This also appears to affect behavior of hoppers pulling items out of minecart chests on rails.

Comment by You-dont Neaddis [ 31/Dec/14 ]

I have also found through experimentation that the position of the unit relative to the beginning of the sorting system's hopper chain is irrelevant. For example, the second unit from the chest that you put the items to be sorted in will not always be wrong if you copy and paste this design in different places. We have yet to determine whether or not the type of item matters.

Comment by SpigotMC [ 31/Dec/14 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 1 version(s) behind. CraftBukkit is 0 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Mon Dec 15 03:27:25 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.