Package net.minecraft.client.entity
Class EntityPlayerSP
- java.lang.Object
-
- All Implemented Interfaces:
ICommandSender,org.teavm.jso.JSObject
public class EntityPlayerSP extends AbstractClientPlayer
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraft.entity.player.EntityPlayer
EntityPlayer.EnumChatVisibility, EntityPlayer.EnumStatus
-
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected MinecraftmcMovementInputmovementInputfloatprevRenderArmPitchfloatprevRenderArmYawfloatprevTimeInPortalfloatrenderArmPitchfloatrenderArmYawNetHandlerPlayClientsendQueueintsprintingTicksLeftfloattimeInPortal-
Fields inherited from class net.minecraft.entity.player.EntityPlayer
cameraYaw, capabilities, chasingPosX, chasingPosY, chasingPosZ, experience, experienceLevel, experienceTotal, fishEntity, flyToggleTimer, foodStats, inventory, inventoryContainer, openContainer, playerLocation, prevCameraYaw, prevChasingPosX, prevChasingPosY, prevChasingPosZ, renderOffsetX, renderOffsetY, renderOffsetZ, sleeping, speedInAir, speedOnGround, xpCooldown
-
Fields inherited from class net.minecraft.entity.EntityLivingBase
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
-
Fields inherited from class net.minecraft.entity.Entity
addedToChunk, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, 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 Summary
Constructors Constructor Description EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChatComponentMessage(IChatComponent chatComponent)voidaddChatMessage(IChatComponent ichatcomponent)+ Send a chat message to the CommandSendervoidaddStat(StatBase stat, int amount)+ Adds a value to a statistic field.booleanattackEntityFrom(DamageSource source, float amount)+ Called when the entity is attacked.booleancanCommandSenderUseCommand(int i, java.lang.String var2)+ Returnstrueif the CommandSender is allowed to execute the command,falseif notvoidcloseScreen()+ set current crafting inventory back to the 2x2 squarevoidcloseScreenAndDropStack()protected voiddamageEntity(DamageSource damageSrc, float damageAmount)+ Deals damage to the entity.voiddisplayGui(IInteractionObject guiOwner)voiddisplayGUIBook(ItemStack bookStack)+ Displays the GUI for interacting with a book.voiddisplayGUIChest(IInventory chestInventory)+ Displays the GUI for interacting with a chest inventory.voiddisplayGUIHorse(EntityHorse horse, IInventory horseInventory)voiddisplayVillagerTradeGui(IMerchant villager)EntityItemdropOneItem(boolean dropAll)+ Called when player presses the drop item keyjava.lang.StringgetClientBrand()floatgetHorseJumpPower()BlockPosgetPosition()+ Get the position in the world.StatFileWritergetStatFileWriter()voidheal(float healAmount)+ Heal living entity (param: amount of half-hearts)booleanisCurrentViewEntity()booleanisRidingHorse()booleanisServerWorld()+ Returns whether the entity is in a server worldbooleanisSneaking()+ Returns if this entity is sneaking.booleanisUser()+ returns true if this is an EntityPlayerSP, or the logged in player.protected voidjoinEntityItemWithWorld(EntityItem itemIn)+ Joins the passed in entity item with the world.voidloadPluginData(BaseData data)PluginDatamakePluginData()voidmountEntity(Entity entityIn)+ Called when a player mounts an entity.voidonCriticalHit(Entity entityHit)+ Called when the player performs a critical hit on the Entity.voidonEnchantmentCritical(Entity entityHit)voidonLivingUpdate()+ Called frequently so the entity can update its state every tick as required.voidonUpdate()+ Called to update the entity's position/logic.voidonUpdateWalkingPlayer()+ called every tick when the player is on foot.voidopenEditCommandBlock(CommandBlockLogic cmdBlockLogic)voidopenEditSign(TileEntitySign signTile)voidplaySound(java.lang.String name, float volume, float pitch)protected booleanpushOutOfBlocks(double x, double y, double z)voidrespawnPlayer()voidsendChatMessage(java.lang.String message)+ Sends a chat message from the player.voidsendHorseInventory()protected voidsendHorseJump()voidsendPlayerAbilities()+ Sends the player's abilities to the server (if there is one).voidsetClientBrand(java.lang.String brand)voidsetPlayerSPHealth(float health)+ Updates health locally.voidsetSprinting(boolean sprinting)+ Set sprinting switch for Entity.voidsetXPStats(float currentXP, int maxXP, int level)+ Sets the current XP, total XP, and level number.voidswingItem()+ Swings the item the player is holding.voidupdateEntityActionState()-
Methods inherited from class net.minecraft.client.entity.AbstractClientPlayer
getFovModifier, getLocationCape, getLocationSkin, getPlayerInfo, getSkinType, hasPlayerInfo, hasSkin, isSpectator
-
Methods inherited from class net.minecraft.entity.player.EntityPlayer
addExhaustion, addExperience, addExperienceLevel, addMovementStat, addScore, 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, getBedOrientationInDegrees, getBedSpawnLocation, getCurrentArmor, getCurrentEquippedItem, getDeathSound, getDisplayName, getEquipmentInSlot, getExperiencePoints, getEyeHeight, getFallSoundString, getFoodStats, getGameProfile, getHeldItem, getHurtSound, getInventory, getInventoryEnderChest, getItemInUse, getItemInUseCount, getItemInUseDuration, getMaxInPortalTime, getName, getOfflineUUID, getPortalCooldown, getScore, getSleepTimer, getSplashSound, getSwimSound, getTeam, getToolDigEfficiency, getTotalArmorValue, getUUID, getWorldScoreboard, getXPSeed, getYOffset, handleStatusUpdate, hasReducedDebug, interactWith, isAllowEdit, isBlocking, isEntityInsideOpaqueBlock, isInvisibleToPlayer, isMovementBlocked, isPlayer, isPlayerFullyAsleep, isPlayerSleeping, isPushedByWater, isSpawnForced, isUsingItem, isWearing, jump, moveEntityWithHeading, onDeath, onItemUseFinish, onKillEntity, preparePlayerToSpawn, readEntityFromNBT, removeExperienceLevel, replaceItemInInventory, resetHeight, sendCommandFeedback, setAbsorptionAmount, setCurrentItemOrArmor, setDead, setGameType, setInWeb, setItemInUse, setReducedDebug, setScore, setSpawnPoint, shouldHeal, stopUsingItem, triggerAchievement, trySleep, updateItemUse, updateRidden, wakeUpPlayer, writeEntityToNBT, xpBarCap
-
Methods inherited from class net.minecraft.entity.EntityLivingBase
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, 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, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata
-
Methods inherited from class net.minecraft.entity.Entity
addEntityCrashInfo, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canRenderOnFire, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fromNBT, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCustomNameTag, getDataWatcher, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getFlag, getHorizontalFacing, getHoverEvent, getMaxFallHeight, getMountedYOffset, getNBTTagCompound, getParts, getPositionEyes, getPositionVector, getUniqueID, getVectorForRotation, handleWaterMovement, hasCustomName, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isEating, isEntityEqual, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isRiding, isSilent, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onStruckByLightning, playStepSound, rayTrace, readFromNBT, setAir, setAlwaysRenderNameTag, setAngles, setCustomNameTag, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toNBT, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.minecraft.command.ICommandSender
getCommandSenderEntity, getEntityWorld, getPositionVector
-
-
-
-
Field Detail
-
sendQueue
public final NetHandlerPlayClient sendQueue
-
movementInput
public MovementInput movementInput
-
mc
protected Minecraft mc
-
sprintingTicksLeft
public int sprintingTicksLeft
-
renderArmYaw
public float renderArmYaw
-
renderArmPitch
public float renderArmPitch
-
prevRenderArmYaw
public float prevRenderArmYaw
-
prevRenderArmPitch
public float prevRenderArmPitch
-
timeInPortal
public float timeInPortal
-
prevTimeInPortal
public float prevTimeInPortal
-
-
Constructor Detail
-
EntityPlayerSP
public EntityPlayerSP(Minecraft mcIn, World worldIn, NetHandlerPlayClient netHandler, StatFileWriter statWriter)
-
-
Method Detail
-
makePluginData
public PluginData makePluginData()
- Overrides:
makePluginDatain classEntityPlayer
-
loadPluginData
public void loadPluginData(BaseData data)
- Overrides:
loadPluginDatain classEntityPlayer
-
attackEntityFrom
public boolean attackEntityFrom(DamageSource source, float amount)
+ Called when the entity is attacked.- Overrides:
attackEntityFromin classEntityPlayer
-
heal
public void heal(float healAmount)
+ Heal living entity (param: amount of half-hearts)- Overrides:
healin classEntityLivingBase
-
mountEntity
public void mountEntity(Entity entityIn)
+ Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.- Overrides:
mountEntityin classEntityLivingBase
-
onUpdate
public void onUpdate()
+ Called to update the entity's position/logic.- Overrides:
onUpdatein classEntityPlayer
-
onUpdateWalkingPlayer
public void onUpdateWalkingPlayer()
+ called every tick when the player is on foot. Performs all the things that normally happen during movement.
-
dropOneItem
public EntityItem dropOneItem(boolean dropAll)
+ Called when player presses the drop item key- Overrides:
dropOneItemin classEntityPlayer
-
joinEntityItemWithWorld
protected void joinEntityItemWithWorld(EntityItem itemIn)
+ Joins the passed in entity item with the world. Args: entityItem- Overrides:
joinEntityItemWithWorldin classEntityPlayer
-
sendChatMessage
public void sendChatMessage(java.lang.String message)
+ Sends a chat message from the player. Args: chatMessage
-
swingItem
public void swingItem()
+ Swings the item the player is holding.- Overrides:
swingItemin classEntityLivingBase
-
respawnPlayer
public void respawnPlayer()
- Overrides:
respawnPlayerin classEntityPlayer
-
damageEntity
protected void damageEntity(DamageSource damageSrc, float damageAmount)
+ Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second with the reduced value. Args: damageAmount- Overrides:
damageEntityin classEntityPlayer
-
closeScreen
public void closeScreen()
+ set current crafting inventory back to the 2x2 square- Overrides:
closeScreenin classEntityPlayer
-
closeScreenAndDropStack
public void closeScreenAndDropStack()
-
setPlayerSPHealth
public void setPlayerSPHealth(float health)
+ Updates health locally.
-
addStat
public void addStat(StatBase stat, int amount)
+ Adds a value to a statistic field.- Overrides:
addStatin classEntityPlayer
-
sendPlayerAbilities
public void sendPlayerAbilities()
+ Sends the player's abilities to the server (if there is one).- Overrides:
sendPlayerAbilitiesin classEntityPlayer
-
isUser
public boolean isUser()
+ returns true if this is an EntityPlayerSP, or the logged in player.- Overrides:
isUserin classEntityPlayer
-
sendHorseJump
protected void sendHorseJump()
-
sendHorseInventory
public void sendHorseInventory()
-
setClientBrand
public void setClientBrand(java.lang.String brand)
-
getClientBrand
public java.lang.String getClientBrand()
-
getStatFileWriter
public StatFileWriter getStatFileWriter()
-
addChatComponentMessage
public void addChatComponentMessage(IChatComponent chatComponent)
- Overrides:
addChatComponentMessagein classEntityPlayer
-
pushOutOfBlocks
protected boolean pushOutOfBlocks(double x, double y, double z)- Overrides:
pushOutOfBlocksin classEntity
-
setSprinting
public void setSprinting(boolean sprinting)
+ Set sprinting switch for Entity.- Overrides:
setSprintingin classEntityLivingBase
-
setXPStats
public void setXPStats(float currentXP, int maxXP, int level)+ Sets the current XP, total XP, and level number.
-
addChatMessage
public void addChatMessage(IChatComponent ichatcomponent)
+ Send a chat message to the CommandSender- Specified by:
addChatMessagein interfaceICommandSender- Overrides:
addChatMessagein classEntity
-
canCommandSenderUseCommand
public boolean canCommandSenderUseCommand(int i, java.lang.String var2)+ Returnstrueif the CommandSender is allowed to execute the command,falseif not- Specified by:
canCommandSenderUseCommandin interfaceICommandSender- Overrides:
canCommandSenderUseCommandin classEntity
-
getPosition
public BlockPos getPosition()
+ Get the position in the world.nullis not allowed! If you are not an entity in the world, return the coordinates 0, 0, 0- Specified by:
getPositionin interfaceICommandSender- Overrides:
getPositionin classEntity
-
playSound
public void playSound(java.lang.String name, float volume, float pitch)- Overrides:
playSoundin classEntityPlayer
-
isServerWorld
public boolean isServerWorld()
+ Returns whether the entity is in a server world- Overrides:
isServerWorldin classEntityLivingBase
-
isRidingHorse
public boolean isRidingHorse()
-
getHorseJumpPower
public float getHorseJumpPower()
-
openEditSign
public void openEditSign(TileEntitySign signTile)
- Overrides:
openEditSignin classEntityPlayer
-
openEditCommandBlock
public void openEditCommandBlock(CommandBlockLogic cmdBlockLogic)
- Overrides:
openEditCommandBlockin classEntityPlayer
-
displayGUIBook
public void displayGUIBook(ItemStack bookStack)
+ Displays the GUI for interacting with a book.- Overrides:
displayGUIBookin classEntityPlayer
-
displayGUIChest
public void displayGUIChest(IInventory chestInventory)
+ Displays the GUI for interacting with a chest inventory. Args: chestInventory- Overrides:
displayGUIChestin classEntityPlayer
-
displayGUIHorse
public void displayGUIHorse(EntityHorse horse, IInventory horseInventory)
- Overrides:
displayGUIHorsein classEntityPlayer
-
displayGui
public void displayGui(IInteractionObject guiOwner)
- Overrides:
displayGuiin classEntityPlayer
-
displayVillagerTradeGui
public void displayVillagerTradeGui(IMerchant villager)
- Overrides:
displayVillagerTradeGuiin classEntityPlayer
-
onCriticalHit
public void onCriticalHit(Entity entityHit)
+ Called when the player performs a critical hit on the Entity. Args: entity that was hit critically- Overrides:
onCriticalHitin classEntityPlayer
-
onEnchantmentCritical
public void onEnchantmentCritical(Entity entityHit)
- Overrides:
onEnchantmentCriticalin classEntityPlayer
-
isSneaking
public boolean isSneaking()
+ Returns if this entity is sneaking.- Overrides:
isSneakingin classEntity
-
updateEntityActionState
public void updateEntityActionState()
- Overrides:
updateEntityActionStatein classEntityPlayer
-
isCurrentViewEntity
public boolean isCurrentViewEntity()
-
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
-
-