Villager throws IllegalStateException: World mismatch when entering Nether Portal on Folia
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- java
- Domain
- backend, distributed-systems, game-dev
Research direction
Reproduce on Folia 1.21.11 with a Villager entering a Nether Portal, then trace the async path through NetherPortalBlock.portalAsync, PortalProcessor.portalAsync, and Entity.portalToAsync. Compare the Villager construction in Entity.transformForAsyncTeleport with the World mismatch stack in Villager.makeBrain. Done means the Villager reaches world_nether without the IllegalStateException and the reproduction no longer logs the error.
Written by the indexing model from the issue text.
Description
Expected behavior
The Villager should safely teleport to the Nether, similar to other entities or players.
Observed/Actual behavior
The server throws an exception and the Villager fails to teleport:
Error Log
java.lang.IllegalStateException: World mismatch: expected world_nether but got world
at net.minecraft.world.level.Level.getCurrentWorldData(Level.java:830)
at net.minecraft.world.level.Level.getDayTime(Level.java:1914)
at net.minecraft.world.timeline.AttributeTrackSampler.applyTimeBased(AttributeTrackSampler.java:35)
at net.minecraft.world.attribute.EnvironmentAttributeSystem$ValueSampler.computeValueNotPositional(EnvironmentAttributeSystem.java:257)
at net.minecraft.world.attribute.EnvironmentAttributeSystem$ValueSampler.getDimensionValue(EnvironmentAttributeSystem.java:224)
at net.minecraft.world.attribute.EnvironmentAttributeSystem$ValueSampler.getValue(EnvironmentAttributeSystem.java:231)
at net.minecraft.world.attribute.EnvironmentAttributeSystem.getValue(EnvironmentAttributeSystem.java:117)
at net.minecraft.world.attribute.EnvironmentAttributeReader.getValue(EnvironmentAttributeReader.java:27)
at net.minecraft.world.entity.ai.Brain.updateActivityFromSchedule(Brain.java:313)
at net.minecraft.world.entity.npc.villager.Villager.registerBrainGoals(Villager.java:253)
at net.minecraft.world.entity.npc.villager.Villager.makeBrain(Villager.java:213)
at net.minecraft.world.entity.LivingEntity.(LivingEntity.java:326)
at net.minecraft.world.entity.Mob.(Mob.java:155)
at net.minecraft.world.entity.PathfinderMob.(PathfinderMob.java:17)
at net.minecraft.world.entity.AgeableMob.(AgeableMob.java:29)
at net.minecraft.world.entity.npc.villager.AbstractVillager.(AbstractVillager.java:49)
at net.minecraft.world.entity.npc.villager.Villager.(Villager.java:192)
at net.minecraft.world.entity.EntityType.create(EntityType.java:1523)
at net.minecraft.world.entity.Entity.transformForAsyncTeleport(Entity.java:4346)
at net.minecraft.world.entity.Entity.portalToAsync(Entity.java:4739)
at net.minecraft.world.entity.Entity.netherPortalLogicAsync(Entity.java:4491)
at net.minecraft.world.level.block.NetherPortalBlock.portalAsync(NetherPortalBlock.java:186)
at net.minecraft.world.entity.PortalProcessor.portalAsync(PortalProcessor.java:37)
at net.minecraft.world.entity.Entity.handlePortal(Entity.java:3524)
...
Steps/models to reproduce
Run a Folia server.
Create an Overworld (world) and Nether (world_nether).
Spawn a Villager in the Overworld.
Push the Villager into a Nether Portal.
Observe the server console.
Plugin and Datapack List
pl
[08:58:01 INFO]: ℹ Server Plugins (2):
[08:58:01 INFO]: Bukkit Plugins:
[08:58:01 INFO]: - ViaBackwards, ViaVersion
Folia version
Folia Version: 1.21.11 (build 1.21.11-10-1aa7055)
Other
No response
- Dominant language
- Shell
- Stars
- 4.7k
- Forks
- 651
- Avg merge
- 10d 3h
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PaperMC/Folia
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
status: needs triage type: bug
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
status: needs triage type: performance
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
status: needs triage type: bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
status: needs triage type: bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Similar issues
-
cicd
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nolte/kamerplanter-appliance#53 ·
Maintainers usually reply within 1 day
-
area:scripts priority:P2 status:backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
KD5UJC-XYZ/scarab#1170 ·
Maintainers usually reply within 1 day
-
SETUP: nothing verifies the decider code was ever set, so a skipped step leaves approvals token-onlyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
mattabate/life-distributable#229 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
-
bug fixed good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
sdetweil/MagicMirror-backup-restore#20 · 1 comment ·