Jump to content

Player Switching Dimensions [1.17.1]


X_ZombieSlayer_X

Recommended Posts

I am getting an error switching dimensions only on servers. It works well in single player.

Error:

[13:16:51] [Server thread/WARN]: X_ZombieSlayer_X moved too quickly! -16.78373791554268,9.5,-65.79919724030039
[13:16:51] [Server thread/WARN]: X_ZombieSlayer_X moved too quickly! -16.78373791554268,9.5,-65.79919724030039
[13:16:57] [Server thread/FATAL]: Error executing task on Server
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectset" is null
	at net.minecraft.server.level.DistanceManager.m_140828_(DistanceManager.java:230) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ChunkMap.m_140184_(ChunkMap.java:863) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ServerChunkCache.m_8385_(ServerChunkCache.java:433) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7185_(ServerGamePacketListenerImpl.java:849) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.m_5797_(SourceFile:114) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot.m_5797_(SourceFile:16) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.PacketUtils.m_131356_(SourceFile:21) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.TickTask.run(SourceFile:18) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(SourceFile:151) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(SourceFile:23) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:775) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:162) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(SourceFile:125) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:758) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:752) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18699_(SourceFile:110) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:737) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:687) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]
[13:17:06] [Server thread/FATAL]: Error executing task on Server
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectset" is null
	at net.minecraft.server.level.DistanceManager.m_140828_(DistanceManager.java:230) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ChunkMap.m_140184_(ChunkMap.java:863) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ServerChunkCache.m_8385_(ServerChunkCache.java:433) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7185_(ServerGamePacketListenerImpl.java:849) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.m_5797_(SourceFile:114) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$PosRot.m_5797_(SourceFile:16) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.PacketUtils.m_131356_(SourceFile:21) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.TickTask.run(SourceFile:18) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(SourceFile:151) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(SourceFile:23) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:775) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:162) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(SourceFile:125) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:758) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:752) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18701_(SourceFile:134) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:738) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:687) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]
[13:17:07] [Server thread/FATAL]: Error executing task on Server
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectset" is null
	at net.minecraft.server.level.DistanceManager.m_140828_(DistanceManager.java:230) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ChunkMap.m_140184_(ChunkMap.java:863) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ServerChunkCache.m_8385_(ServerChunkCache.java:433) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7185_(ServerGamePacketListenerImpl.java:849) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.m_5797_(SourceFile:114) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.m_5797_(SourceFile:42) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.PacketUtils.m_131356_(SourceFile:21) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.TickTask.run(SourceFile:18) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(SourceFile:151) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(SourceFile:23) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:775) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:162) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(SourceFile:125) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:758) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:752) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18701_(SourceFile:134) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:738) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:687) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]
[13:17:07] [Server thread/FATAL]: Error executing task on Server
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectSet.remove(Object)" because "objectset" is null
	at net.minecraft.server.level.DistanceManager.m_140828_(DistanceManager.java:230) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ChunkMap.m_140184_(ChunkMap.java:863) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.level.ServerChunkCache.m_8385_(ServerChunkCache.java:433) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.m_7185_(ServerGamePacketListenerImpl.java:849) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket.m_5797_(SourceFile:114) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.game.ServerboundMovePlayerPacket$Pos.m_5797_(SourceFile:42) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.network.protocol.PacketUtils.m_131356_(SourceFile:21) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.TickTask.run(SourceFile:18) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_6367_(SourceFile:151) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(SourceFile:23) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:775) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:162) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_7245_(SourceFile:125) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:758) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:752) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.util.thread.BlockableEventLoop.m_18701_(SourceFile:134) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:738) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:687) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.17.1-20210706.113038-srg.jar%2325!:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]

Code to teleport:

public void teleport(Player player) {
		ResourceKey<Level> dimension = ResourceKey.create(ResourceKey.createRegistryKey(new ResourceLocation(worldRegistry)), new ResourceLocation(worldEntry));
		if(player.getCommandSenderWorld().dimension().compareTo(dimension)!=0) {
			player.changeDimension(ServerLifecycleHooks.getCurrentServer().getLevel(dimension));
		}
		player.teleportTo(pos.getX(), (pos.getY()+0.5f), pos.getZ());
		player.lookAt(ServerLifecycleHooks.getCurrentServer().createCommandSourceStack().getAnchor(), lookAt.getVec3());
	}

Any ideas on how to fix this? I read a few forums containing ITeleporter but could not find anything mentioning it in the docs. 

Edited by X_ZombieSlayer_X
Spelling
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.