mojira.dev
MC-14826

Leads in unloaded chunks break, become invisible or connect to an invisible target far away

Since I was given the ticket to this issue, I decided to make some changes to make this report a bit more informative. For full information, see MC-96024. I'm just going to sum it up shortly in this report.

The bug

If you connect any animals to a lead, then place the lead on a fence, then go far away from them (Until they become unloaded), then go back, there is going to be most of the times one of these issues occurring:

  1. The lead will simply break and drop as an item on the ground.

  2. The lead will become invisible, sometimes unloading and reloading will fix this issue, sometimes not. If this occurrence happens, the client will think the animal isn't actually leashed, and you can right click it to leash it, however due to this being only client side, you cannot place the lead on a fence.

  3. The leads will glitch out and connect to an invisible target far away (See pictures). Following the lead for a bit of time will fix this, or, in some cases, make occurrence #1 happen.

I have yet to find a way to, using command blocks, leash the animals back. I'm not exactly sure how the leashing part works technically. It seems like there are two tags for every mob that are related to leads, but all they do is place a lead on the specified location, not connect the animal to it.

Code analysis

Code analysis by @unknown can be found in this comment.

Related issues

MC-25318 leads not visible after exiting the nether MC-25498 When a chunk containing a lead is unloaded, the lead breaks. MC-26324 Horses Unleash Themselves MC-115328 Parrots break leash when loading chunk MC-115330 Leads don't show up MC-117179 Leash graphic glitch MC-117606 Lead bug MC-119550 Beug lead for animals MC-134157 Leads disappearing when you go too far MC-136500 hello i have find a Bug in the game MC-138613 cats escape when on a lead and fence. MC-139301 Texture Glitch (Accidentally put 18w45a) MC-142245 Leads on llamas break/despawn upon reopening game. MC-142889 Leash gets invisible after chunk / world reload MC-143199 The lead tied to the fence display is wrong MC-144483 Lead connected to an entity & fence goes invisible when player goes far away. MC-145371 Leads disappear when loging out and back in MC-145599 Lead completely glitched out when strapping a mob to a pole MC-146999 When you quit the game then rejoin it the leads disappear MC-150767 Leads acting weird MC 1.14 MC-150852 Lead graphic does not render correctly MC-152179 Leads Visually Disappear MC-152206 traveling trader lead not connected MC-152254 traveling trader leads go invisible MC-154619 Lead that was attached llama to fence disappears MC-155005 Invisible leads MC-155908 The Invisible Lead MC-157071 Lead texture disappear MC-157219 Invisible leads MC-157476 When loading or reloading into existing world leads dissappear from fence post and mob entity. MC-158230 Leads tying animals to fence disappear MC-158282 Leaded foxes leads disappear when they sleep. MC-158678 When I log back into my world all of the leads on fence posts disappear MC-160505 Horse rope disappears MC-113782 Lead glitch MC-14304 Leashes on fenceposts are invisible when re-logging MC-14765 Horses brake leads MC-15585 Lead disconnecting MC-15628 Randomly Disappearing Leads MC-15901 Leads become Invisible when Reloading world MC-16088 leads on amimals may appear to despawn MC-16266 Invisible Lead / Leash after restarting Launcher MC-16766 Lead vanishes "after a while" or if you are to far away ( can'T tell what cause it exactly ) MC-16892 leads break off mobs you are holding when you exit minecraft MC-19588 Leads that are hanging Mobs are glitchy and do not appear on fences in SMP MC-19925 Leads breaks when loading the world MC-20032 Leads becoming invisible, and attached fence post must be broken to collect invisible lead. MC-20189 Horses don't actually exist after closing and reopening minecraft MC-20484 Leads keep breaking for no reason. MC-21608 Leads do not function and break when loaded MC-22060 Horse appears unattatched to leash. MC-22495 Leads disappear when you go and come back from the dimension MC-22982 Leaving a survival world and when you come back, the leads tied to your mobs sometimes dissapear. MC-22986 Invisible lead MC-23394 Leads Disappearing After A Short Time Offline A Server. MC-23748 Horses disconnects from leads MC-23951 horses come off leads MC-25261 lead bug MC-26556 The horses are unleashed when we close and re-open the world or server. MC-26620 If I hook a animal to a fence pole. Using a lead, than I die the lead will then be in lnvisible but still there.These makes it hard to tell if it is hooked up or not, please fix. MC-26685 Leads Disappearing When Mobs are Tied Up MC-26838 Leads break themselves after awhile MC-27013 Ropes keep breaking when you return to a horse or donkey that's been tied to a post. MC-27020 Ropes randomly will come off of a horse or donkey and drop when they are tied up for long periods of time or when they get stuck when being led on horseback or on foot. MC-27302 Leads break after a while MC-28027 Iron Golem Rope Multiplayer Invisible MC-28155 Leads on fences disapear when you go to far away MC-28197 Lead breaks when reloading chunks MC-29045 Invisible leads MC-30631 Lashes on the ground instead of on fence MC-32795 Invisible leads MC-33533 Leads despawn if chunks despawn MC-38748 Leads not staying attached to pole MC-38823 Leashes break on chunk load MC-41355 dissappearing leads MC-44756 The lead doesn't work. MC-44920 Horses detach from lead when chunk un-loads MC-45623 Leads Breaking MC-45681 Leads Disconnect on Restart MC-47173 Invisible leads MC-47235 Leads going invisible MC-48520 Leads disappearing/glitchy/bugged MC-50164 Leads Breaking MC-51433 Lead Falls To Ground When Chuck Is Unloaded MC-51505 leads not shown on fence MC-52560 Lead becomes disconnected from horses after period of time MC-54233 Leashes of the leashed mobs are gone after several hours MC-54785 Leashes Failing to break when reloading world MC-59679 Lead/leash breaks. MC-59809 Leashes break when the chunk is unloaded MC-60732 Leads won't keep hold of mobs when chunks are reloaded MC-61285 lead's in use are invisible on world start. MC-62404 animal lead bug MC-64428 When Chunk Unloads Leads release Animals MC-65397 bug lead MC-65489 Broken Leads MC-66419 Leads Break randomly when leaving chunks MC-68659 Lasso not holding Horse to fence post MC-69193 leads dissapear MC-70260 Lead pops off fence MC-70282 Leads on animals tied to fence posts break after unloading a chunk MC-72950 Structures below ground level don't render at certain angles MC-72953 Horse coming off lead? MC-74656 Lead removes from fence post MC-76477 The leads of invisible horses connected to fences will dissapear when reloading game. MC-76636 Leads Despawn if you leave. MC-79786 Leads on cat/dogs thats attached to fence post breaks away when player goes away MC-81712 Invisible lead on tied up horse in SMP MC-85284 When you lead a mob, then restart the world, the mob will break the lead MC-86535 Horse/lead bug MC-95312 When Iput a lead on a horse and tie it to a fence and go out of the chunk and back the lead dissapears but the horse is still attached MC-96024 Leads in unloaded chunks break, become invisible or connect to an invisible target far away MC-96919 In the Minecraft 1.9 snapshots, leads tied around fence posts and animals, sometimes glitch out, causing them to stretched towards, coordinates 0 0 0. MC-98937 Horse attached to nothing MC-99944 Go too far, horse lead detach from fence MC-100464 Leads Disappear in 1.9 MC-101755 Lead glich when leaveing the chunck MC-102230 Leads become invisible after entering the nether MC-102497 When A Chunk De-Renders And Re-renders With Leads, They De-Render MC-103102 Horse & Donkey Lead Glitch in 1.9.4 MC-106482 disapeering leads MC-108892 Visual Bug with Leads MC-111160 Leads break constanty in multiplayer servers. MC-160548 Lead becomes invisible! MC-161335 Multiple bugs involving leads/leashes and dropped item visibility MC-161694 When mobs attach to fences with leads, the leads disappear MC-162625 Disappearing leads when going to the nether MC-162900 Disappearing and breaking lead ropes MC-163199 Leads connecting mobs and fences disapear MC-163711 Leads disappearing MC-163907 leash doesnt appear when the llamas are leashed to the wandering trader when it spawns MC-164422 leads attached to mobs deleted on save and exit MC-165050 Leads not showing after logging out and logging back in .

