public class EntityPlayerSP extends AbstractClientPlayer
EntityPlayer.EnumChatVisibility, EntityPlayer.SleepResult
Modifier and Type | Field and Description |
---|---|
NetHandlerPlayClient |
connection |
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 |
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
|
rotateElytraX, rotateElytraY, rotateElytraZ
bedLocation, cameraYaw, capabilities, chasingPosX, chasingPosY, chasingPosZ, experience, experienceLevel, experienceTotal, eyeHeight, fishEntity, flyToggleTimer, foodStats, inventory, inventoryContainer, MAIN_HAND, openContainer, PERSISTED_NBT_TAG, PLAYER_MODEL_FLAG, prevCameraYaw, prevChasingPosX, prevChasingPosY, prevChasingPosZ, renderOffsetX, renderOffsetY, renderOffsetZ, sleeping, speedInAir, speedOnGround, xpCooldown
activeItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, HAND_STATES, hurtTime, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180
addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world
Constructor and Description |
---|
EntityPlayerSP(Minecraft mcIn,
World worldIn,
NetHandlerPlayClient netHandler,
StatisticsManager statFile) |
Modifier and Type | Method and Description |
---|---|
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 |
canUseCommand(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 |
dismountRidingEntity() |
void |
displayGui(IInteractionObject guiOwner) |
void |
displayGUIChest(IInventory chestInventory)
Displays the GUI for interacting with a chest inventory.
|
void |
displayGuiCommandBlock(TileEntityCommandBlock commandBlock) |
void |
displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock) |
void |
displayVillagerTradeGui(IMerchant villager) |
EntityItem |
dropItem(boolean dropAll)
Drop one item out of the currently selected stack if
dropAll is false. |
ItemStack |
dropItemAndGetStack(EntityItem p_184816_1_) |
EnumHand |
getActiveHand() |
float |
getHorseJumpPower() |
Vec3d |
getLook(float partialTicks)
interpolated look vector
|
int |
getPermissionLevel() |
BlockPos |
getPosition()
Get the position in the world.
|
java.lang.String |
getServerBrand()
Gets the brand of the currently connected server.
|
StatisticsManager |
getStatFileWriter() |
void |
handleStatusUpdate(byte id) |
void |
heal(float healAmount)
Heal living entity (param: amount of half-hearts)
|
boolean |
isAutoJumpEnabled() |
protected boolean |
isCurrentViewEntity() |
boolean |
isHandActive() |
boolean |
isRidingHorse() |
boolean |
isRowingBoat() |
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 |
move(MoverType type,
double x,
double y,
double z)
Tries to move the entity towards the specified location.
|
void |
notifyDataManagerChange(DataParameter<?> key) |
void |
onCriticalHit(Entity entityHit)
Called when the entity is dealt a critical hit.
|
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 |
openBook(ItemStack stack,
EnumHand hand) |
void |
openEditSign(TileEntitySign signTile) |
void |
openEditStructure(TileEntityStructure structure) |
void |
openGuiHorseInventory(AbstractHorse horse,
IInventory inventoryIn) |
void |
playSound(SoundEvent soundIn,
float volume,
float pitch) |
protected boolean |
pushOutOfBlocks(double x,
double y,
double z) |
PotionEffect |
removeActivePotionEffect(Potion potioneffectin)
Removes the given potion effect from the active potion map and returns it.
|
void |
resetActiveHand() |
void |
respawnPlayer() |
void |
sendChatMessage(java.lang.String message)
Sends a chat message from the player.
|
void |
sendHorseInventory() |
protected void |
sendHorseJump() |
void |
sendMessage(ITextComponent component)
Send a chat message to the CommandSender
|
void |
sendPlayerAbilities()
Sends the player's abilities to the server (if there is one).
|
void |
sendStatusMessage(ITextComponent chatComponent,
boolean actionBar) |
void |
setActiveHand(EnumHand hand) |
void |
setPermissionLevel(int p_184839_1_) |
void |
setPlayerSPHealth(float health)
Updates health locally.
|
void |
setServerBrand(java.lang.String brand)
Sets the brand of the currently connected server.
|
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.
|
boolean |
startRiding(Entity entityIn,
boolean force) |
void |
swingArm(EnumHand hand) |
protected void |
updateAutoJump(float p_189810_1_,
float p_189810_2_) |
void |
updateEntityActionState() |
void |
updateRidden()
Handles updating while being ridden by an entity
|
getDownloadImageSkin, getFovModifier, getLocationCape, getLocationElytra, getLocationSkin, getLocationSkin, getPlayerInfo, getSkinType, hasPlayerInfo, hasSkin, isCreative, isPlayerInfoSet, isSpectator
addExhaustion, addExperience, addExperienceLevel, addMovementStat, addPrefix, addScore, addStat, addSuffix, addToPlayerScore, applyEntityAttributes, applyEntityCollision, attackTargetEntityWithCurrentItem, blockUsingShield, canAttackPlayer, canEat, canHarvestBlock, canOpen, canPlayerEdit, canTriggerWalking, canUseCommandBlock, clonePlayer, createCooldownTracker, damageArmor, damageShield, destroyVanishingCursedItems, disableShield, dropItem, dropItem, entityInit, fall, func_191521_c, getAbsorptionAmount, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArmorInventoryList, getArmorVisibility, getBedLocation, getBedLocation, getBedOrientationInDegrees, getBedSpawnLocation, getCapability, getCooldownPeriod, getCooldownTracker, getCooledAttackStrength, getDeathSound, getDefaultEyeHeight, getDigSpeed, getDigSpeed, getDisplayName, getDisplayNameString, getExperiencePoints, getEyeHeight, getFallSound, getFireImmuneTicks, getFoodStats, getGameProfile, getHeldEquipment, getHurtSound, getInventoryEnderChest, getItemStackFromSlot, getLuck, getMaxInPortalTime, getName, getOfflineUUID, getPortalCooldown, getPrefixes, getPrimaryHand, getScore, getSleepTimer, getSoundCategory, getSpawnDimension, getSplashSound, getSuffixes, getSwimSound, getTeam, getUUID, getWorldScoreboard, getXPSeed, getYOffset, hasAchievement, hasCapability, hasReducedDebug, hasSpawnDimension, interactOn, isAllowEdit, isEntityInsideOpaqueBlock, isInvisibleToPlayer, isMovementBlocked, isPlayer, isPlayerFullyAsleep, isPlayerSleeping, isPushedByWater, isSpawnForced, isSpawnForced, isWearing, jump, moveEntityWithHeading, onDeath, onKillEntity, openGui, preparePlayerToSpawn, readEntityFromNBT, refreshDisplayName, registerFixesPlayer, removeExperienceLevel, replaceItemInInventory, resetCooldown, resetHeight, sendCommandFeedback, setAbsorptionAmount, setDead, setGameType, setInWeb, setItemStackToSlot, setPrimaryHand, setReducedDebug, setScore, setSpawnChunk, setSpawnDimension, setSpawnPoint, shouldHeal, spawnSweepParticles, takeStat, trySleep, updateSize, wakeUpPlayer, writeEntityToNBT, xpBarCap
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, areAllPotionsAmbient, attackable, attackEntityAsMob, attemptTeleport, canBeCollidedWith, canBeHitWithPotion, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, decreaseAirSupply, dismountEntity, dropEquipment, dropFewItems, dropLoot, frostWalk, getActiveItemStack, getActivePotionEffect, getActivePotionEffects, getAge, getAITarget, getArrowCountInEntity, getAttackingEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getEntityAttribute, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLastDamageSource, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, getTicksElytraFlying, getTotalArmorValue, getWaterSlowDown, handleJumpLava, handleJumpWater, hasItemInSlot, isActiveItemStackBlocking, isChild, isElytraFlying, isEntityAlive, isEntityUndead, isOnLadder, isPotionActive, isPotionApplicable, kill, knockBack, markPotionsDirty, onChangedPotionEffect, onDeathUpdate, onEntityUpdate, onFinishedPotionEffect, onItemPickup, onItemUseFinish, onKillCommand, onNewPotionEffect, performHurtAnimation, playEquipSound, playHurtSound, removePotionEffect, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAIMoveSpeed, setArrowCountInEntity, setBeenAttacked, setHealth, setHeldItem, setJumping, setLastAttacker, setPositionAndRotationDirect, setRenderYawOffset, setRevengeTarget, setRotationYawHead, shouldRiderFaceForward, stopActiveHand, updateActiveHand, updateArmSwingProgress, updateDistance, updateFallState, updateItemUse, updatePotionEffects, updatePotionMetadata
addEntityCrashInfo, addPassenger, addTag, addTrackingPlayer, addVelocity, applyEnchantments, applyOrientationToEntity, applyPlayerInteraction, canBeAttackedWithItem, canBeRidden, canFitPassenger, canPassengerSteer, canRenderOnFire, canRiderInteract, canTrample, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getFlag, getForward, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLowestRidingEntity, getMaxFallHeight, getMirroredYaw, getMountedYOffset, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getServer, getTags, getTeleportDirection, getUniqueID, getVectorForRotation, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isPassenger, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSpectatedByPlayer, isSprinting, isWet, moveRelative, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onCollideWithPlayer, onStruckByLightning, playStepSound, processInitialInteract, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, resetEntityId, resetPositionToBB, serializeNBT, setAir, setAlwaysRenderNameTag, setCommandStat, setCommandStats, setCustomNameTag, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRotation, setSilent, setSize, setSneaking, setUniqueId, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, toString, turn, updatePassenger, verifyExplosion, writeToNBT, writeToNBTAtomically, writeToNBTOptional
public final NetHandlerPlayClient connection
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, StatisticsManager statFile)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class EntityPlayer
public void heal(float healAmount)
heal
in class EntityLivingBase
public boolean startRiding(Entity entityIn, boolean force)
startRiding
in class Entity
public void dismountRidingEntity()
dismountRidingEntity
in class EntityPlayer
public Vec3d getLook(float partialTicks)
getLook
in class EntityLivingBase
public void onUpdate()
onUpdate
in class EntityPlayer
public void onUpdateWalkingPlayer()
public EntityItem dropItem(boolean dropAll)
dropAll
is false. If dropItem
is true the
entire stack is dropped.dropItem
in class EntityPlayer
public ItemStack dropItemAndGetStack(EntityItem p_184816_1_)
dropItemAndGetStack
in class EntityPlayer
public void sendChatMessage(java.lang.String message)
public void swingArm(EnumHand hand)
swingArm
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 setServerBrand(java.lang.String brand)
MC|Brand
plugin channel, and is used to identify modded servers in crash reports.public java.lang.String getServerBrand()
MC|Brand
plugin channel, and is used to identify modded servers
in crash reports.public StatisticsManager getStatFileWriter()
public int getPermissionLevel()
public void setPermissionLevel(int p_184839_1_)
public void sendStatusMessage(ITextComponent chatComponent, boolean actionBar)
sendStatusMessage
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 sendMessage(ITextComponent component)
sendMessage
in interface ICommandSender
sendMessage
in class Entity
public boolean canUseCommand(int permLevel, java.lang.String commandName)
true
if the CommandSender is allowed to execute the command, false
if notcanUseCommand
in interface ICommandSender
canUseCommand
in class Entity
public void handleStatusUpdate(byte id)
handleStatusUpdate
in class EntityPlayer
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(SoundEvent soundIn, float volume, float pitch)
playSound
in class EntityPlayer
public boolean isServerWorld()
isServerWorld
in class EntityLivingBase
public void setActiveHand(EnumHand hand)
setActiveHand
in class EntityLivingBase
public boolean isHandActive()
isHandActive
in class EntityLivingBase
public void resetActiveHand()
resetActiveHand
in class EntityLivingBase
public EnumHand getActiveHand()
getActiveHand
in class EntityLivingBase
public void notifyDataManagerChange(DataParameter<?> key)
notifyDataManagerChange
in class EntityLivingBase
public boolean isRidingHorse()
public float getHorseJumpPower()
public void openEditSign(TileEntitySign signTile)
openEditSign
in class EntityPlayer
public void displayGuiEditCommandCart(CommandBlockBaseLogic commandBlock)
displayGuiEditCommandCart
in class EntityPlayer
public void displayGuiCommandBlock(TileEntityCommandBlock commandBlock)
displayGuiCommandBlock
in class EntityPlayer
public void openEditStructure(TileEntityStructure structure)
openEditStructure
in class EntityPlayer
public void openBook(ItemStack stack, EnumHand hand)
openBook
in class EntityPlayer
public void displayGUIChest(IInventory chestInventory)
displayGUIChest
in class EntityPlayer
public void openGuiHorseInventory(AbstractHorse horse, IInventory inventoryIn)
openGuiHorseInventory
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
public void updateRidden()
updateRidden
in class EntityPlayer
public boolean isRowingBoat()
public PotionEffect removeActivePotionEffect(Potion potioneffectin)
removeActivePotionEffect
in class EntityLivingBase
public void move(MoverType type, double x, double y, double z)
public boolean isAutoJumpEnabled()
protected void updateAutoJump(float p_189810_1_, float p_189810_2_)