Posted 22 November 2012 - 09:45 AM
Hello,
I am trying to get an EntityPlayer handle from their username. For example:
The way I had been getting the info about the player before was by getting the entityLiving from onBlockPlacedBy() like this:
Unfortunately for my purposes I do not want the player to have to place the peripheral block to receive the Entity handle. Is there any way to accomplish what I want to do?
Any help would be greatly appreciated.
I am trying to get an EntityPlayer handle from their username. For example:
public EntityPlayer getPlayerHandle(String name) //The user will input the name into this field
{
//This is the part I am having trouble with. Ideally I would be able to just do the following:
EntityPlayer player = EntityPlayer.getPlayer(name);
return player
}
The way I had been getting the info about the player before was by getting the entityLiving from onBlockPlacedBy() like this:
EntityLiving entityLiving = null;
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) {
entityLiving = par5EntityLiving;
}
Unfortunately for my purposes I do not want the player to have to place the peripheral block to receive the Entity handle. Is there any way to accomplish what I want to do?
Any help would be greatly appreciated.