Skip to content

Comments

Fix mobs from other Alex mods teleporting to lantern even when commanded to stay#275

Open
equationcrunchor wants to merge 5 commits intoAlexModGuy:mainfrom
equationcrunchor:patch-2
Open

Fix mobs from other Alex mods teleporting to lantern even when commanded to stay#275
equationcrunchor wants to merge 5 commits intoAlexModGuy:mainfrom
equationcrunchor:patch-2

Conversation

@equationcrunchor
Copy link

@equationcrunchor equationcrunchor commented Feb 18, 2026

The shouldUnloadToLantern method looks for a key that ends with "Command" and is a byte, but because Alex's Mobs stores tamed animal commands as ints, this always fails and falls through to the TamableAnimal logic that doesn't work correctly. This PR fixes the type check, ensuring that mobs from Alex's mobs only teleport when set to "follow."

I didn't test all the tamable mobs, but I did test bears, crows, raccoons, kangaroos, vallumraptor, and candicorns. I also tested vanilla wolves to make sure they weren't affected. By teleporting between two different faraway lanterns in Creative, I verified that all these mobs still teleport to the lantern when set to follow, and don't when set to stay, wander, or other modes. I also verified that elephants and gorillas do not teleport. (This time, I also made sure to do my testing outside of spawn chunks so I wouldn't be bamboozled by those always staying loaded...)

Given my premature celebration last time, would appreciate others trying out the changes and making sure they consistently work.

Problems not fixed by this PR:

  • Tamed elephants still always teleport to the lantern. This is because they have no "Command" field and don't sit, so the logic doesn't handle them correctly. (For some reason, horses don't have this problem.)
  • Tameable mobs from Alex's Caves (or at least the Vallumraptor) teleport to the lantern when set to sit. This is because the numerical values for the "Command" field don't align with Alex's Mobs, so the code thinks that they're following when they're sitting.

These problems fixed in latest commits.

@equationcrunchor equationcrunchor changed the title Fix Alex Mob's mobs teleporting to lantern even when commanded to stay Fix mobs from other Alex mods teleporting to lantern even when commanded to stay Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant