public class EntityPlayerMP extends EntityPlayer implements ICrafting
EntityPlayer.EnumChatVisibility, EntityPlayer.EnumStatus
Modifier and Type | Field and Description |
---|---|
int |
currentWindowId
The currently in use window ID.
|
boolean |
isChangingQuantityOnly
set to true when player is moving quantity of items from one inventory to another(crafting) but item in either
slot is not changed
|
java.util.List<ChunkCoordIntPair> |
loadedChunks |
double |
managedPosX
player X position as seen by PlayerManager
|
double |
managedPosZ
player Z position as seen by PlayerManager
|
MinecraftServer |
mcServer
Reference to the MinecraftServer object.
|
int |
ping |
boolean |
playerConqueredTheEnd
Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory
and XP
|
NetHandlerPlayServer |
playerNetServerHandler
The NetServerHandler assigned to this player by the ServerConfigurationManager.
|
ItemInWorldManager |
theItemInWorldManager
The ItemInWorldManager belonging to this player
|
cameraYaw, capabilities, chasingPosX, chasingPosY, chasingPosZ, experience, experienceLevel, experienceTotal, eyeHeight, fishEntity, flyToggleTimer, foodStats, inventory, inventoryContainer, openContainer, PERSISTED_NBT_TAG, playerLocation, prevCameraYaw, prevChasingPosX, prevChasingPosY, prevChasingPosZ, renderOffsetX, renderOffsetY, renderOffsetZ, sleeping, speedInAir, speedOnGround, xpCooldown
arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, field_70741_aB, field_70769_ao, field_70770_ap, hurtTime, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingProgress, swingProgressInt
addedToChunk, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, extendedProperties, fallDistance, field_181016_an, field_181017_ao, field_181018_ap, fireResistance, firstUpdate, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj
Constructor and Description |
---|
EntityPlayerMP(MinecraftServer server,
WorldServer worldIn,
GameProfile profile,
ItemInWorldManager interactionManager) |
Modifier and Type | Method and Description |
---|---|
void |
addChatComponentMessage(IChatComponent chatComponent) |
void |
addChatMessage(IChatComponent component)
Send a chat message to the CommandSender
|
void |
addExperienceLevel(int levels)
Add experience levels to this player.
|
void |
addSelfToInternalCraftingInventory() |
void |
addStat(StatBase stat,
int amount)
Adds a value to a statistic field.
|
boolean |
attackEntityFrom(DamageSource source,
float amount)
Called when the entity is attacked.
|
void |
attackTargetEntityWithCurrentItem(Entity targetEntity)
Attacks for the player the targeted entity with the currently equipped item.
|
boolean |
canAttackPlayer(EntityPlayer other) |
boolean |
canCommandSenderUseCommand(int permLevel,
java.lang.String commandName)
Returns
true if the CommandSender is allowed to execute the command, false if not |
void |
clonePlayer(EntityPlayer oldPlayer,
boolean respawnFromEnd)
Copies the values from the given player into this player if boolean par2 is true.
|
void |
closeContainer()
Closes the container the player currently has open.
|
void |
closeScreen()
set current crafting inventory back to the 2x2 square
|
void |
displayGui(IInteractionObject guiOwner) |
void |
displayGUIBook(ItemStack bookStack)
Displays the GUI for interacting with a book.
|
void |
displayGUIChest(IInventory chestInventory)
Displays the GUI for interacting with a chest inventory.
|
void |
displayGUIHorse(EntityHorse horse,
IInventory horseInventory) |
void |
displayVillagerTradeGui(IMerchant villager) |
void |
func_175145_a(StatBase p_175145_1_) |
EntityPlayer.EnumChatVisibility |
getChatVisibility() |
long |
getLastActiveTime() |
void |
getNextWindowId()
get the next window id to use
|
java.lang.String |
getPlayerIP()
Gets the player's IP address.
|
BlockPos |
getPosition()
Get the position in the world.
|
WorldServer |
getServerForPlayer() |
Entity |
getSpectatingEntity() |
StatisticsFile |
getStatFile()
Gets the stats file for reading achievements
|
IChatComponent |
getTabListDisplayName()
Returns null which indicates the tab list should just display the player's name, return a different value to
display the specified text instead of the player's name
|
void |
handleClientSettings(C15PacketClientSettings packetIn) |
void |
handleFalling(double p_71122_1_,
boolean p_71122_3_)
process player falling based on movement packet
|
boolean |
isSpectatedByPlayer(EntityPlayerMP player) |
boolean |
isSpectator()
Returns true if the player is in spectator mode.
|
void |
loadResourcePack(java.lang.String url,
java.lang.String hash) |
void |
markPlayerActive() |
void |
mountEntity(Entity entityIn)
Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
|
void |
mountEntityAndWakeUp() |
protected void |
onChangedPotionEffect(PotionEffect id,
boolean p_70695_2_) |
void |
onCriticalHit(Entity entityHit)
Called when the player performs a critical hit on the Entity.
|
void |
onDeath(DamageSource cause)
Called when the mob's health reaches 0.
|
void |
onEnchantmentCritical(Entity entityHit) |
protected void |
onFinishedPotionEffect(PotionEffect p_70688_1_) |
void |
onItemPickup(Entity p_71001_1_,
int p_71001_2_)
Called whenever an item is picked up from walking over it.
|
protected void |
onItemUseFinish()
Used for when item use count runs out, ie: eating completed
|
protected void |
onNewPotionEffect(PotionEffect id) |
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
onUpdateEntity() |
void |
openEditSign(TileEntitySign signTile) |
void |
readEntityFromNBT(NBTTagCompound tagCompund)
(abstract) Protected helper method to read subclass entity data from NBT.
|
void |
removeEntity(Entity p_152339_1_)
Sends a packet to the player to remove an entity.
|
void |
removeExperienceLevel(int levels) |
void |
sendAllWindowProperties(Container p_175173_1_,
IInventory p_175173_2_) |
void |
sendContainerToPlayer(Container p_71120_1_) |
void |
sendEndCombat()
Sends an END_COMBAT packet to the client
|
void |
sendEnterCombat()
Sends an ENTER_COMBAT packet to the client
|
void |
sendPlayerAbilities()
Sends the player's abilities to the server (if there is one).
|
void |
sendProgressBarUpdate(Container containerIn,
int varToUpdate,
int newValue)
Sends two ints to the client-side Container.
|
void |
sendSlotContents(Container containerToSend,
int slotInd,
ItemStack stack)
Sends the contents of an inventory slot to the client-side Container.
|
void |
setEntityActionState(float p_110430_1_,
float p_110430_2_,
boolean p_110430_3_,
boolean sneaking) |
void |
setGameType(WorldSettings.GameType gameType)
Sets the player's game mode and sends it to them.
|
void |
setItemInUse(ItemStack stack,
int duration)
sets the itemInUse when the use item button is clicked.
|
void |
setPlayerHealthUpdated()
this function is called when a players inventory is sent to him, lastHealth is updated on any dimension
transitions, then reset.
|
void |
setPositionAndUpdate(double x,
double y,
double z)
Sets the position of the entity and updates the 'last' variables
|
void |
setSpectatingEntity(Entity entityToSpectate) |
void |
travelToDimension(int dimensionId)
Teleports the entity to another dimension.
|
EntityPlayer.EnumStatus |
trySleep(BlockPos bedLocation) |
protected void |
updateBiomesExplored()
Updates all biomes that have been explored by this player and triggers Adventuring Time if player qualifies.
|
void |
updateCraftingInventory(Container containerToSend,
java.util.List<ItemStack> itemsList)
update the crafting window inventory with the items in the list
|
protected void |
updateFallState(double y,
boolean onGroundIn,
Block blockIn,
BlockPos pos) |
void |
updateHeldItem()
updates item held by mouse
|
protected void |
updatePotionMetadata()
Clears potion metadata values if the entity has no potion effects.
|
void |
wakeUpPlayer(boolean p_70999_1_,
boolean updateWorldFlag,
boolean setSpawn)
Wake up the player if they're sleeping.
|
void |
writeEntityToNBT(NBTTagCompound tagCompound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addExhaustion, addExperience, addMovementStat, addPrefix, addScore, addSuffix, addToPlayerScore, applyEntityAttributes, canEat, canHarvestBlock, canOpen, canPlayerEdit, canTriggerWalking, clearItemInUse, damageArmor, damageEntity, destroyCurrentEquippedItem, dropItem, dropOneItem, dropPlayerItemWithRandomChoice, entityInit, fall, getAbsorptionAmount, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArmorVisibility, getBedLocation, getBedLocation, getBedOrientationInDegrees, getBedSpawnLocation, getBreakSpeed, getCurrentArmor, getCurrentEquippedItem, getDeathSound, getDefaultEyeHeight, getDisplayName, getDisplayNameString, getEquipmentInSlot, getExperiencePoints, getEyeHeight, getFallSoundString, getFoodStats, getGameProfile, getHeldItem, getHurtSound, getInventory, getInventoryEnderChest, getItemInUse, getItemInUseCount, getItemInUseDuration, getMaxInPortalTime, getName, getOfflineUUID, getPortalCooldown, getPrefixes, getScore, getSleepTimer, getSplashSound, getSuffixes, getSwimSound, getTeam, getToolDigEfficiency, getTotalArmorValue, getUUID, getWorldScoreboard, getXPSeed, getYOffset, handleStatusUpdate, hasReducedDebug, interactWith, isAllowEdit, isBlocking, isEntityInsideOpaqueBlock, isInvisibleToPlayer, isMovementBlocked, isPlayer, isPlayerFullyAsleep, isPlayerSleeping, isPushedByWater, isSpawnForced, isSpawnForced, isUser, isUsingItem, isWearing, joinEntityItemWithWorld, jump, moveEntityWithHeading, onKillEntity, onLivingUpdate, openEditCommandBlock, openGui, playSound, preparePlayerToSpawn, refreshDisplayName, replaceItemInInventory, resetHeight, respawnPlayer, sendCommandFeedback, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setInWeb, setReducedDebug, setScore, setSpawnChunk, setSpawnPoint, shouldHeal, stopUsingItem, triggerAchievement, updateEntityActionState, updateItemUse, updateRidden, xpBarCap
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, decreaseAirSupply, dismountEntity, dropEquipment, dropFewItems, func_110146_f, func_181013_g, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getArrowCountInEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getHealth, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, handleJumpLava, heal, isChild, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, isServerWorld, kill, knockBack, markPotionsDirty, onDeathUpdate, onEntityUpdate, onKillCommand, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, swingItem, updateAITick, updateArmSwingProgress, updatePotionEffects
addEntityCrashInfo, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canRenderOnFire, canRiderInteract, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_174817_o, func_181012_aH, func_181014_aG, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCapability, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getCustomNameTag, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getExtendedProperties, getFlag, getHorizontalFacing, getHoverEvent, getMaxFallHeight, getMountedYOffset, getNBTTagCompound, getParts, getPersistentID, getPickedResult, getPositionEyes, getPositionVector, getUniqueID, getVectorForRotation, handleWaterMovement, hasCapability, hasCustomName, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isRiding, isSilent, isSneaking, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, pushOutOfBlocks, rayTrace, readFromNBT, registerExtendedProperties, resetEntityId, serializeNBT, setAir, setAlwaysRenderNameTag, setAngles, setCommandStat, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, toString, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
public NetHandlerPlayServer playerNetServerHandler
public final MinecraftServer mcServer
public final ItemInWorldManager theItemInWorldManager
public double managedPosX
public double managedPosZ
public final java.util.List<ChunkCoordIntPair> loadedChunks
public int currentWindowId
public boolean isChangingQuantityOnly
public int ping
public boolean playerConqueredTheEnd
public EntityPlayerMP(MinecraftServer server, WorldServer worldIn, GameProfile profile, ItemInWorldManager interactionManager)
public void readEntityFromNBT(NBTTagCompound tagCompund)
readEntityFromNBT
in class EntityPlayer
public void writeEntityToNBT(NBTTagCompound tagCompound)
writeEntityToNBT
in class EntityPlayer
public void addExperienceLevel(int levels)
addExperienceLevel
in class EntityPlayer
public void removeExperienceLevel(int levels)
removeExperienceLevel
in class EntityPlayer
public void addSelfToInternalCraftingInventory()
public void sendEnterCombat()
sendEnterCombat
in class EntityLivingBase
public void sendEndCombat()
sendEndCombat
in class EntityLivingBase
public void onUpdate()
onUpdate
in class EntityPlayer
public void onUpdateEntity()
protected void updateBiomesExplored()
public void onDeath(DamageSource cause)
onDeath
in class EntityPlayer
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class EntityPlayer
public boolean canAttackPlayer(EntityPlayer other)
canAttackPlayer
in class EntityPlayer
public void travelToDimension(int dimensionId)
travelToDimension
in class Entity
public boolean isSpectatedByPlayer(EntityPlayerMP player)
isSpectatedByPlayer
in class Entity
public void onItemPickup(Entity p_71001_1_, int p_71001_2_)
onItemPickup
in class EntityLivingBase
public EntityPlayer.EnumStatus trySleep(BlockPos bedLocation)
trySleep
in class EntityPlayer
public void wakeUpPlayer(boolean p_70999_1_, boolean updateWorldFlag, boolean setSpawn)
wakeUpPlayer
in class EntityPlayer
public void mountEntity(Entity entityIn)
mountEntity
in class EntityLivingBase
protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos)
updateFallState
in class EntityLivingBase
public void handleFalling(double p_71122_1_, boolean p_71122_3_)
public void openEditSign(TileEntitySign signTile)
openEditSign
in class EntityPlayer
public void getNextWindowId()
public void displayGui(IInteractionObject guiOwner)
displayGui
in class EntityPlayer
public void displayGUIChest(IInventory chestInventory)
displayGUIChest
in class EntityPlayer
public void displayVillagerTradeGui(IMerchant villager)
displayVillagerTradeGui
in class EntityPlayer
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
displayGUIHorse
in class EntityPlayer
public void displayGUIBook(ItemStack bookStack)
displayGUIBook
in class EntityPlayer
public void sendSlotContents(Container containerToSend, int slotInd, ItemStack stack)
sendSlotContents
in interface ICrafting
public void sendContainerToPlayer(Container p_71120_1_)
public void updateCraftingInventory(Container containerToSend, java.util.List<ItemStack> itemsList)
updateCraftingInventory
in interface ICrafting
public void sendProgressBarUpdate(Container containerIn, int varToUpdate, int newValue)
sendProgressBarUpdate
in interface ICrafting
public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_)
sendAllWindowProperties
in interface ICrafting
public void closeScreen()
closeScreen
in class EntityPlayer
public void updateHeldItem()
public void closeContainer()
public void setEntityActionState(float p_110430_1_, float p_110430_2_, boolean p_110430_3_, boolean sneaking)
public void addStat(StatBase stat, int amount)
addStat
in class EntityPlayer
public void func_175145_a(StatBase p_175145_1_)
func_175145_a
in class EntityPlayer
public void mountEntityAndWakeUp()
public void setPlayerHealthUpdated()
public void addChatComponentMessage(IChatComponent chatComponent)
addChatComponentMessage
in class EntityPlayer
protected void onItemUseFinish()
onItemUseFinish
in class EntityPlayer
public void setItemInUse(ItemStack stack, int duration)
setItemInUse
in class EntityPlayer
public void clonePlayer(EntityPlayer oldPlayer, boolean respawnFromEnd)
clonePlayer
in class EntityPlayer
protected void onNewPotionEffect(PotionEffect id)
onNewPotionEffect
in class EntityLivingBase
protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_)
onChangedPotionEffect
in class EntityLivingBase
protected void onFinishedPotionEffect(PotionEffect p_70688_1_)
onFinishedPotionEffect
in class EntityLivingBase
public void setPositionAndUpdate(double x, double y, double z)
setPositionAndUpdate
in class Entity
public void onCriticalHit(Entity entityHit)
onCriticalHit
in class EntityPlayer
public void onEnchantmentCritical(Entity entityHit)
onEnchantmentCritical
in class EntityPlayer
public void sendPlayerAbilities()
sendPlayerAbilities
in class EntityPlayer
public WorldServer getServerForPlayer()
public void setGameType(WorldSettings.GameType gameType)
setGameType
in class EntityPlayer
public boolean isSpectator()
isSpectator
in class EntityPlayer
public void addChatMessage(IChatComponent component)
addChatMessage
in interface ICommandSender
addChatMessage
in class Entity
public boolean canCommandSenderUseCommand(int permLevel, java.lang.String commandName)
true
if the CommandSender is allowed to execute the command, false
if notcanCommandSenderUseCommand
in interface ICommandSender
canCommandSenderUseCommand
in class Entity
public java.lang.String getPlayerIP()
public void handleClientSettings(C15PacketClientSettings packetIn)
public EntityPlayer.EnumChatVisibility getChatVisibility()
public void loadResourcePack(java.lang.String url, java.lang.String hash)
public BlockPos getPosition()
null
is not allowed! If you are not an entity in the world, return
the coordinates 0, 0, 0getPosition
in interface ICommandSender
getPosition
in class Entity
public void markPlayerActive()
public StatisticsFile getStatFile()
public void removeEntity(Entity p_152339_1_)
protected void updatePotionMetadata()
updatePotionMetadata
in class EntityLivingBase
public Entity getSpectatingEntity()
public void setSpectatingEntity(Entity entityToSpectate)
public void attackTargetEntityWithCurrentItem(Entity targetEntity)
attackTargetEntityWithCurrentItem
in class EntityPlayer
public long getLastActiveTime()
public IChatComponent getTabListDisplayName()