Attachments

Comments

migrated
[media][media][media][media][media][media]
kumasasa

Cannot reproduce.

Tails

Unable to reproduce.

Anon Ymus

I saw this in one of VintageBeef's recent episodes as well.

Maarten Thijs

It still happens. just look at bdoubleOs latest episode in 13w19a http://www.youtube.com/watch?v=h-0J61KbLns

SullyTheUnusual

This is happening on my server when it is rebooted, running 13w19a.

kumasasa

Reopened.

kumasasa

Confirmed.

Platypus

Also affects 13w23a.

kumasasa

In the screenshot all horses are attached but only the two saddled ones show the lead

Maarten Thijs

still in 25c!

I hope they fix this before the official release next week

Jean Baptiste

Still in 1.6 pre-release

Chase

Confirmed in multi-player. Pre-release 1.6 (downloaded yesterday). When the server restarted ALL leads were broken and laying on the floor.

Ezekiel

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Bran Harvey-Chadwick

it seems that if a baby horse is on a lead for to long they start taking damage and die?

Anon Ymus

You might be seeing MC-13632.

Miriam Maier

this bug is extremely annoying. have the same problem. sometimes the lead is just invisible, sometimes it lays on the ground and the animals walk freely around. sometimes this happens when i go far away and leave the chunk and come back. sometimes it happens when i rejoin the smp. you have to play a little longer, because sometimes it just works as it should. i dont know what exactly trigger this bug, but it happens on my smp way too often. and this is on release 1.6.1

Eleanor Scott

bug is still present in 1.6.2

Roxane

got the bug in 1.6.2 too. However I didn't recognize it in 1.6.1, but that might be by luck.

Keith Manfredi

I saw this on the SMP server I administrate after restarting the server app in both 1.6.1 and 1.6.2. (Win7 based server)

A gamer on the server has also seen this happen in 1.6.2

AvatarAcid

