|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.minecraft.src.Entity
net.minecraft.src.EntityLiving
net.minecraft.src.EntityPlayer
public abstract class EntityPlayer
Field Summary | |
---|---|
float |
cameraYaw
|
PlayerCapabilities |
capabilities
The player's capabilities. |
Container |
craftingInventory
the crafting inventory you are currently using |
float |
experience
The current amount of experience the player has within their Experience Bar. |
int |
experienceLevel
The current experience level the player is on. |
int |
experienceTotal
The total amount of experience the player has. |
float |
field_71079_bU
|
float |
field_71082_cx
|
double |
field_71085_bR
|
float |
field_71089_bV
|
double |
field_71091_bM
|
double |
field_71094_bP
|
double |
field_71095_bQ
|
double |
field_71096_bN
|
double |
field_71097_bO
|
byte |
field_71098_bD
|
EntityFishHook |
fishEntity
An instance of a fishing rod's hook. |
InventoryPlayer |
inventory
Inventory of the player |
Container |
inventorySlots
the crafting inventory in you get when opening your inventory |
String |
playerCloakUrl
|
ChunkCoordinates |
playerLocation
The chunk coordinates of the bed the player is in (null if player isn't in a bed). |
float |
prevCameraYaw
|
int |
score
|
String |
username
|
int |
xpCooldown
Used by EntityPlayer to prevent too many xp orbs from getting absorbed at once. |
Constructor Summary | |
---|---|
EntityPlayer(World par1World)
|
Method Summary | |
---|---|
void |
addChatMessage(String par1Str)
Add a chat message to the player |
void |
addExhaustion(float par1)
increases exhaustion level by supplied amount |
void |
addExperience(int par1)
This method increases the player's current amount of experience. |
void |
addMovementStat(double par1,
double par3,
double par5)
Adds a value to a movement statistic field - like run, walk, swin or climb. |
void |
addStat(StatBase par1StatBase,
int par2)
Adds a value to a statistic field. |
void |
addToPlayerScore(Entity par1Entity,
int par2)
Adds a value to the player score. |
boolean |
attackEntityFrom(DamageSource par1DamageSource,
int par2)
Called when the entity is attacked. |
void |
attackTargetEntityWithCurrentItem(Entity par1Entity)
Attacks for the player the targeted entity with the currently equipped item. |
boolean |
canEat(boolean par1)
|
boolean |
canHarvestBlock(Block par1Block)
Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary) |
void |
clearItemInUse()
|
void |
clonePlayer(EntityPlayer par1EntityPlayer,
boolean par2)
Copies the values from the given player into this player if boolean par2 is true. |
void |
closeScreen()
sets current screen to null (used on escape buttons of GUIs) |
void |
destroyCurrentEquippedItem()
Destroys the currently equipped item from the player's inventory. |
void |
displayGUIBook(ItemStack par1ItemStack)
Displays the GUI for interacting with a book. |
void |
displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)
Displays the GUI for interacting with a brewing stand. |
void |
displayGUIChest(IInventory par1IInventory)
Displays the GUI for interacting with a chest inventory. |
void |
displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)
Displays the dipsenser GUI for the passed in dispenser entity. |
void |
displayGUIEditSign(TileEntity par1TileEntity)
Displays the GUI for editing a sign. |
void |
displayGUIEnchantment(int par1,
int par2,
int par3)
|
void |
displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)
Displays the furnace GUI for the passed in furnace entity. |
void |
displayGUIMerchant(IMerchant par1IMerchant)
|
void |
displayGUIWorkbench(int par1,
int par2,
int par3)
Displays the crafting GUI for a workbench. |
EntityItem |
dropOneItem()
Called when player presses the drop item key |
EntityItem |
dropPlayerItem(ItemStack par1ItemStack)
Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in a workbench while the workbench'es GUI gets closed) |
EntityItem |
dropPlayerItemWithRandomChoice(ItemStack par1ItemStack,
boolean par2)
Args: itemstack, flag |
void |
func_70062_b(int par1,
ItemStack par2ItemStack)
|
boolean |
func_71066_bF()
|
int |
func_82145_z()
|
int |
func_82147_ab()
|
ItemStack |
func_82169_q(int par1)
|
boolean |
func_82238_cc()
|
void |
func_82240_a(TileEntityBeacon par1TileEntityBeacon)
|
void |
func_82242_a(int par1)
|
float |
func_82243_bO()
|
void |
func_82244_d(int par1,
int par2,
int par3)
|
boolean |
func_82245_bX()
|
boolean |
func_82246_f(int par1,
int par2,
int par3)
|
boolean |
func_82247_a(int par1,
int par2,
int par3,
int par4,
ItemStack par5ItemStack)
|
float |
getBedOrientationInDegrees()
|
String |
getCommandSenderName()
Gets the name of this command sender (usually username, but possibly "Rcon") |
ItemStack |
getCurrentEquippedItem()
Returns the currently being used item by the player. |
ItemStack |
getCurrentItemOrArmor(int par1)
0 = item, 1-n is armor |
float |
getCurrentPlayerStrVsBlock(Block par1Block)
Deprecated. |
float |
getCurrentPlayerStrVsBlock(Block par1Block,
int meta)
|
String |
getEntityName()
Gets the username of the entity. |
float |
getEyeHeight()
|
FoodStats |
getFoodStats()
Returns the player's FoodStats object. |
ItemStack |
getHeldItem()
Returns the item that this EntityLiving is holding, if any. |
InventoryEnderChest |
getInventoryEnderChest()
Returns the InventoryEnderChest of this player. |
int |
getItemIcon(ItemStack par1ItemStack,
int par2)
|
ItemStack |
getItemInUse()
|
int |
getItemInUseCount()
|
int |
getItemInUseDuration()
|
ItemStack[] |
getLastActiveItems()
|
int |
getMaxHealth()
|
int |
getScore()
|
int |
getSleepTimer()
|
ChunkCoordinates |
getSpawnChunk()
Returns the coordinates to respawn the player based on last bed that the player sleep. |
int |
getTotalArmorValue()
Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue |
StringTranslate |
getTranslator()
|
double |
getYOffset()
Returns the Y Offset of this entity. |
void |
handleHealthUpdate(byte par1)
|
boolean |
interactWith(Entity par1Entity)
|
boolean |
isBlocking()
|
boolean |
isEntityInsideOpaqueBlock()
Checks if this entity is inside of an opaque block |
boolean |
isPlayerFullyAsleep()
Returns whether or not the player is asleep and the screen has fully faded. |
boolean |
isPlayerSleeping()
Returns whether player is sleeping or not |
boolean |
isUsingItem()
Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton |
void |
joinEntityItemWithWorld(EntityItem par1EntityItem)
Joins the passed in entity item with the world. |
void |
moveEntityWithHeading(float par1,
float par2)
Moves the entity based on the specified heading. |
void |
onCriticalHit(Entity par1Entity)
Called when the player performs a critical hit on the Entity. |
void |
onDeath(DamageSource par1DamageSource)
Called when the mob's health reaches 0. |
void |
onEnchantmentCritical(Entity par1Entity)
|
void |
onKillEntity(EntityLiving par1EntityLiving)
This method gets called when the entity kills another one. |
void |
onLivingUpdate()
Called frequently so the entity can update its state every tick as required. |
void |
onUpdate()
Called to update the entity's position/logic. |
void |
openGui(Object mod,
int modGuiId,
World world,
int x,
int y,
int z)
|
void |
preparePlayerToSpawn()
|
void |
readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
(abstract) Protected helper method to read subclass entity data from NBT. |
void |
respawnPlayer()
|
void |
sendGameTypeToPlayer(EnumGameType par1EnumGameType)
|
void |
sendPlayerAbilities()
Sends the player's abilities to the server (if there is one). |
void |
setDead()
Will get destroyed next tick. |
void |
setItemInUse(ItemStack par1ItemStack,
int par2)
sets the itemInUse when the use item button is clicked. |
void |
setSpawnChunk(ChunkCoordinates par1ChunkCoordinates,
boolean par2)
Defines a spawn coordinate to player spawn. |
boolean |
shouldHeal()
Checks if the player's health is not full and not zero. |
EnumStatus |
sleepInBedAt(int par1,
int par2,
int par3)
Attempts to have the player sleep in a bed at the specified location. |
void |
stopUsingItem()
|
String |
translateString(String par1Str,
Object... par2ArrayOfObj)
Translates and formats the given string key with the given arguments. |
void |
triggerAchievement(StatBase par1StatBase)
Will trigger the specified trigger. |
void |
updateRidden()
Handles updating while being ridden by an entity |
static ChunkCoordinates |
verifyRespawnCoordinates(World par0World,
ChunkCoordinates par1ChunkCoordinates,
boolean par2)
Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to spawn. |
void |
wakeUpPlayer(boolean par1,
boolean par2,
boolean par3)
Wake up the player if they're sleeping. |
void |
writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
(abstract) Protected helper method to write subclass entity data to NBT. |
int |
xpBarCap()
This method returns the cap amount of experience that the experience bar can hold. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.minecraft.src.ICommandSender |
---|
canCommandSenderUseCommand, func_82114_b, sendChatToPlayer |
Field Detail |
---|
public InventoryPlayer inventory
public Container inventorySlots
public Container craftingInventory
public byte field_71098_bD
public int score
public float prevCameraYaw
public float cameraYaw
public String username
public String playerCloakUrl
public int xpCooldown
public double field_71091_bM
public double field_71096_bN
public double field_71097_bO
public double field_71094_bP
public double field_71095_bQ
public double field_71085_bR
public ChunkCoordinates playerLocation
public float field_71079_bU
public float field_71082_cx
public float field_71089_bV
public PlayerCapabilities capabilities
public int experienceLevel
public int experienceTotal
public float experience
public EntityFishHook fishEntity
Constructor Detail |
---|
public EntityPlayer(World par1World)
Method Detail |
---|
public int getMaxHealth()
getMaxHealth
in class EntityLiving
public ItemStack getItemInUse()
public int getItemInUseCount()
public boolean isUsingItem()
public int getItemInUseDuration()
public void stopUsingItem()
public void clearItemInUse()
public boolean isBlocking()
isBlocking
in class EntityLiving
public void onUpdate()
onUpdate
in class EntityLiving
public int func_82145_z()
func_82145_z
in class Entity
public int func_82147_ab()
func_82147_ab
in class Entity
public void handleHealthUpdate(byte par1)
handleHealthUpdate
in class EntityLiving
public void closeScreen()
public void updateRidden()
updateRidden
in class EntityLiving
public void preparePlayerToSpawn()
public void onLivingUpdate()
onLivingUpdate
in class EntityLiving
public int getScore()
public void onDeath(DamageSource par1DamageSource)
onDeath
in class EntityLiving
public void addToPlayerScore(Entity par1Entity, int par2)
addToPlayerScore
in class Entity
public EntityItem dropOneItem()
public EntityItem dropPlayerItem(ItemStack par1ItemStack)
public EntityItem dropPlayerItemWithRandomChoice(ItemStack par1ItemStack, boolean par2)
public void joinEntityItemWithWorld(EntityItem par1EntityItem)
@Deprecated public float getCurrentPlayerStrVsBlock(Block par1Block)
public float getCurrentPlayerStrVsBlock(Block par1Block, int meta)
public boolean canHarvestBlock(Block par1Block)
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
readEntityFromNBT
in class EntityLiving
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
writeEntityToNBT
in class EntityLiving
public void displayGUIChest(IInventory par1IInventory)
public void displayGUIEnchantment(int par1, int par2, int par3)
public void func_82244_d(int par1, int par2, int par3)
public void displayGUIWorkbench(int par1, int par2, int par3)
public float getEyeHeight()
getEyeHeight
in class EntityLiving
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
attackEntityFrom
in class EntityLiving
public int getTotalArmorValue()
getTotalArmorValue
in class EntityLiving
public float func_82243_bO()
public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)
public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)
public void displayGUIEditSign(TileEntity par1TileEntity)
public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)
public void func_82240_a(TileEntityBeacon par1TileEntityBeacon)
public void displayGUIMerchant(IMerchant par1IMerchant)
public void displayGUIBook(ItemStack par1ItemStack)
public boolean interactWith(Entity par1Entity)
public ItemStack getCurrentEquippedItem()
public void destroyCurrentEquippedItem()
public double getYOffset()
getYOffset
in class Entity
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
public void onCriticalHit(Entity par1Entity)
public void onEnchantmentCritical(Entity par1Entity)
public void respawnPlayer()
public void setDead()
setDead
in class Entity
public boolean isEntityInsideOpaqueBlock()
isEntityInsideOpaqueBlock
in class Entity
public boolean func_71066_bF()
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3)
public static ChunkCoordinates verifyRespawnCoordinates(World par0World, ChunkCoordinates par1ChunkCoordinates, boolean par2)
public float getBedOrientationInDegrees()
public boolean isPlayerSleeping()
isPlayerSleeping
in class EntityLiving
public boolean isPlayerFullyAsleep()
public int getSleepTimer()
public void addChatMessage(String par1Str)
public ChunkCoordinates getSpawnChunk()
public boolean func_82245_bX()
public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2)
public void triggerAchievement(StatBase par1StatBase)
public void addStat(StatBase par1StatBase, int par2)
public void moveEntityWithHeading(float par1, float par2)
moveEntityWithHeading
in class EntityLiving
public void addMovementStat(double par1, double par3, double par5)
public void onKillEntity(EntityLiving par1EntityLiving)
onKillEntity
in class Entity
public int getItemIcon(ItemStack par1ItemStack, int par2)
getItemIcon
in class EntityLiving
public ItemStack func_82169_q(int par1)
func_82169_q
in class EntityLiving
public void addExperience(int par1)
public void func_82242_a(int par1)
public int xpBarCap()
public void addExhaustion(float par1)
public FoodStats getFoodStats()
public boolean canEat(boolean par1)
public boolean shouldHeal()
public void setItemInUse(ItemStack par1ItemStack, int par2)
public boolean func_82246_f(int par1, int par2, int par3)
public boolean func_82247_a(int par1, int par2, int par3, int par4, ItemStack par5ItemStack)
public String getEntityName()
getEntityName
in class Entity
public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2)
public void sendPlayerAbilities()
public void sendGameTypeToPlayer(EnumGameType par1EnumGameType)
public String getCommandSenderName()
getCommandSenderName
in interface ICommandSender
public StringTranslate getTranslator()
public String translateString(String par1Str, Object... par2ArrayOfObj)
translateString
in interface ICommandSender
public InventoryEnderChest getInventoryEnderChest()
public ItemStack getCurrentItemOrArmor(int par1)
getCurrentItemOrArmor
in class EntityLiving
public ItemStack getHeldItem()
getHeldItem
in class EntityLiving
public void func_70062_b(int par1, ItemStack par2ItemStack)
func_70062_b
in class EntityLiving
public ItemStack[] getLastActiveItems()
getLastActiveItems
in class EntityLiving
public boolean func_82238_cc()
public void openGui(Object mod, int modGuiId, World world, int x, int y, int z)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |