[solved]Portals or Teleportation?

Ok So :slight_smile: here’s the skivie my friends :slight_smile: I have multiple worlds…but now i need some basic assistance with being able to travel between the two. so here’s my question…How would one make either a portal in a specific location to another specific location. Or would I need to somehow code for command based teleporting between the worlds? and if so how would i specify which world in the basic tp like settings?

You’ll want to use Entity#setLocation. The location you pass in can have a different Extent then the entity is currently in, in which case it will be teleported to the new world.

For an example, see the WorldsTest plugin in the Cookbook.

One way to do teleporting between worlds can be possible by command, Portal or by sign.

for command you could do a command that checks in which world a player is and then switch the player with the newly created world(by setting its location: player.setLocation(world.getSpawnLocation());

for portal you could take a look at this class: TeleporterAgent. It makes it possible to create portals and set the start/end location of portals

for sign you could listen to a sign click event then check if the sign contains a line like: [worldName] and then teleport the player to that world.