mojira.dev
MC-41881

Hopper minecart acts like it is in a different position

What I expected to happen was...:
I expected a hopper minecart to pick up dropped items from the block above it, and only the block above it.

What actually happened was...:
It picked up items from one corner of the block above it (see picture attached), but it also picked up dropped items from corners of blocks around it as well.

From testing, it appears that the hopper minecart is centered at its current position + 0.5 in both x and z. This theory also supports the evidence that it doesn't pick up items from anywhere on the blocks, but instead just from the corners where the minecart is centered. (see pic cause I think I just confused you more)

Steps to Reproduce:
1. Place a hopper minecart on a rail
2. Place blocks above the minecart
3. Toss items on the blocks and it will reproduce the results above

Linked issues

Attachments

Comments 10

To be specific, the hopper minecart picks up items in a 1x1 square centered above its southeast corner. It should obviously pick up items in a 1x1 square centered above its center. This is a version of the classic off-by-1 programming error. My guess is that that hopper minecart's location is saved as its southeast corner's position and whoever coded this feature assumed that it was saved as its center. Showcased in this video: http://www.youtube.com/watch?v=U6BWv8b94RI

Easy to confirm by watching the video or just placing a hopper minecart under a block and throwing various items on top. Any items that don't land on the southeast quadrant of the block fail to be picked up. Presumably also affects snapshots, people have noted this bug ever since hopper minecarts were added so I don't think it would accidentally be fixed.

I can confirm this bug, I just discovered it by myself in 1.7.4.

Still affects 14w07a

It's actually an off-by-0.5 error. The middle of a block is whatever.5 x and whateverelse.5 z. And I always heard "fencepost error" as the name for an off-by-one error (because when counting fenceposts you count the start point as one instead of zero).

A comment on the "Hopper minecart" screenshot above: it shows in gray the area that the minecart will pick up items from, but I have not been able to get a minecart to pick up items from that wider area. I've only seen it pick up items from the red.

I've used boats, which don't stack, and so they don't have the distracting property of scooting around into clumps. To accommodate this, so that the minecart-hopper doesn't fill (and keeps picking things up), I do have it emptying into doublechests below.

All that to say, I've controlled for a few things, and I agree that it should pick things up from the black area, it does pick things up from the red area, but I don't think it ever really picks things up from the gray area.

Confirmed; still annoying me 14w31a

Still affects 1.8. Please update the affected versions.

zombachu

Erik Broes

Confirmed

hopper_minecart, item-entity, offset

Minecraft 1.6.4, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.3, Minecraft 1.7.4, ..., Minecraft 14w33b, Minecraft 14w33c, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 1.8.1

Minecraft 1.8.2-pre2

Retrieved