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, 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 |
---|
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, isSpectator
addExhaustion, 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, 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, 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, updatePotionMetadata
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, 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, writeToNBTOptional
public 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 EntityPlayer
public void heal(float healAmount)
heal
in class EntityLivingBase
public void mountEntity(Entity entityIn)
mountEntity
in class EntityLivingBase
public void onUpdate()
onUpdate
in class EntityPlayer
public void onUpdateWalkingPlayer()
public EntityItem dropOneItem(boolean dropAll)
dropOneItem
in class EntityPlayer
public void joinEntityItemWithWorld(EntityItem itemIn)
joinEntityItemWithWorld
in class EntityPlayer
public void sendChatMessage(java.lang.String message)
public void swingItem()
swingItem
in class EntityLivingBase
public void respawnPlayer()
respawnPlayer
in class EntityPlayer
protected void damageEntity(DamageSource damageSrc, float damageAmount)
damageEntity
in class EntityPlayer
public void closeScreen()
closeScreen
in class EntityPlayer
public void closeScreenAndDropStack()
public void setPlayerSPHealth(float health)
public void addStat(StatBase stat, int amount)
addStat
in class EntityPlayer
public void sendPlayerAbilities()
sendPlayerAbilities
in class EntityPlayer
public boolean isUser()
isUser
in class EntityPlayer
protected 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 EntityPlayer
protected boolean pushOutOfBlocks(double x, double y, double z)
pushOutOfBlocks
in class Entity
public void setSprinting(boolean sprinting)
setSprinting
in class EntityLivingBase
public void setXPStats(float currentXP, int maxXP, int level)
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 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 playSound(java.lang.String name, float volume, float pitch)
playSound
in class EntityPlayer
public boolean isServerWorld()
isServerWorld
in class EntityLivingBase
public boolean isRidingHorse()
public float getHorseJumpPower()
public void openEditSign(TileEntitySign signTile)
openEditSign
in class EntityPlayer
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
openEditCommandBlock
in class EntityPlayer
public void displayGUIBook(ItemStack bookStack)
displayGUIBook
in class EntityPlayer
public void displayGUIChest(IInventory chestInventory)
displayGUIChest
in class EntityPlayer
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
displayGUIHorse
in class EntityPlayer
public void displayGui(IInteractionObject guiOwner)
displayGui
in class EntityPlayer
public void displayVillagerTradeGui(IMerchant villager)
displayVillagerTradeGui
in class EntityPlayer
public void onCriticalHit(Entity entityHit)
onCriticalHit
in class EntityPlayer
public void onEnchantmentCritical(Entity entityHit)
onEnchantmentCritical
in class EntityPlayer
public boolean isSneaking()
isSneaking
in class Entity
public void updateEntityActionState()
updateEntityActionState
in class EntityPlayer
protected boolean isCurrentViewEntity()
public void onLivingUpdate()
onLivingUpdate
in class EntityPlayer