public class EntityPlayerSP extends AbstractClientPlayer
EntityPlayer.EnumChatVisibility, EntityPlayer.EnumStatus| Modifier and Type | Field and Description |
|---|---|
protected Minecraft |
mc |
MovementInput |
movementInput |
float |
prevRenderArmPitch |
float |
prevRenderArmYaw |
float |
prevTimeInPortal
The amount of time an entity has been in a Portal the previous tick
|
float |
renderArmPitch |
float |
renderArmYaw |
NetHandlerPlayClient |
sendQueue |
int |
sprintingTicksLeft
Ticks left before sprinting is disabled.
|
protected int |
sprintToggleTimer
Used to tell if the player pressed forward twice.
|
float |
timeInPortal
The amount of time an entity has been in a Portal
|
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, xpCooldownarrowHitTimer, 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, swingProgressIntaddedToChunk, 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 |
|---|
EntityPlayerSP(Minecraft mcIn,
World worldIn,
NetHandlerPlayClient netHandler,
StatFileWriter statFile) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChatComponentMessage(IChatComponent chatComponent) |
void |
addChatMessage(IChatComponent component)
Send a chat message to the CommandSender
|
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.
|
boolean |
canCommandSenderUseCommand(int permLevel,
java.lang.String commandName)
Returns
true if the CommandSender is allowed to execute the command, false if not |
void |
closeScreen()
set current crafting inventory back to the 2x2 square
|
void |
closeScreenAndDropStack() |
protected void |
damageEntity(DamageSource damageSrc,
float damageAmount)
Deals damage to the entity.
|
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) |
EntityItem |
dropOneItem(boolean dropAll)
Called when player presses the drop item key
|
java.lang.String |
getClientBrand() |
float |
getHorseJumpPower() |
BlockPos |
getPosition()
Get the position in the world.
|
StatFileWriter |
getStatFileWriter() |
void |
heal(float healAmount)
Heal living entity (param: amount of half-hearts)
|
protected boolean |
isCurrentViewEntity() |
boolean |
isRidingHorse() |
boolean |
isServerWorld()
Returns whether the entity is in a server world
|
boolean |
isSneaking()
Returns if this entity is sneaking.
|
boolean |
isUser()
returns true if this is an EntityPlayerSP, or the logged in player.
|
void |
joinEntityItemWithWorld(EntityItem itemIn)
Joins the passed in entity item with the world.
|
void |
mountEntity(Entity entityIn)
Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
|
void |
onCriticalHit(Entity entityHit)
Called when the player performs a critical hit on the Entity.
|
void |
onEnchantmentCritical(Entity entityHit) |
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 |
onUpdateWalkingPlayer()
called every tick when the player is on foot.
|
void |
openEditCommandBlock(CommandBlockLogic cmdBlockLogic) |
void |
openEditSign(TileEntitySign signTile) |
void |
playSound(java.lang.String name,
float volume,
float pitch) |
protected boolean |
pushOutOfBlocks(double x,
double y,
double z) |
void |
respawnPlayer() |
void |
sendChatMessage(java.lang.String message)
Sends a chat message from the player.
|
void |
sendHorseInventory() |
protected void |
sendHorseJump() |
void |
sendPlayerAbilities()
Sends the player's abilities to the server (if there is one).
|
void |
setClientBrand(java.lang.String brand) |
void |
setPlayerSPHealth(float health)
Updates health locally.
|
void |
setSprinting(boolean sprinting)
Set sprinting switch for Entity.
|
void |
setXPStats(float currentXP,
int maxXP,
int level)
Sets the current XP, total XP, and level number.
|
void |
swingItem()
Swings the item the player is holding.
|
void |
updateEntityActionState() |
getDownloadImageSkin, getFovModifier, getLocationCape, getLocationSkin, getLocationSkin, getPlayerInfo, getSkinType, hasPlayerInfo, hasSkin, isSpectatoraddExhaustion, addExperience, addExperienceLevel, addMovementStat, addPrefix, addScore, addSuffix, addToPlayerScore, applyEntityAttributes, attackTargetEntityWithCurrentItem, canAttackPlayer, canEat, canHarvestBlock, canOpen, canPlayerEdit, canTriggerWalking, clearItemInUse, clonePlayer, damageArmor, destroyCurrentEquippedItem, dropItem, dropPlayerItemWithRandomChoice, entityInit, fall, func_175145_a, 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, isUsingItem, isWearing, jump, moveEntityWithHeading, onDeath, onItemUseFinish, onKillEntity, openGui, preparePlayerToSpawn, readEntityFromNBT, refreshDisplayName, removeExperienceLevel, replaceItemInInventory, resetHeight, sendCommandFeedback, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setGameType, setInWeb, setItemInUse, setReducedDebug, setScore, setSpawnChunk, setSpawnPoint, shouldHeal, stopUsingItem, triggerAchievement, trySleep, updateItemUse, updateRidden, wakeUpPlayer, writeEntityToNBT, xpBarCapaddPotionEffect, 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, isChild, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, kill, knockBack, markPotionsDirty, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onNewPotionEffect, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, shouldRiderFaceForward, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadataaddEntityCrashInfo, 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, isSpectatedByPlayer, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, rayTrace, readFromNBT, registerExtendedProperties, resetEntityId, serializeNBT, setAir, setAlwaysRenderNameTag, setAngles, setCommandStat, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptionalpublic final NetHandlerPlayClient sendQueue
public MovementInput movementInput
protected Minecraft mc
protected int sprintToggleTimer
public int sprintingTicksLeft
public float renderArmYaw
public float renderArmPitch
public float prevRenderArmYaw
public float prevRenderArmPitch
public float timeInPortal
public float prevTimeInPortal
public EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statFile)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom in class EntityPlayerpublic void heal(float healAmount)
heal in class EntityLivingBasepublic void mountEntity(Entity entityIn)
mountEntity in class EntityLivingBasepublic void onUpdate()
onUpdate in class EntityPlayerpublic void onUpdateWalkingPlayer()
public EntityItem dropOneItem(boolean dropAll)
dropOneItem in class EntityPlayerpublic void joinEntityItemWithWorld(EntityItem itemIn)
joinEntityItemWithWorld in class EntityPlayerpublic void sendChatMessage(java.lang.String message)
public void swingItem()
swingItem in class EntityLivingBasepublic void respawnPlayer()
respawnPlayer in class EntityPlayerprotected void damageEntity(DamageSource damageSrc, float damageAmount)
damageEntity in class EntityPlayerpublic void closeScreen()
closeScreen in class EntityPlayerpublic void closeScreenAndDropStack()
public void setPlayerSPHealth(float health)
public void addStat(StatBase stat, int amount)
addStat in class EntityPlayerpublic void sendPlayerAbilities()
sendPlayerAbilities in class EntityPlayerpublic boolean isUser()
isUser in class EntityPlayerprotected void sendHorseJump()
public void sendHorseInventory()
public void setClientBrand(java.lang.String brand)
public java.lang.String getClientBrand()
public StatFileWriter getStatFileWriter()
public void addChatComponentMessage(IChatComponent chatComponent)
addChatComponentMessage in class EntityPlayerprotected boolean pushOutOfBlocks(double x,
double y,
double z)
pushOutOfBlocks in class Entitypublic void setSprinting(boolean sprinting)
setSprinting in class EntityLivingBasepublic void setXPStats(float currentXP,
int maxXP,
int level)
public void addChatMessage(IChatComponent component)
addChatMessage in interface ICommandSenderaddChatMessage in class Entitypublic boolean canCommandSenderUseCommand(int permLevel,
java.lang.String commandName)
true if the CommandSender is allowed to execute the command, false if notcanCommandSenderUseCommand in interface ICommandSendercanCommandSenderUseCommand in class Entitypublic BlockPos getPosition()
null is not allowed! If you are not an entity in the world, return
the coordinates 0, 0, 0getPosition in interface ICommandSendergetPosition in class Entitypublic void playSound(java.lang.String name,
float volume,
float pitch)
playSound in class EntityPlayerpublic boolean isServerWorld()
isServerWorld in class EntityLivingBasepublic boolean isRidingHorse()
public float getHorseJumpPower()
public void openEditSign(TileEntitySign signTile)
openEditSign in class EntityPlayerpublic void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
openEditCommandBlock in class EntityPlayerpublic void displayGUIBook(ItemStack bookStack)
displayGUIBook in class EntityPlayerpublic void displayGUIChest(IInventory chestInventory)
displayGUIChest in class EntityPlayerpublic void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
displayGUIHorse in class EntityPlayerpublic void displayGui(IInteractionObject guiOwner)
displayGui in class EntityPlayerpublic void displayVillagerTradeGui(IMerchant villager)
displayVillagerTradeGui in class EntityPlayerpublic void onCriticalHit(Entity entityHit)
onCriticalHit in class EntityPlayerpublic void onEnchantmentCritical(Entity entityHit)
onEnchantmentCritical in class EntityPlayerpublic boolean isSneaking()
isSneaking in class Entitypublic void updateEntityActionState()
updateEntityActionState in class EntityPlayerprotected boolean isCurrentViewEntity()
public void onLivingUpdate()
onLivingUpdate in class EntityPlayer