It is certainly in 1.6.2. We have a scheduled reboot daily, and are now considering not doing the reboot. 25% of everyone's horses go missing each time.

Roobix

This is currently happening to me also. The leads in my instance are not invisible but can be found lying on the ground around the posts after traveling away from the chunk in question and then returning to it. Oddly, it does not happen in ALL instances, only sometimes.

Eric Faith

This happens to me, except they don't act like they are on a lead. I will tie up my horse, donkey, and mule, leave for a while, return and the leads are gone and the 3 mobs are freely walking around.

Rene Schindler

I did some testing today. My Horse was standing in chunk A while the fence was in chunk B. Because chunk A was loaded before chunk B, the lead drops itself on the floor.
Current fix -> Try to leave horse and fence in the same chunk.... I hope, that it will work for a while.

Edit: Nope, my fix doesn't work

macks2008

Based on the above comments, there seems to be at least two different (but closely related) bugs that are being confused. One with leashes breaking inexplicably (mob drops a lead item and is able to wander; leash no longer appears to be on the mob; seems to happen whenever the server (minecraft's internal server or the smp server, whatever is doing the non-graphics processing.) is restarted), and one with leashes and their knots disappearing (selection box included) but the mobs still acting like they are leashed, which seems to happen when the client is restarted (again, it can be SSP or SMP).
The bug's are probably the same oversight (occurring when the leash is unloaded on either the server or client), but appearing to be different do to the differences in what the two do.

Eric Faith

Okay now they are disappearing when I am right next to them. I tied up my horse, donkey, and mule, did some smelting/crafting/buildings, and despite being less than 35 blocks away from them the entire time, the leads broke. However, this time they dropped as items, although they still broke for an unknown reason.

Eric Faith

My god this is so annoying. A few days ago I had 12 leads, now I am down to 3, because they keep breaking and then the items despawn. Can they fix this in 1.7, or maybe like 1.6.3???

Aust G

I have the same problem when I go to the nether and back. nothing else, just the nether. In survival.

BoxFigs

It seems as if the lead is only visually gone; the mob acts as if it is still attached (tested with a tamed horse).
However, if you punch the fence, it destroys the fence instead. The lead drops, but after a small delay.

Josh Parker

This is an annoying problem. I can't ride my horse anymore because, even though I removed the fence, it stands still.

Jls

The problem is not just a visual one. There may be two bugs here:
1. The leads disappear from the fence post to the mob when I log out and then back in to my server, but
2. The leads actually break and appear on the ground as an item when I leave the area and come back (perhaps on chunk reload?).

This is extremely annoying as it has cost me several mobs. Furthermore, I can't rely on just bringing fence and leads when I go exploring. I have to encase my horse in walls because I just can't rely on the to leads keep my horse there.

Dan Keller

I can verify this - just encountered it the other day. Had a horse leashed to a post in a desert village. Did some errands, came back to hear my horse running into a cactus (that was out of reach of his leashed limit). I went to the spot where it was and the lead was nowhere to be seen and my horse completely un-tethered. (Not a case of an invisible lead!)

ArmEagle

I've seen issue two myself once. I'm not sure whether I had gone to the nether, a long way away, or just logged in/out.

Could this be a similar issue to mobs escaping from fences MC-2025? Say the horse and fence are in two different chunks and the horse is at the maximum range of the leash when the chunk unloads.

  • The chunk with the horse loads.

  • The horse starts moving.

  • The chunk with the fence loads, leash is connected up to the horse. (The horse moves again and code detects the) leash is too long, leash breaks. Sometimes this will not drop a leash at all (a chance based thing?).

This could also happen with the horse and fence in the same chunk, if the leash is loaded later.

Sinxar

Confirming it is easily able to be reproduced most of the time by going far enough away for the chunk to unload. Note that this for the lead actually breaking, not the invisible lead problem. I am unsure as to why the breaking problem is being closed as duplicates.

Been getting this since 1.6.1. I thought it was a SMP issue but it have been happening extremely often in my current SSP world as well (1.6.2).

SullyTheUnusual

Confirmed, still a problem on my server running 1.6.2. Everyone has to build stables for their horses, or the leads break and they wander away.

Talven81

@Joey F - They are being closed as duplicates because they are duplicates of this ticket. 1000 "Hey the leads don't work" doesn't help us, only one ticket with appropriate information is necessary.

@ArmEagle - I doubt this is anything related to mobs escaping fences. If anything it would be closer related to an old bug (pre-JIRA) where minecarts would derail if they moved into an unloaded chunk. I SUSPECT that when the leashed mob's chunk is loaded but the fencepost is not, that the leash determines it's not connected to anything instead of waiting for the chunk to load before checking.

ItsMartin

Confirmed for 13w37a in SMP. Three horses next to each other all dropped their leashes when restarting the server.

Joshua Mack

Confirmed in 13w37a. When leaving the chunk, leads either are invisible until the fence is broken or leads are not there at all and the horses are walking around.

Ethan Wilson

I will confirm if this behavior is still present in 13w38c later today.

MisterSanderson

Still present in 1.7.2.

Sid Ben

This is happening to me a lot in 1.7.2. The leads DO NOT become invisible, they BREAK. Most of the time I find the items lying on the ground. However looks like the cause is the same, since it doesn't happen in loaded chunks.

I agree with Talven81 assumption.

8j0KVEUciir2

Experiencing this issue as well with 1.7.2. Oddly enough, the lead that did break somehow not only broke, it simply vanished. It cannot have despawned, breaking should have caused it to fall into a system of water that I have leading into a hopper > chest and the lead simply did not end up in the chest. ie, somehow it simply vanished. Regardless, given the circumstances, I am inclined as well to suspect it being related to the (slow) loading of the chunk and the fence post(s) this lead was connected to.

Kelven Lee

This is happening to me and my friend as well.

For me, the lead broke and was completely gone. It did not even spawn as items. For my friend, the leash only became invisible. However, we were both in the same server (I was running the server) and our house were only a few blocks away from each other.

This is becoming annoying since the horse ran to our wheat farms, chicken farms, cow farms and so forth farms and then I have to hunt for the horse and make a new lead again.

8j0KVEUciir2

It is not just leads that show this kind of behaviour; if I use a water / hopper containment for an egg farm instead of using leads, similar phenomena occur when reloading the chunk. Specifically, chickens will start falling through the hopper top and end up inside of it. Any eggs they lay subsequently are no longer caught by the hopper and simply fall to the side (if there is room).

A reasonably straightforward I can think of would be to simply ensure that the loading of (passive) animals/mobs occurs after everything else has been loaded. To ensure that any leads they are attached to, any trap they are contained in and so forth actually is present whenever they are in fact loaded.

Karsten Gabriel

I'm pretty sure that I found the source of the problem (and a solution) of vanishing leads.
It is related to the reading and writing of the NBT tag of the (leashed) entities.

When the entity is read from the NBT tag, the leash is not read directly, but the corresponding tag compound is first stored in a temporary variable (in MCP it's called field_110170_bx). Once the entity has its first update, this temporary variable is then used to attach the entity to another entity or to a leash knot, and the temporary variable is set to null.

The problem occurs when the entity is again written to an NBT tag before it had its first update, because it is not yet attached to something. But the writing method assumes that the lead has already been initialized, and therefore, no further information about the lead is stored. The next time, the entity is read from the tag, we have the information that it is leashed, but the information of where it is attached to has gone.

So, the problem can be solved by additionally checking on writing to the NBT tag, if the temporary tag compound variable for the leash (field_110170_bx) is not null. If this is the case, then the lead was not yet initialized, and it is necessary to store again the tag compound. I tried this and it worked.

Karsten Gabriel

I have to add, as already pointed out in earlier comments, there are actually two different bugs - one, where the leashes disappear completely, and one, where they disappear only visually. Both bugs have the same reason, but the solution that I suggested in my previous post only helps with the first one.

The second bug, where the leash is invisible, but the entities behave leashed, happens when the client does not know about the leash because it did not receive a corresponding packet from the server. This is because the server does not send a packet, if the tag for the leash was not yet read (i.e. the information is still only in the temporary variable field_110170_bx in the class EntityLiving).

This problem can be solved by sending a package at the end of the method that reads the leash tag, which is called func_110165_bF in class EntityLiving in MCP, analogously to the package that is sent when a leash is created in func_110162_b.
With this modification and the suggested modification in my previous comment, I could not observe any disappearing leashes.

Hawk J

2 months and no word. Is this going to be fixed? It happens all the time to me and makes leads pretty much useless as they can't be relied upon.

SullyTheUnusual

Still broken as of 14w05a.

Trace Ordonez

Word of advice, never leave your animals on a lead, only use it to "lead" your animals to their pens/stables/enclosed areas. Won't be fixed anytime soon(over a year now). Deal with it in the meantime with my advice.

Itouch2

Confirmed for 14w11b

Jonathan Neufeld

I regularly encounter both issues: invisible lead and breaking lead (breaking much more often). Both problems occur when the chunk is unloaded and reloaded again. Still a problem as of 1.7.9.

Itouch2

Confirmed for 14w21b.

a

I just discovered this in 1.7.9
Leads are nice for traveling, but if they keep breaking on fence posts then 50% of its functionality is wasted. Seems pretty high priority to me.

Tim Gunderson

Confirmed for 14w25b.

macks2008

perhaps the current implementation should just be scrapped and redone. Or maybe they're waiting until the rest of Minecraft works better for this sort of thing? Still, if this is not working, what is the point of having this part of the lead's functionality? It's a bunch of false security for your animal farm. Take it out until it works and leave people to use fenceposts like we did before this item came out.

Hawk J

What is so hard about fixing this? My horse keeps wandering off when I go caving and I have to craft new leads all the time.

Eric Faith

Normally before, like I said, the leads would randomly break and be on the ground. I would tie up my animals, walk off, return, and the animals would be roaming freely and the leads would be items on the ground.

Around 10 minutes ago, I went to ride my horse and, just like this problem states, the horse acted like it was on a lead although the lead didn't seem to be present. I found out it was invisible, and in order to get the lead back I had to destroy the fence post it was on. So I've experienced both variants of this lead disappearance glitch, and both are annoying.

Jonathan Blanton

Hawk: Until the issue is fixed, you can simply keep your horses in a fenced-in pen. You can jump a horse over a fencepost when you're riding, but a riderless horse can't jump a fencepost. This isn't a fix, of course, but at least you can stop losing leads.

Simon Wohlfart

confirmed for 14w28b, affects all animals not only horses

Hawk J

I attached a 30s video showing an instance where a lead is invisible upon game start and doesn't even pop off when the fence it is tied to is destroyed.

After exiting and starting the game again, the lead appeared again (in mid-air where the fence once stood) and popped off into item form after a few seconds.

Kahless

They did remove the rabbit teleporting in MC-64395.

Tobias

I'm playing 1.8 pre-release 1 and the leads break on my horses when I travel far away. I have to fence them in. All the leads drop to the ground and no animals are missing.
I used to be able to rely on leads keeping animals in place when I was far away but now I need to obtain much more wood to create large enough pen for all the animals.
I like to keep horses and donkeys outside pens for easy access since I use them for traveling.

Not sure if it's related but animals that usually teleport to you, such as wolves and cats, are unable to keep up because the chunks behind you are unloaded and the animals aren't teleported out as a clean-up measure. Any animals following a player that are supposed to teleport to the player should be teleported before the chunk is unloaded. The animals also tend to get stuck in water very easily and won't teleport while in the water if you walk too far away. Animals that are stuck at path finding get the same issue. It probably has something to do with the threaded AI not restoring to teleportation fast enough.
Chunks scheduled for unloading should be checked for animals in follow-mode and make sure that the AI thread teleports them as a cleanup measure. The AI isn't very good at water and dense forests, which is something that I can live with as long as the intended teleportation works the way it should. I often have to run back to make sure that the animal is able to catch up. Walking slow doesn't help, since they easily get stuck in leaves or ponds.

Kahless

@Tobias, the mobs swimming slow is covered by MC-48616 and seems to predate the threaded AI. There might be other tickets open regarding your teleportation concerns. Remember to vote on issues.

Anomie X

> Not sure if it's related but animals that usually teleport to you, such as wolves and cats,
> are unable to keep up

Teleporting being broken in 1.8-pre1 is MC-55661.

Niknokinater

Same here. I leave for maybe a day (a forest or two away) and I come back and my leaded Horse is walking around and the lead (in item form) is floating on the ground, waiting for pickup.
EDIT: Forgot to mention; I am currently using 1.8 -Pre1.

Tokes

I'm getting this every 3 minutes. Why? Because I have a command block teleporter to get between my two bases (about half a km apart). Every time I return to my village the lead has broken.

Ray Yates

Using 1.8 pre-3 This seems to be related to chunks unloading and reloading. Simply walking away or flying away and returning will cause the lead to disconnect and eventually de-spawn.

kumasasa

@@unknown

This seems to be related to chunks unloading and reloading.

Therefore the summary of this ticket is

Lead break / disappear on game restart or chunk reload

Jacek Konieczny (do not use)

affects the final 1.8 too

Alex Ford

I get this same issue. Tying leads to posts for more then a minute is useless. I suspect the chunk loading causes the mob to temporarily "fall" more than 10 blocks from the lead triggering it to break. If you remember back when there were missing chunk bugs you'd often catch mobs "bouncing" up and down in the missing space. They keep falling and resetting their position until the blocks load. My guess is that's what happens and snaps the lead.

Kahless

That's a very good theory. I tested in a creative world, by tying a horse to a fence at 0,0 and then teleporting it various distances away from the fence
/tp @e[type=EntityHorse,r=15] 0 ~ 9
/tp @e[type=EntityHorse,r=15] 0 ~ 10

With the prior command, the horse bounces back towards the fence, and then walks towards the fence.
With the latter command, the horse breaks free and walks towards the fence. A lead item appears 10 block away from the fence. The fence still has a knot until I reload the chunk (e.g. exit and rejoin the game).

Perhaps the falling entities don't bounce back towards the fence (like a mob hanging from a fence, which just bounces and accumulates fall damage)

BoxFigs

It could be the leads themselves. They're loaded before the blocks are, like all other entities. In the split second before the blocks are loaded, the game thinks that the lead knot isn't attached to a fence, so it breaks the lead.

What could determine which explanation, this or the mobs falling, is correct, would be to see how long it takes the chunk containing the leashed mob to load. If the time is not enough for a mob to fall 10 blocks, then the lead itself is the problem.

If the mob falling is the cause, then this could be fixed by slowing the falling speed of all mobs when the chunks aren't fully loaded yet, like players (if that's possible to do with mobs).

If the lead is the cause, then something similar can be done: have the check for if the lead is attached to a fence wait until the chunk has finished loading (again, if that's possible).

firebird7

Also in 1.8.3.
Fencing-in my horses now. 😞

Cadsuane Melaidhrin

Still present 1.8.8.

Ampflower

It appears it is fixed in the latest snapshot, 15w31b.

Can't seem to break the lead without hands and arrows, so it must have been fixed.

Ezekiel

Resolved as fixed. If someone can reproduce it in the snapshots, please say so

Anon Ymus

Supposedly this still exists in 15w33c, according to MC-86535.

kieran heilner

I said that THIS bug HAS been fixed in the snapshot. The bug I requested a fix for has gone unnoticed by the Mods since 1.6 and is STILL not fixed in the snapshot because they have been getting confused between the bug that I and countless other people have reported and this one so the posts related to mine have been incorrectly marked as duplicates of this bug. Please confirm my report.

Paulquappe

kieran heilner is right. this bug here is about a lead which disappears visibly, but is still "there". his bugreport is about a lead which disconnects from horse and fence after reload chunk or restart. if last one can be reproduced in a new snapshot i guess it has another cause than the bug here and therefore is NOT A DUPLICATE of this.

kumasasa

@@unknown and @unknown: Please confirm what I've understood from you:
In this ticket are two different issues mixed up:

  • that leads are still connected to fence post and horse but visually invisible (fixed)

  • that leads break, the item form is floating on the ground and the horse is running around (not fixed)

Tokes

I'm trying to reproduce this bug (either one) and couldn't do it at first (after 10 or so tries with different things). After giving up and going about my game I just respawned near one and the first version of the bug (visual-only) is happening. The lead is visible, but trying to point to some point in the ground and wavering back and forth rapidly in a glitchy way. The horse IS still prevented from leaving the area by the lead. It looks like the lead is changing angles 20 times a second, maybe a max difference in angles of about 15 degrees.

Paulquappe

i cannot confirm for the snapshots for version 1.9 (though i didn't played them yet), but the latest 1.8-version. leads clearly aren't connected to the horses and lying on the ground when i "get home". and this is clearly another bug than the one fixed. maybe it has the same cause and therefore could be fixed now, but, as i said, i cannot confirm for the snapshots as i haven't played them. maybe i can in a few days, but maybe someone else is quicker than me 🙂

to be clear, @unknown : yes, you understood right. though the fixed/not fixed cannot be said (by me).

[Mod] redstonehelper

Apparently this ticket is actually two bugs. If you're still experiencing any of them, please create a new ticket and leave a comment with the ticket number here.

Spake Miner

Still experiencing it. MC-96024

Spake Miner

I seriously hope this will get more attention. It says it's fixed, but it's actually not and no one bothers to do something about it.

[Mod] redstonehelper

Is any part of MC-14826 that is not covered in MC-96024 still an issue?

Spake Miner

What's not covered in MC-96024 that is here?

[Mod] redstonehelper

Fine, reopening this ticket, resolving MC-96024 to this ticket and making you the reporter of this ticket.

Spake Miner

Thanks.

John Peaden

This happens to me constantly on my 1.8.9 server. Anything I tie up (horses, cows, sheep) breaks the lead and just gets away before I even notice most of the time. I remember this vaguely being an issue on 1.7, but it's gotten a lot worse now. Back then I generally only had the issue with the lead turning invisible, now they always break. Leads are pretty much useless for me.

This, combined with MC-2025, means that I cannot store animals or mobs in any fashion. They die or escape within a few hours of gameplay.

Spake Miner

Hey, just asking @Grum; Does "Far Future Version - 1.10" mean it's going to be fixed but probably not in the very soon snapshots or does it literally mean it's going to be fixed in 1.10?

[Mod] redstonehelper

If they're doing it the same as with "Far Future version - 1.9?" during the 1.8 snapshots, it just means "not now".

Spake Miner

Not now, as in not in the current version of the snapshots, or just not the soon snapshots?

[Mod] redstonehelper

"Most likely not in any snapshot before the next major release."

Spake Miner

Well that's just great. I'm gonna have to wait another year until this high priority bug is fixed.

md_5

Not quite the same bug, but it appears that at least on 1.9-pre4 if you travel far away from the entity then come back, the leash will be invisible and require a relog to be seen.

Spake Miner

It is the same bug. See occurrence #2.

John Peaden

Still problematic in 1.9 single player, nothing will stay tied up. The lead always breaks.

user-f2760

1.9 is already listed, and outdates

Yannic Mödritscher

Occurring 3 is still present in 1.9.4 (Leads connect to an invisible target far away after reentering chunks)
Two more accurate facts to occurring 3:
The lead will always visually connect to x=0,z=0 but it has no physical effect.
And the Entity only needs to be unloaded for the client while it can still be loaded through the spawn chunks.

TH3_MAD_KING

Still present in 1.10. Is this ever going to get resolved? It's over 3 years old now...

T Sawick

Confirming - still a problem in 1.10.2 .

seema

can confirm 1.10.2

user-f2760

Was already marked as affected...

Dylan

Confirmed in 16w32a

Dylan

Confirmed in 16w32b

Dylan

Confirmed in 16w33a

Dylan

Confirmed in 16w35a

Dylan

Confirmed in 16w36a

Dylan

Confirmed in 16w38a

Dylan

Confirmed in 16w39a

Dylan

Confirmed in 16w39b

Dylan

Confirmed in 16w39c

Dylan

Confirmed in 16w40a

Dylan

Confirmed in 16w41a

Dylan

Confirmed in 16w42a

Dylan

Confirmed in 16w43a

Dylan

Confirmed in major release 1.11

Catherine

Can vouch for it still occurring in 1.11.2; I have had this happen to me twice when trying to lead a llama caravan home and have had to tie one to a fence and make bridges/paths for everyone to follow on.

Agar Io

Happens to me too (1.11.2)

Chris Ellerby

It's been 4-5 years, any chance this bug can get addressed? Leads have always had a lot of problem, and if we are going to keep them in the game we might as well fix them.

Lead lines from a mob to a fence post will vanish, leaving only the wrapped lead around the post, and occasionally both will vanish. Eventually the lead will not just be invisible, but gone all together resulting in the mob wandering off. In that case the lead will pop off and remain on the ground as an item until it de-spawns. This is easily produced by tethering a horse to a fence post, flying a few chunks away and back.

Aaron Eichhorst

Issue is still present in 17w06a.

Josef Johansson

Definitely still occuring in 1.11.2. They might as well remove the ability to tie a lead to to a fence, as it will anger a lot of players that they break or disappear. Honestly one of the most critical bugs in this version. along with duplication bugs.

Plagiatus

just noticed this bug in pre-7. though the leashed entities are in the spawnchunks, after I died it looked like this

Hawk J

> Didn't play Minecraft for 2 years.
> Come back and see this bug still isn't fixed.
> "Status: Postponed"
> "Fix version: 15w31b"

:|

EP1CxEMAN08

I can confirm the in 1.12, sometimes the lead becomes invisible

Ray Yates

I just tested the leads in the Windows 10 version. While rendering of the leads is not perfect. They did not disconnect from the post and animal, disappear, or despawn. After an hour of playing, the leads remained. Respectfully, perhaps the code from that version could be compared to the Java version.

Niknokinater

Confirmed for Minecraft Java 1.12.2- all three possible variants (invisible, breaking, and stretching afar)

lord.quadrato

Confirmed for 1.13-pre2

lord.quadrato

Confirmed for 1.13-pre3

Kevin Gagnon

Found out how to fix this in vanilla code I think. Encountered the bug reliably with my own entity using forge, upon debugging I tracked it down and tested a fix, works consistently for me. Heres my notes based on MCP mappings:

 

So vanilla behavior works like this:

  1. Actively leashed entity EntityLiving.leashedToEntity is written to nbt with tag "Leash" when chunk unloads.

  2. On chunk reload, the nbt data is loaded into a temporary variable called EntityLiving.leashNBTTag

  3. The next time the entity ticks, it detects EntityLiving.leashNBTTag has data and attempts to re-establish the leash link and set EntityLiving.leashedToEntity

An important note here is that EntityLiving.leashNBTTag is not written to disk, it only writes to the "Leash" nbt tag if EntityLiving.leashedToEntity is not null.

So heres the real bug: There is an edge case where the entity can load and then instantly unload before it has a chance to tick, causing the data loaded into EntityLiving.leashNBTTag, but then never properly used to set EntityLiving.leashedToEntity, since EntityLiving.leashNBTTag is not serialized, the leashed data is now lost forever, breaking the leash link.

Heres the fix: In EntityLiving.writeEntityToNBT, at the end of the "if (this.leashedToEntity != null) {" if statement, add an else clause:

} else if (leashNBTTag != null) {
 compound.setTag("Leash", leashNBTTag);
}

 

 

This makes sure the leashNBTTag data is preseved if it wasnt able to get made use of.

 

Note I only confirmed this fix with my own entity that reproduces it a lot, did this test fix in vanilla code and confirmed it fixes it, tested with my entity leashed to a fence post only, not to another entity eg the player, which probably doesn't have the bug since theyre always chunkloaded.

Also note, you will still get visibly broken leash links on the client side, but server side the link is still there.

Samuel Voltz

The glitch still works in 1.13 proper.  I've only gotten result #2 in my expirience so far.

Kraif

Confirmed for 1.13.1.

Xcom6000

There are two bugs related to leashes. One is regarding invisible leads and one have to do with the leashes breaking. Kevin Gagnon suggestion for the fix certainly does the job but I would suggest to not fix the bug in the simpler way as suggested by Kevin and go for a more interesting approach that will have deeper mechanics for those that seek it out.

 

Invisible leashes bug.

When walking further then 80 blocks from mobs that are attached with leashes and walking back the leashes become invisible. This is because leashes are part of EntityTracker and have a hardcoded range of 80 blocks as all animals have a range of 80.

else if (entityIn instanceof IAnimals)
{
    this.addEntityToTracker(entityIn, 80, 3, true);
}else if (entityIn instanceof EntityHanging)
{
    this.addEntityToTracker(entityIn, 160, Integer.MAX_VALUE, false);
}

The issue comes from the fact that leashes are sent to the client after the entity first become entity processing. The packets that link entities with there respective leashes are sent to players in EntityLiving.java by the following code.

 

 

public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
 {
 this.isLeashed = true;
 this.leashedToEntity = entityIn;
 
 if (!this.world.isRemote && sendAttachNotification && this.world instanceof WorldServer)
 {
 ((WorldServer)this.world).getEntityTracker().sendToAllTrackingEntity(this, new SPacketEntityAttach(this, this.leashedToEntity));
 }
if (this.isRiding())
 {
 this.dismountRidingEntity();
 }
 }

 

Its clear that the leash packets are sent to only players within range. This means that any player that is further then 80 blocks from the entity never receive the packets and assume the mobs don't have a leash. This makes all mobs lose there leashes unless players can somehow teleporting to the mobs directly via commands or logging in next to them. The same issue is that the leashes are removed on the client if the player have a higher render distance and simply walk further then 80 blocks to stop seeing the mob and walks back.

 

The fix was done with aid from Pokechu22. There is a code in EntityTrackerEntry.java that re-updates players in case a player gets in range in public void updatePlayerEntity(EntityPlayerMP playerMP).

By placing the following line of code in the updatePlayerEntity somewhere in the large if statement the bug of invisible leashes fixes itself. The leashes simply re-update as the player gets close enough again to the animals.

 

if(this.trackedEntity instanceof EntityLiving){
 playerMP.connection.sendPacket(new SPacketEntityAttach(this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity() ) );
 }

 

Breaking leashes

 

The second bug regarding the breaking leashes comes from what Kevin Gagnon explains. The NBT of entities never save to disk as the entity needs to become entity processing at least for 1 gametick to reload the leash in the following code found in EntityLiving.java recreateLeash(). The leash is simply recreated and the leash can be saved to disk again. If the leash never becomes updated the leash isn't saved breaking it the next time the chunk is reloaded. This happens if the mob is loaded into lazy chunks and never update.

As an alternative fix I suggest that the recreateLeash() code is run directly after the entity is placed into the world after loading the chunk. This can be done by having the recreateLeash() run in the spawn entity into world. This will ensure that entities that are loaded get there leashes reattached instantly without problems as there leashes otherwise wont be attached until they update at least ones. This solves the breaking of leash bug and ensure the mob doesn't need to become loaded to become attached with its leash. It is a safer way to fix the bug as it guaranties that the mob never is detached from its leash at any given time that can cause issues in rare instances.

 
Just as a suggestion. Add the one "entityIn.postLoad();" line in onEntityAdded in WorldServer.java

 

protected void onEntityAdded(Entity entityIn)
 {
 super.onEntityAdded(entityIn);
 this.entitiesById.addKey(entityIn.getEntityId(), entityIn);
 this.entitiesByUuid.put(entityIn.getUniqueID(), entityIn);
 Entity[] aentity = entityIn.getParts();
 entityIn.postLoad(); // <-- Add this line
if (aentity != null)
 {
 for (Entity entity : aentity)
 {
 this.entitiesById.addKey(entity.getEntityId(), entity);
 }
 }
 }

This line could then be used to post load the leashes to animals right after the animal is loaded into the world.

 

Stef B

affects 18w44a

Hawk J

This bug affects Wandering Traders now. The leads break and the trader llamas just walk away.

Hawk J

-I was just trying to get a trader llama into my pen and the lead randomly broke, but the visual stayed on the screen and started jittering chaotically. I quit & reloaded the world and the lead was still jittering, stretched toward -∞ on the x axis. I followed it out some distance until it disappeared and came back. The glitch is gone now, but I never got my lead item back.

Yellow01

That's a different bug, see MC-143351

John Hardin

I also have this happening on game load in 1.13. There are some leashed horses in the pasture of my base. Sometimes when I load the game their leads have broken and they are wandering loose. When this happens on game load, the leads do not drop, I have to reattach them using new leads. When lead breaking happens on chunk reload after going away and coming back, the leads are dropped and can be reused.

user-2a4c8

I get this is postponed but still happening in 19w13b
Also why postponed ;(

Hayden Dyer

still happens all the time in 1.14

Ozone

Confirmed in 1.14.1. This is a really old bug, it would be the time to be fixed, 

Tokelauan

Also in 1.14.2, and 1.14.3 Pre-release 2.

753980 Volts

I believe I experienced this issue in 1.14.4. I have a llama connected to a fence by lead. I noticed that the lead had turned invisible so I replaced it. Right-clicking the lead knot on the fence post did not remove the lead but left-clicking the knot removed the lead and dropped as the lead item as normal. While the lead was invisible, it seemed that the llama was still connected to the fence post. However, I was able to connect another lead to the llama. Despite this, the llama would not move when I moved farther away and the lead stretched as I moved. This weirdness NEEDS to be fixed.

TheBoy358

Confirmed in 19w45b.

Amirullah Izzan

still happening in 1.14 xD

Johnibur

@[Zrov] This is fixed in 1.15. Fixes are never back-ported to previous versions.

Riley Winkler

Spake Miner

slicedlime

Confirmed

Normal

Entities

fence, horse, lead, leash_knot

Snapshot 13w17a, Snapshot 13w19a, Snapshot 13w21b, Snapshot 13w22a, Snapshot 13w23a, ..., Minecraft 19w13b, Minecraft 1.14.1, 1.14.4, 19w41a, 19w45b

Minecraft 15w31b, 1.15 Pre-release 1

Retrieved