# PlayerUtils #### Player Teleportation

In version 1.10 BaseIO contains multiple teleport implementations. If you encounter issues regarding teleportations, try switching the implementation in BaseIO's config file

`PlayerUtils.teleportPlayerUnsafe(EntityPlayerMP player, Position position)` teleports a player to the specified position forcibly. If you want to be sure the player doesn't teleport into blocks, use `PlayerUtils.teleportPlayer(EntityPlayerMP player, Position position, boolean noisy)`. When the destination is an unsafe block this method won't teleport the player, returning false and (with noisy = true) printing a message to the player specifying the problem. For convenience teleportPlayer is overloaded with a ICommandSender instead of EntityPlayerMP (other senders than EntityPlayerMP will be discarded). #### Identifier conversion You might want to search a player by it's name quite often. For such cases (and many more "conversions") PlayerUtils provides a full set of conversion methods: [![neu0.png](https://wiki.ender.io/uploads/images/gallery/2017-11-Nov/scaled-840-0/neu0.png)](https://wiki.ender.io/uploads/images/gallery/2017-11-Nov/neu0.png)
**↓ From | To →****UUID****Name****GameProfile****EntityPlayer****ICommandSender**
**UUID** PlayerUtils:getNamePlayerUtils:getGameProfilePlayerUtils:getPlayerPlayerUtils:getPlayer
**Name**PlayerUtils:getUUID PlayerUtils:getGameProfilePlayerUtils:getPlayerPlayerUtils:getPlayer
**GameProfile**GameProfile:getIdGameProfile:getName PlayerUtils:getPlayerPlayerUtils:getPlayer
**EntityPlayer**EntityPlayer:getUniqueIdICommandSender:getNameEntityPlayer:getProfile typecast
**ICommandSender**PlayerUtils:getUUIDICommandSender:getName*(only via typecast)*typecast
If no player is found `null` will be returned.

In 1.7, ICommandSender:getName was named ICommandSender:getCommandSenderName

PlayerUtils is capable to convert **any** ICommandSender to an UUID, including console and command blocks. This UUID might not be a valid UUID of Minecraft but it can be used to identify it and additionally PlayerUtils:getName supports these UUIDs. Every Command Sender of one class has the same UUID.

##### Ranges All conversion methods have a range parameter that determines how broad the search should be.
**Range****Inclusion****Full search area**
ONLINEIncludes online playersonline players
FAKEIncludes fake playersonline (fake)players
SERVERIncludes offline playersonline/offline (fake)players
ALLIncludes players that have never been on the serverall minecraft players