jhuckaby / magic-sorting-system

A data pack for Minecraft 1.13, 1.14 and 1.15 (Java) for automatically sorting every item in the game.
39 stars 15 forks source link

Lost items. #1

Closed 314kojioyama closed 6 years ago

314kojioyama commented 6 years ago

items will vanish when teleported over hopper sometimes. the hopper will have room but the items just vanish. cant get it to reproduce consistently, but it seems to happen when 2 stacks of items are teleported at once. looks like the extras just get deleted instead of picked up by the hopper. was trying this with 5 stacks at once and it varies, sometimes it will grab 3/5 stacks, other times only 1/5. on minecraft 1.13.1 using the latest version of MSS.

jhuckaby commented 6 years ago

Ugh, I am so sorry that is happening to you. I tested the data pack for weeks before releasing, and never lost a single item, even when I was specifically trying to, in order to test overflow. For me the items simply overflowed and dropped onto the floor next to the hopper (when I deliberately dropped more than 5 stacks at once).

Could it be that you have more than one item frame in a loaded chunk with the same group item on display? MSS will randomize (load balance) between all the item frames with matching items within 8 chunks. You can test this out by teleporting yourself using the same command that MSS uses:

/teleport @p @e[limit=1,sort=random,type=minecraft:item_frame,nbt={Item:{id:"minecraft:cobblestone"}},distance=0..128]

This command will teleport you (the player) to a random item frame for the stone group (i.e. item frame displaying cobblestone). Replace this item name with whatever group item you are testing with and losing stuff. Repeat the command multiple times to see where you end up. Is it ever teleporting you somewhere you don't expect your items to end up?

It is very strange that your items are disappearing, because the MSS quite literally only performs a teleport command like the one above. It doesn't do anything else to your items.

I suppose it possible we are also dealing with an "entity overload" situation here, if your world happens to have a lot of entities loaded (i.e. farms with tons of animals, etc.). I think Minecraft enforces an entity limit, and will randomly delete items to save tick lag. Do you have a bunch of loaded entities in the area where you are trying to setup a storage system?

Other things to try include:

314kojioyama commented 6 years ago

I have the hoppers alternate in a grid like pattern on top of my double chests. the item frames are above the hoppers with glass all around them to keep items contained. would 36 item frames in a 18x9 area cause the entity overload when the item stacks teleport? would placing an air block over the item frame help? right now it is just a 1 block space for each item frame over the hopper. ill try to reshape the storage system to allow multiple hoppers with frames to reach the chests and see if it helps with the item spread/load. I will also test the command to make sure there isn't a hidden frame or something they are teleporting to instead.

jhuckaby commented 6 years ago

Oh wow, 36 item frames for one category? I have to admit, I've never tested that many before. Not even close. I suppose the game could be doing something wonky with so many frames. I will try to reproduce this in my creative testing world.

I do know that Minecraft acts weird when items are teleported, because the item frame takes up some space and so they tend to flop around until a hopper grabs them. The collision detection is definitely glitchy. It is also possible that your glass is causing the game to pop the items outside of it. I've seen items jump through solid blocks before. Maybe try removing the glass, or giving it some air blocks as you suggested.

314kojioyama commented 6 years ago

only one item frame per category. here is a before and after screenshot. the after works flawlessly. most I can figure is that the items were being launched into the abyss with no room to spread out in a small place. now they have access to 2 hoppers and 2 air blocks to teleport to next to each item frame. 2018-10-10_12 00 49 2018-10-10_13 18 18

jhuckaby commented 6 years ago

Ohhhh, very interesting indeed. I thought you meant 36 item frames of all the same type, but you just had 36 item frames crammed together, in alternating positions. I think this is definitely some kind of game teleportation bug. I've noticed that item entities behave very strangely when teleported to the same block as an item frame. They glitch all around until the hopper slurps them up.

I'll add a note to the documentation that explains this bug, and your workaround. Thanks so much for your work on this!

314kojioyama commented 6 years ago

not a problem. thankyou for this amazing datapack. only item sorting system that doesn't lag out my potato PC. this issue is closed and solved. thanks for the quick help figuring out what I was doing wrong.