Teleporting CraftBukkit players to another world?

Li
- in Worlds
5

I have a question about Bukkit, i.e. Minecraft plugins, in my code I have: p.teleport (Bukkit.getServer (). GetWorld (args [0]). GetSpawnLocation ()); So when executing the command, the player should be teleported into the world that he specifies after the command. But then comes the error code:

.

Teleporting CraftBukkit players to another world

I don't know what to do next

Av

The plugin does not know which worlds there are or which options there are

Unhandeled exception executing command 'world' in plugin…

I can well imagine that it is because…

Li

Do you know how to fix this

Av

Maybe that can help: https://bukkit.org/threads/teleporting-a-player-to-other-worlds.96828/

Li

Thanks

Al

You should check beforehand whether Bukkit.getServer (). GetWorld (args [0])! = Null. This happens when the player specifies a world that does not exist.