Package net.minecraft.src
Class EntityPlayerSP
java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityLivingBase
net.minecraft.src.EntityPlayer
net.minecraft.src.AbstractClientPlayer
net.minecraft.src.EntityPlayerSP
- All Implemented Interfaces:
ICommandSender
- Direct Known Subclasses:
EntityClientPlayerMP
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanprotected MinecraftfloatfloatfloatThe amount of time an entity has been in a Portal the previous tickfloatfloatintTicks left before sprinting is disabled.protected intUsed to tell if the player pressed forward twice.floatThe amount of time an entity has been in a PortalFields inherited from class net.minecraft.src.AbstractClientPlayer
locationStevePngFields inherited from class net.minecraft.src.EntityPlayer
airRecoveryCountdown, cameraYaw, capabilities, currentMiningSpeedModifier, deathCount, EXHAUSTION_JUMPING, EXHAUSTION_JUMPING_SPRINTING, experience, experienceLevel, experienceTotal, field_71079_bU, field_71082_cx, field_71085_bR, field_71089_bV, field_71091_bM, field_71094_bP, field_71095_bQ, field_71096_bN, field_71097_bO, fishEntity, flyToggleTimer, foodStats, GLOOM_COUNTER_BETWEEN_STATE_CHANGES, hardcoreSpawnChunk, inGloomCounter, inventory, inventoryContainer, lastDeathDimension, lastDeathLocationX, lastDeathLocationY, lastDeathLocationZ, openContainer, playerLocation, prevCameraYaw, respawnAssignmentCooldownTimer, sleeping, spawnDimension, speedInAir, speedOnGround, ticksSinceEmoteSound, timeOfLastDimensionSwitch, timeOfLastSpawnAssignment, timerSpeedModifier, timesCraftedThisTick, username, xpCooldownFields inherited from class net.minecraft.src.EntityLivingBase
arrowHitTimer, attackedAtYaw, attackingPlayer, attackTime, cameraPitch, dead, deathTime, entityAge, entityLivingToAttack, field_110154_aX, field_70741_aB, field_70763_ax, field_70764_aw, field_70768_au, field_70769_ao, field_70770_ap, hurtTime, isJumping, isLivingDead, isSwingInProgress, jumpMovementFactor, landMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onChoppingBlockMaxCountdown, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, recentlyOnChoppingBlockCountdown, renderYawOffset, revengeCountdown, revengeTimer, rotationYawHead, scoreValue, swingProgress, swingProgressIntFields inherited from class net.minecraft.src.Entity
addedToChunk, boundingBox, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastGroundPosX, lastGroundPosY, lastGroundPosZ, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, nextBlockCheckDistance, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize -
Constructor Summary
ConstructorsConstructorDescriptionEntityPlayerSP(Minecraft par1Minecraft, World par2World, Session par3Session, int par4) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChatMessage(String par1Str) Add a chat message to the playervoidaddExhaustion(float fAmount) increases exhaustion level by supplied amountvoidaddExhaustionWithoutVisualFeedback(float fAmount) voidAdds a value to a statistic field.booleancanCommandSenderUseCommand(int par1, String par2Str) Returns true if the command sender is allowed to use the given command.voidsets current screen to null (used on escape buttons of GUIs)voiddisplayGUIAnvil(int par1, int par2, int par3) Displays the GUI for interacting with an anvil.voiddisplayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) Displays the GUI for interacting with a beacon.voiddisplayGUIBook(ItemStack par1ItemStack) Displays the GUI for interacting with a book.voiddisplayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) Displays the GUI for interacting with a brewing stand.voiddisplayGUIChest(IInventory par1IInventory) Displays the GUI for interacting with a chest inventory.voiddisplayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) Displays the dipsenser GUI for the passed in dispenser entity.voiddisplayGUIEditSign(TileEntity par1TileEntity) Displays the GUI for editing a sign.voiddisplayGUIEnchantment(int par1, int par2, int par3, String par4Str) voiddisplayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) Displays the furnace GUI for the passed in furnace entity.voiddisplayGUIHopper(TileEntityHopper par1TileEntityHopper) voiddisplayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) voiddisplayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) voiddisplayGUIMerchant(IMerchant par1IMerchant, String par2Str) voiddisplayGUIWorkbench(int par1, int par2, int par3) Displays the crafting GUI for a workbench.protected void<T> TgetData(DataEntry.PlayerDataEntry<T> entry) floatGets the player's field of view multiplier.Returns the item that this EntityLiving is holding, if any.floatReturn the position for this command sender.booleanReturns whether the entity is in a local (client) worldbooleanbooleanbooleanReturns if this entity is sneaking.booleanvoidonCriticalHit(Entity par1Entity) Called when the player performs a critical hit on the Entity.voidonEnchantmentCritical(Entity par1Entity) voidonItemPickup(Entity par1Entity, int par2) Called whenever an item is picked up from walking over it.voidCalled frequently so the entity can update its state every tick as required.void/* the playSound function both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same playervoidplaySoundInRandomDirection(String sSoundName, float fVolume, float fPitch, double dDistance) protected booleanpushOutOfBlocks(double par1, double par3, double par5) Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, zvoidsendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) <T> voidsetData(DataEntry.PlayerDataEntry<T> entry, T value) voidsetPlayerSPHealth(float par1) Updates health locally.voidsetSprinting(boolean par1) Set sprinting switch for Entity.voidsetXPStats(float par1, int par2, int par3) Sets the current XP, total XP, and level number.voidprotected voidMethods inherited from class net.minecraft.src.AbstractClientPlayer
getDownloadImageCape, getDownloadImageSkin, getLocationCape, getLocationCape, getLocationSkin, getLocationSkin, getLocationSkull, getTextureCape, getTextureSkin, setupCustomSkinMethods inherited from class net.minecraft.src.EntityPlayer
addExhaustionForJump, addExperience, addExperienceLevel, addHarvestBlockExhaustion, addMovementStat, addRawChatMessage, addScore, addStackToCurrentHeldStackIfEmpty, addToPlayerScore, appliesConstantForceWhenRidingBoat, applyEntityAttributes, attackEntityFrom, attackTargetEntityWithCurrentItem, canAttackPlayer, canDrink, canEat, canHarvestBlock, canJump, canPlayerEdit, canSwim, canTriggerWalking, clearItemInUse, clonePlayer, damageArmor, damageEntity, decreaseAirSupply, destroyCurrentEquippedItem, detonateCarriedBlastingOil, dismountEntity, doesStatusPreventSprinting, dropHead, dropOneItem, dropPlayerItem, dropPlayerItemWithRandomChoice, entityInit, fall, getAbsorptionAmount, getAIMoveSpeed, getAllActiveStatusEffects, getAlwaysRenderNameTagForRender, getAnimalKickMovementMultiplier, getArmorExhaustionModifier, getArmorVisibility, getAttackDamageModifierFromEffects, getBedLocation, getBedOrientationInDegrees, getBowPullStrengthModifier, getCanBeHeadCrabbed, getCommandSenderName, getCurrentArmor, getCurrentEquippedItem, getCurrentItemOrArmor, getCurrentPlayerStrVsBlock, getEntityName, getEntityWorld, getExperiencePoints, getEyeHeight, getFoodStats, getGloomLevel, getHideCape, getHideCape, getInventoryEnderChest, getItemIcon, getItemInUse, getItemInUseCount, getItemInUseDuration, getJumpingHorizontalMovementModifier, getLadderVerticalMovementModifier, getLandMovementModifier, getLastActiveItems, getMaxInPortalTime, getMeleeDamageModifier, getMiningSpeedModifier, getMiningSpeedModifierFromEffects, getMountedYOffset, getMovementSpeedModifierFromEffects, getPortalCooldown, getScore, getSleepTimer, getSpawnChunksVisualizationLocationI, getSpawnChunksVisualizationLocationJ, getSpawnChunksVisualizationLocationK, getStatusForCategory, getStongestMagneticPointForLocationI, getStongestMagneticPointForLocationK, getSwimmingHorizontalModifier, getTeam, getTimeOfLastSpawnAssignment, getTimerSpeedModifier, getTranslatedEntityName, getValidatedRespawnCoordinates, getWorldScoreboard, getYOffset, handleHealthUpdate, hasRespawnCoordinates, hasValidMagneticPointForLocation, installationIntegrityTestPlayer, interactWith, isBlocking, isCarryingBlastingOil, isCurrentToolAdventureModeExempt, isEntityInsideOpaqueBlock, isImmuneToHeadCrabDamage, isInvisibleToPlayer, isMovementBlocked, isOnLadder, isPlayer, isPlayerFullyAsleep, isPlayerHoldingSail, isPlayerSleeping, isPushedByWater, isSpawnForced, isUsingItem, isValidOngoingAttackTargetForSquid, isWearingEnderSpectacles, isWearingFullSuitSoulforgedArmor, isWearingSoulforgedBoots, isWearingSoulforgedHelm, joinEntityItemWithWorld, jump, mountEntity, mountEntityRemote, moveEntityWithHeading, movementModifierWhenRidingBoat, onBlockedDamage, onCantConsume, onDeath, onItemUseFinish, onKillEntity, onUpdate, onZeroDamageAttack, playStepSound, preparePlayerToSpawn, readEntityFromNBT, readModDataFromNBT, recoverAirSupply, resetHeight, resetTimerSpeedModifier, respawnPlayer, sendPlayerAbilities, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setGameType, setGloomLevel, setHasValidMagneticPointForLocation, setHideCape, setInWeb, setItemInUse, setItemInUseCount, setMiningSpeedModifier, setScore, setSpawnChunk, setSpawnChunk, setSpawnChunksVisualization, setStrongestMagneticPointForLocationI, setStrongestMagneticPointForLocationK, setTimeOfLastSpawnAssignment, setTimerSpeedModifier, setUsingSpecialKey, shouldHeal, sleepInBedAt, stopUsingItem, triggerAchievement, updateItemUse, updateMiningSpeedModifier, updateRidden, validateBoundRespawnBeacon, verifyRespawnCoordinates, wakeUpPlayer, writeEntityToNBT, writeModDataToNBT, xpBarCapMethods inherited from class net.minecraft.src.EntityLivingBase
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, canJumpMidWater, checkForHeadDrop, checkForRareDrop, checkForScrollDrop, clearActivePotions, collideWithEntity, collideWithNearbyEntities, dropEquipment, dropFewItems, dropRareDrop, entityLivingBaseFall, entityLivingOnDeath, func_110142_aN, func_110146_f, func_142015_aE, func_94060_bK, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getAmbientLootingModifier, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getDeathSound, getDefaultSlipperinessOnGround, getEntityAttribute, getHealth, getHealthAndExhaustionModifier, getHurtSound, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getMeleeAttackStrength, getPosition, getRNG, getRotationYawHead, getSlipperinessRelativeToBlock, getSoundPitch, getSoundVolume, getSpeedModifier, getSwingProgress, getTotalArmorValue, heal, isAIEnabled, isChild, isEntityAlive, isEntityUndead, isOnSameTeam, isOnTeam, isPotionActive, isPotionActive, isPotionApplicable, isWeighted, isWeightedByHeadCrab, kill, knockBack, knockbackMagnitude, mouseOverCustomRayTrace, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onNewPotionEffect, performHurtAnimation, rayTrace, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, swingItem, updateAITasks, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffectsMethods inherited from class net.minecraft.src.Entity
addComponent, addEntityCrashInfo, addVelocity, applyEntityCollision, attractsLightning, canAttackWithItem, canCollideWithEntity, canEntityTriggerTripwire, canRenderOnFire, copyDataFrom, copyLocationAndAnglesFrom, dealFireDamage, doBlockCollisions, doesEntityApplyToSpawnCap, doesEntityApplyToSquidPossessionCap, doesEntityNotTriggerPressurePlate, doesNotDismountInWater, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, flagAllWatchedObjectsDirty, flingAwayFromEntity, getAir, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getComponent, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityString, getFlag, getHeadCrabSharedAttackTarget, getMaxSafePointTries, getParts, getShadowSize, getTeleportDirection, getUniqueID, getVisualBoundingBox, getXZDistanceSqToEntity, handleLavaMovement, handleWaterMovement, hasComponent, hashCode, hasHeadCrabbedSquid, hitByEntity, initComponents, interactFirst, isAffectedByMovementModifiers, isBeingRainedOn, isBurning, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInsideSuffocatingBlock, isEntityInsideSuffocatingBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInWater, isItemEntity, isOffsetPositionInLiquid, isRiding, isSecondaryTargetForSquid, isSprinting, isValidZombieSecondaryTarget, isWet, moveEntity, moveFlying, newDoubleNBTList, newFloatNBTList, notifyOfWolfHowl, onBlockDispenserConsume, onChunkLoad, onCollideWithPlayer, onFlungBySquidTentacle, onHeadCrabbedBySquid, onKickedByAnimal, onPossessedRidingEntityDeath, onStruckByLightning, outOfUpdateRangeUpdate, readFromNBT, setAir, setAngles, setEating, setFire, setFlag, setInPortal, setInvisible, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setRotation, setSize, setSneaking, setVelocity, setWorld, shouldExplodeBlock, shouldSetPosAfterLoading, shouldSetPositionOnLoad, toString, travelToDimension, tryToSetFireToBlocksInContact, updateCloak, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Field Details
-
movementInput
-
mc
-
sprintToggleTimer
protected int sprintToggleTimerUsed to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to sprint, aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable sprinting. -
sprintingTicksLeft
public int sprintingTicksLeftTicks left before sprinting is disabled. -
renderArmYaw
public float renderArmYaw -
renderArmPitch
public float renderArmPitch -
prevRenderArmYaw
public float prevRenderArmYaw -
prevRenderArmPitch
public float prevRenderArmPitch -
timeInPortal
public float timeInPortalThe amount of time an entity has been in a Portal -
prevTimeInPortal
public float prevTimeInPortalThe amount of time an entity has been in a Portal the previous tick -
exhaustionAddedSinceLastGuiUpdate
public boolean exhaustionAddedSinceLastGuiUpdate
-
-
Constructor Details
-
EntityPlayerSP
-
-
Method Details
-
updateEntityActionState
public void updateEntityActionState()- Overrides:
updateEntityActionStatein classEntityPlayer
-
onLivingUpdate
public void onLivingUpdate()Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.- Overrides:
onLivingUpdatein classEntityPlayer
-
getFOVMultiplier
public float getFOVMultiplier()Gets the player's field of view multiplier. (ex. when flying) -
closeScreen
public void closeScreen()sets current screen to null (used on escape buttons of GUIs)- Overrides:
closeScreenin classEntityPlayer
-
displayGUIEditSign
Displays the GUI for editing a sign. Args: tileEntitySign- Overrides:
displayGUIEditSignin classEntityPlayer
-
displayGUIBook
Displays the GUI for interacting with a book.- Overrides:
displayGUIBookin classEntityPlayer
-
displayGUIChest
Displays the GUI for interacting with a chest inventory. Args: chestInventory- Overrides:
displayGUIChestin classEntityPlayer
-
displayGUIHopper
- Overrides:
displayGUIHopperin classEntityPlayer
-
displayGUIHorse
- Overrides:
displayGUIHorsein classEntityPlayer
-
displayGUIHopperMinecart
- Overrides:
displayGUIHopperMinecartin classEntityPlayer
-
displayGUIWorkbench
public void displayGUIWorkbench(int par1, int par2, int par3) Displays the crafting GUI for a workbench.- Overrides:
displayGUIWorkbenchin classEntityPlayer
-
displayGUIEnchantment
- Overrides:
displayGUIEnchantmentin classEntityPlayer
-
displayGUIAnvil
public void displayGUIAnvil(int par1, int par2, int par3) Displays the GUI for interacting with an anvil.- Overrides:
displayGUIAnvilin classEntityPlayer
-
displayGUIFurnace
Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace- Overrides:
displayGUIFurnacein classEntityPlayer
-
displayGUIBrewingStand
Displays the GUI for interacting with a brewing stand.- Overrides:
displayGUIBrewingStandin classEntityPlayer
-
displayGUIBeacon
Displays the GUI for interacting with a beacon.- Overrides:
displayGUIBeaconin classEntityPlayer
-
displayGUIDispenser
Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser- Overrides:
displayGUIDispenserin classEntityPlayer
-
displayGUIMerchant
- Overrides:
displayGUIMerchantin classEntityPlayer
-
onCriticalHit
Called when the player performs a critical hit on the Entity. Args: entity that was hit critically- Overrides:
onCriticalHitin classEntityPlayer
-
onEnchantmentCritical
- Overrides:
onEnchantmentCriticalin classEntityPlayer
-
onItemPickup
Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize- Overrides:
onItemPickupin classEntityLivingBase
-
isSneaking
public boolean isSneaking()Returns if this entity is sneaking.- Overrides:
isSneakingin classEntity
-
isUsingSpecialKey
public boolean isUsingSpecialKey()- Overrides:
isUsingSpecialKeyin classEntityPlayer
-
setPlayerSPHealth
public void setPlayerSPHealth(float par1) Updates health locally. -
addChatMessage
Add a chat message to the player- Overrides:
addChatMessagein classEntityPlayer
-
addStat
Adds a value to a statistic field.- Overrides:
addStatin classEntityPlayer
-
pushOutOfBlocks
protected boolean pushOutOfBlocks(double par1, double par3, double par5) Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z- Overrides:
pushOutOfBlocksin classEntity
-
setSprinting
public void setSprinting(boolean par1) Set sprinting switch for Entity.- Overrides:
setSprintingin classEntityLivingBase
-
setXPStats
public void setXPStats(float par1, int par2, int par3) Sets the current XP, total XP, and level number. -
sendChatToPlayer
-
canCommandSenderUseCommand
Returns true if the command sender is allowed to use the given command. -
getPlayerCoordinates
Return the position for this command sender. -
getHeldItem
Returns the item that this EntityLiving is holding, if any.- Overrides:
getHeldItemin classEntityPlayer
-
playSound
Description copied from class:EntityPlayer/* the playSound function both plays the sound locally on the client, and plays it remotely on the server without it being sent again to the same player- Overrides:
playSoundin classEntityPlayer
-
addExhaustion
public void addExhaustion(float fAmount) Description copied from class:EntityPlayerincreases exhaustion level by supplied amount- Overrides:
addExhaustionin classEntityPlayer
-
addExhaustionWithoutVisualFeedback
public void addExhaustionWithoutVisualFeedback(float fAmount) - Overrides:
addExhaustionWithoutVisualFeedbackin classEntityPlayer
-
updateGloomState
protected void updateGloomState()- Overrides:
updateGloomStatein classEntityPlayer
-
playSoundInRandomDirection
public void playSoundInRandomDirection(String sSoundName, float fVolume, float fPitch, double dDistance) -
isClientWorld
public boolean isClientWorld()Returns whether the entity is in a local (client) world- Overrides:
isClientWorldin classEntityLivingBase
-
isRidingHorse
public boolean isRidingHorse() -
getHorseJumpPower
public float getHorseJumpPower() -
func_110318_g
protected void func_110318_g() -
isLocalPlayerAndHittingBlock
public boolean isLocalPlayerAndHittingBlock()- Overrides:
isLocalPlayerAndHittingBlockin classEntityPlayer
-
getData
- Specified by:
getDatain classEntityPlayer
-
setData
- Specified by:
setDatain classEntityPlayer
-