Fix mobs from other Alex mods teleporting to lantern even when commanded to stay#275
Open
equationcrunchor wants to merge 5 commits intoAlexModGuy:mainfrom
Open
Fix mobs from other Alex mods teleporting to lantern even when commanded to stay#275equationcrunchor wants to merge 5 commits intoAlexModGuy:mainfrom
equationcrunchor wants to merge 5 commits intoAlexModGuy:mainfrom
Conversation
Fix wrong type used for check
This was referenced Feb 18, 2026
Hardcoding them is janky but not sure what alternative there is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
shouldUnloadToLanternmethod 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 theTamableAnimallogic 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.