EssentialsX

EssentialsX

2M Downloads

Remove all passengers on a player before teleporting to a new location.

Linebeck opened this issue ยท 0 comments

commented

There is common bug that (not just with EssentialsX, but any plugin), if you have another passenger on riding you (you as in a player), and you are wanting to teleport by either doing /warp, /spawn, /tpa, etc. You will not be able to teleport until the passenger is removed.

I was wondering if it would be possible to add this:

		if(!player.getPassengers().isEmpty()) 
		{				
			for(Entity entity : player.getPassengers()) 
			{
				entity.leaveVehicle();
			}
		} //After this, then player.teleport(Location);

Before a teleport is commenced to help aid this minor bug. Maybe in the config you can have an option if people want the the passenger(s) to be able to teleport with them they can. You will just have to remove them, then re-add them back. This will help one of my custom plugins function if this is able to be added, and it'll be greatly appreciated!

Thanks.