Class Player
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.player.Player
- All Implemented Interfaces:
DataComponentGetter,SyncedDataHolder,Attackable,EntityAccess,UniquelyIdentifyable,Nameable,ScoreHolder,IAttachmentHolder,IEntityExtension,ILivingEntityExtension,IPlayerExtension
- Direct Known Subclasses:
AbstractClientPlayer,ServerPlayer
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity
LivingEntity.FallsoundsNested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Abilitiesfloatstatic final intprivate booleanprotected intprivate final ItemCooldownsstatic final intstatic final floatprivate static final intprivate intprivate static final EntityDataAccessor<Float> protected static final EntityDataAccessor<Byte> protected static final EntityDataAccessor<Byte> private static final EntityDataAccessor<Integer> protected static final EntityDataAccessor<CompoundTag> protected static final EntityDataAccessor<CompoundTag> static final floatprivate static final intstatic final floatprivate static final intprivate static final floatstatic final floatprivate static final booleanstatic final HumanoidArmstatic final intprivate static final intprivate static final intprivate static final shortprivate static final intstatic final Vec3protected final floatprivate Componentprotected intstatic final intprotected PlayerEnderChestContainerintfloatprotected FoodDataprivate Poseprivate final com.mojang.authlib.GameProfileThe player's unique game profilestatic final intprotected floatprivate boolean(package private) final Inventoryfinal InventoryMenuprotected intprivate longprivate ItemStackprivate intstatic final intprivate static final intfloatstatic final Stringprivate static final Map<Pose, EntityDimensions> private final Collection<MutableComponent> private booleanstatic final intprivate intstatic final EntityDimensionsprivate final Collection<MutableComponent> static final floatstatic final floatintprivate longintstatic final intprotected booleandoubledoubledoubledoubledoubledoubleFields inherited from class net.minecraft.world.entity.LivingEntity
ARMOR_SLOT_OFFSET, attackAnim, attackStrengthTicker, ATTRIBUTES_FIELD, autoSpinAttackDmg, autoSpinAttackItemStack, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, elytraAnimationState, equipment, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, hurtDuration, hurtTime, INPUT_FRICTION, interpolation, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerMemoryTime, lerpHeadSteps, lerpYHeadRot, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, PLAYER_HURT_EXPERIENCE_TIME, PLAYER_NOT_WEARING_DISGUISE_ITEM, PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGET, removeArrowTime, removeStingerTime, SADDLE_OFFSET, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, useItem, useItemRemaining, walkAnimation, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zzaFields inherited from class net.minecraft.world.entity.Entity
BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noPhysics, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, wasEyeInWater, wasInPowderSnow, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactuallyHurt(ServerLevel p_376500_, DamageSource p_36312_, float p_36313_) voidaddAdditionalSaveData(CompoundTag compound) booleanvoidaiStep()voidanimateHurt(float p_265280_) voidAttacks for the player the targeted entity with the currently equipped item.intawardRecipes(Collection<RecipeHolder<?>> recipes) voidawardRecipesByKey(List<ResourceKey<Recipe<?>>> recipes) voidawardStat(ResourceLocation statKey) voidawardStat(ResourceLocation stat, int increment) voidAdd a stat oncevoidAdds a value to a statistic field.booleanblockActionRestricted(Level level, BlockPos pos, GameType gameMode) doubleprotected voidblockUsingItem(ServerLevel p_400223_, LivingEntity p_399637_) booleanbooleanbooleanbooleancanEat(boolean canAlwaysEat) private booleancanFallAtLeast(double x, double z, double distance) protected booleancanGlide()booleancanHarmPlayer(Player other) booleancanInteractWithBlock(BlockPos pos, double distance) booleancanInteractWithEntity(Entity entity, double distance) booleancanInteractWithEntity(AABB boundingBox, double distance) protected booleanbooleanbooleanbooleanbooleancauseFallDamage(double p_397701_, float p_150093_, DamageSource p_150095_) voidcauseFoodExhaustion(float exhaustion) Increases exhaustion level by the supplied amount.voidstatic AttributeSupplier.Builderprotected EntityEquipmentprotected ItemCooldownsvoidCalled when the entity is dealt a critical hit.private MutableComponentdecorateDisplayNameComponent(MutableComponent displayName) protected voiddefineSynchedData(SynchedEntityData.Builder p_326117_) protected voidvoiddie(DamageSource cause) Called when the mob's health reaches 0.voiddisplayClientMessage(Component chatComponent, boolean actionBar) protected voiddoAutoAttackOnTouch(LivingEntity p_36355_) protected voidprotected booleandoesEmitEquipEvent(EquipmentSlot p_219741_) protected voidDrops an item into the world.protected voiddropEquipment(ServerLevel p_376325_) doubleprotected booleanabstract GameTypegameMode()floatfloatgetAttackStrengthScale(float adjustTicks) Returns the percentage of attack power available based on the cooldown (zero to one).protected intgetBaseExperienceReward(ServerLevel p_376359_) protected floatfloatprotected SoundEventgetDefaultDimensions(Pose p_36166_) private PosefloatgetDestroySpeed(BlockState state) Deprecated.floatgetDestroySpeed(BlockState state, BlockPos pos) intprotected floatgetEnchantedDamage(Entity entity, float damage, DamageSource damageSource) intprotected intprotected floatNeo:com.mojang.authlib.GameProfilefloatprotected SoundEventgetHurtSound(DamageSource damageSource) floatgetLuck()protected floatprotected Entity.MovementEmissiongetName()intgetProjectile(ItemStack shootable) getRopeHoldPosition(float partialTicks) intgetScore()intgetSlot(int p_150112_) floatgetSpeed()protected SoundEventprotected SoundEventprotected SoundEventintvoidgiveExperienceLevels(int levels) Add experience levels to this player.voidgiveExperiencePoints(int xpPoints) voidvoidhandleEntityEvent(byte p_36120_) Handler forinvalid reference
World#setEntityStatebooleanbooleanbooleanhasCorrectToolForDrops(BlockState state) Deprecated.booleanhasCorrectToolForDrops(BlockState state, Level level, BlockPos pos) booleanbooleanhasPermissions(int permissionLevel) protected voidhurtArmor(DamageSource damageSource, float damage) protected voidhurtHelmet(DamageSource p_150103_, float p_150104_) booleanhurtServer(ServerLevel p_376451_, DamageSource p_376171_, float p_376389_) voidincreaseScore(int score) Add to player's scoreinteractOn(Entity entityToInteractOn, InteractionHand hand) protected voidinternalSetAbsorptionAmount(float p_296426_) private booleanisAboveGround(float maxUpStep) booleanprotected booleanbooleanbooleanbooleanbooleanprivate booleanisEquipped(Item item) booleanisHurt()booleanprotected booleanbooleanisInvulnerableTo(ServerLevel p_376263_, DamageSource p_36249_) protected booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanprotected booleanbooleanbooleanbooleankilledEntity(ServerLevel p_219735_, LivingEntity p_219736_) voidvoidmakeStuckInBlock(BlockState state, Vec3 motionMultiplier) protected Vec3maybeBackOffFromEdge(Vec3 vec, MoverType mover) booleanmayBuild()booleanmayUseItemAt(BlockPos pos, Direction facing, ItemStack stack) Returns whether this player can modify the block at a certain location with the given stack.private voidvoidonAboveBubbleColumn(boolean p_368525_, BlockPos p_393868_) booleanvoidonEnchantmentPerformed(ItemStack enchantedItem, int levelCost) voidonInsideBubbleColumn(boolean p_368607_) voidvoidopenCommandBlock(CommandBlockEntity commandBlockEntity) voidopenHorseInventory(AbstractHorse horse, Container inventory) voidopenItemGui(ItemStack stack, InteractionHand hand) voidopenJigsawBlock(JigsawBlockEntity jigsawBlockEntity) openMenu(MenuProvider menu) voidopenMinecartCommandBlock(BaseCommandBlock commandEntity) voidopenStructureBlock(StructureBlockEntity structureEntity) voidopenTestBlock(TestBlockEntity testBlockEntity) voidopenTestInstanceBlock(TestInstanceBlockEntity testInstanceBlockEntity) voidopenTextEdit(SignBlockEntity signEntity, boolean isFrontText) voidplayNotifySound(SoundEvent sound, SoundSource source, float volume, float pitch) private voidplayShoulderEntityAmbientSound(CompoundTag entityCompound) voidplaySound(SoundEvent sound, float volume, float pitch) protected voidplayStepSound(BlockPos p_282121_, BlockState p_282194_) booleanvoidreadAdditionalSaveData(CompoundTag compound) (abstract) Protected helper method to read subclass entity data from NBT.voidNeo: Force the displayed name to refresh, by firingPlayerEvent.NameFormat, using the real player name as event parameter.voidremove(Entity.RemovalReason p_150097_) protected voidvoidvoidvoidintresetRecipes(Collection<RecipeHolder<?>> recipes) voidvoidrespawn()private voidrespawnEntityOnShoulder(CompoundTag entityCompound) voidrideTick()voidsendMerchantOffers(int containerId, MerchantOffers offers, int villagerLevel, int villagerXp, boolean showProgress, boolean canRestock) voidsetClientLoaded(boolean clientLoaded) booleansetEntityOnShoulder(CompoundTag entityCompound) voidsetForcedPose(Pose pose) Neo: Force a pose for the player.voidsetIgnoreFallDamageFromCurrentImpulse(boolean ignoreFallDamageFromCurrentImpulse) voidsetLastDeathLocation(Optional<GlobalPos> lastDeathLocation) voidsetMainArm(HumanoidArm hand) voidsetReducedDebugInfo(boolean reducedDebugInfo) voidsetRemainingFireTicks(int ticks) voidsetScore(int score) Set player's scoreprotected voidsetShoulderEntityLeft(CompoundTag entityCompound) protected voidsetShoulderEntityRight(CompoundTag entityCompound) booleanbooleanbooleanvoidstartAutoSpinAttack(int ticks, float damage, ItemStack itemStack) voidcom.mojang.datafixers.util.Either<Player.BedSleepingProblem, Unit> startSleepInBed(BlockPos bedPos) voidstopSleepInBed(boolean wakeImmediately, boolean updateLevelForSleepingPlayers) voidvoidvoidtick()voidprotected voidprivate voidvoidvoidtriggerRecipeCrafted(RecipeHolder<?> recipe, List<ItemStack> items) voidbooleanprivate voidprotected booleanprotected voidvoidvoidupdateTutorialInventoryAction(ItemStack carried, ItemStack clicked, ClickAction action) protected booleanMethods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, addEffect, addEffect, applyInput, applyItemBlocking, areAllEffectsAmbient, attackable, baseTick, blockedByItem, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttackType, canBeAffected, canBeSeenByAnyone, canBreatheUnderwater, canDispenserEquipIntoSlot, canEquipWithDispenser, canFreeze, canGlideUsing, canPickUpLoot, canStandOnFluid, canUsePortal, canUseSlot, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, doHurtEquipment, doHurtTarget, doPush, drop, dropAllDeathLoot, dropCustomDeathLoot, dropExperience, dropFromGiftLootTable, dropFromLootTable, dropFromLootTable, dropFromShearingLootTable, equipmentHasChanged, forceAddEffect, getActiveEffects, getActiveEffectsMap, getAgeScale, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBrain, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDefaultGravity, getDimensions, getEffect, getEffectBlendFactor, getEffectiveGravity, getEquipmentSlotForItem, getEquipSound, getExperienceReward, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getHitbox, getInterpolation, getItemBlockingWith, getItemBySlot, getItemHeldByArm, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getKnockback, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtByPlayer, getLastHurtByPlayerMemoryTime, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getLootTableSeed, getMainHandItem, getMaxAbsorption, getMaxFallDistance, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSecondsToDisableBlocking, getSleepingPos, getSlotForHand, getSoundVolume, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleExtraItemsCreatedOnUse, hasEffect, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, hasLineOfSight, heal, igniteForTicks, increaseAirSupply, indicateDamage, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDeadOrDying, isEquippableInSlot, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInWall, isLookingAtMe, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, jumpInLiquid, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lookAt, makeBrain, makePoofParticles, makeSound, maxUpStep, onAttributeUpdated, onBelowWorld, onChangedBlock, onEffectAdded, onEffectsRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, onSyncedDataUpdated, playBlockFallSound, playHurtSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, resetForwardDirectionOfRelativePortalPosition, resolveMobResponsibleForDamage, resolvePlayerResponsibleForDamage, sanitizeScale, sendEffectToPassengers, serverAiStep, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setItemSlot, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSpeed, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, skipDropExperience, spawnItemParticles, startSleeping, startUsingItem, stopFallFlying, stopRiding, stopUsingItem, swing, swing, take, tickDeath, tickEffects, tickHeadTurn, tickRidden, triggerOnDeathMobEffects, tryAddFrost, updateEffectVisibility, updateFallFlying, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, wasExperienceConsumed, wouldNotSuffocateAtTargetPoseMethods inherited from class net.minecraft.world.entity.Entity
absSnapRotationTo, absSnapTo, absSnapTo, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyComponentsFromItemStack, applyEffectsFromBlocks, applyEffectsFromBlocks, applyGravity, applyImplicitComponent, applyImplicitComponentIfPresent, applyImplicitComponents, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canCollideWith, canControlVehicle, canRide, canSpawnSprintParticle, canTeleport, canTrample, captureDrops, captureDrops, castComponentValue, checkBelowWorld, checkDespawn, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, clearFreeze, closerThan, closerThan, collideBoundingBox, considersEntityAsAlly, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStackForNameResolution, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doCheckFallDamage, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, forceSetRotation, fudgePositionAfterSizeChange, gameEvent, gameEvent, get, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getControllingPassenger, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDirection, getDismountLocationForPassenger, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getInputVector, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getLootTable, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRotationVector, getSelfAndPassengers, getServer, getSharedFlag, getStringUUID, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getXRot, getY, getY, getYRot, getYRot, getZ, getZ, handleOnAboveBubbleColumn, handleOnInsideBubbleColumn, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPose, hurt, hurtClient, hurtOrSimulate, igniteForSeconds, ignoreExplosion, interact, interactAt, is, isAddedToLevel, isAffectedByBlocks, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInterpolating, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableToBase, isInWater, isInWaterOrRain, isLocalInstanceAuthoritative, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isShiftKeyDown, isSilent, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isUnderWater, isVehicle, isVisuallyCrawling, lavaHurt, lavaIgnite, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeBoundingBox, markHurt, mayInteract, mirror, move, moveOrInterpolateTo, moveRelative, moveTowardsClosestSpace, nextStep, oldPosition, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onPassengerTurned, onRemoval, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, propagateFallToPassengers, push, push, reapplyPosition, refreshDimensions, registryAccess, removeAfterChangingDimensions, removeLatestMovementRecordingBatch, removePassenger, removeTag, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendBubbleColumnParticles, setAirSupply, setAsInsidePortal, setBoundingBox, setComponent, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPos, setOldPosAndRot, setOldPosAndRot, setOldRot, setOnGround, setOnGroundWithMovement, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBlockExplode, shouldPlayLavaHurtSound, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, snapTo, snapTo, snapTo, snapTo, snapTo, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleport, teleportRelative, teleportSetPosition, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getOrDefault, getTyped, has, hasMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, shouldRiderSitMethods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface net.neoforged.neoforge.common.extensions.IPlayerExtension
isCloseEnough, isFakePlayer, mayFly, openMenu, openMenuMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
PERSISTED_NBT_TAG
- See Also:
-
DEFAULT_MAIN_HAND
-
DEFAULT_MODEL_CUSTOMIZATION
public static final int DEFAULT_MODEL_CUSTOMIZATION- See Also:
-
MAX_HEALTH
public static final int MAX_HEALTH- See Also:
-
SLEEP_DURATION
public static final int SLEEP_DURATION- See Also:
-
WAKE_UP_DURATION
public static final int WAKE_UP_DURATION- See Also:
-
ENDER_SLOT_OFFSET
public static final int ENDER_SLOT_OFFSET- See Also:
-
HELD_ITEM_SLOT
public static final int HELD_ITEM_SLOT- See Also:
-
CRAFTING_SLOT_OFFSET
public static final int CRAFTING_SLOT_OFFSET- See Also:
-
DEFAULT_BLOCK_INTERACTION_RANGE
public static final float DEFAULT_BLOCK_INTERACTION_RANGE- See Also:
-
DEFAULT_ENTITY_INTERACTION_RANGE
public static final float DEFAULT_ENTITY_INTERACTION_RANGE- See Also:
-
CROUCH_BB_HEIGHT
public static final float CROUCH_BB_HEIGHT- See Also:
-
SWIMMING_BB_WIDTH
public static final float SWIMMING_BB_WIDTH- See Also:
-
SWIMMING_BB_HEIGHT
public static final float SWIMMING_BB_HEIGHT- See Also:
-
DEFAULT_EYE_HEIGHT
public static final float DEFAULT_EYE_HEIGHT- See Also:
-
CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS
private static final int CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME_TICKS- See Also:
-
DEFAULT_VEHICLE_ATTACHMENT
-
STANDING_DIMENSIONS
-
POSES
-
DATA_PLAYER_ABSORPTION_ID
-
DATA_SCORE_ID
-
DATA_PLAYER_MODE_CUSTOMISATION
-
DATA_PLAYER_MAIN_HAND
-
DATA_SHOULDER_LEFT
-
DATA_SHOULDER_RIGHT
-
CLIENT_LOADED_TIMEOUT_TIME
public static final int CLIENT_LOADED_TIMEOUT_TIME- See Also:
-
DEFAULT_SLEEP_TIMER
private static final short DEFAULT_SLEEP_TIMER- See Also:
-
DEFAULT_EXPERIENCE_PROGRESS
private static final float DEFAULT_EXPERIENCE_PROGRESS- See Also:
-
DEFAULT_EXPERIENCE_LEVEL
private static final int DEFAULT_EXPERIENCE_LEVEL- See Also:
-
DEFAULT_TOTAL_EXPERIENCE
private static final int DEFAULT_TOTAL_EXPERIENCE- See Also:
-
NO_ENCHANTMENT_SEED
private static final int NO_ENCHANTMENT_SEED- See Also:
-
DEFAULT_SELECTED_SLOT
private static final int DEFAULT_SELECTED_SLOT- See Also:
-
DEFAULT_SCORE
private static final int DEFAULT_SCORE- See Also:
-
DEFAULT_IGNORE_FALL_DAMAGE_FROM_CURRENT_IMPULSE
private static final boolean DEFAULT_IGNORE_FALL_DAMAGE_FROM_CURRENT_IMPULSE- See Also:
-
DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME
private static final int DEFAULT_CURRENT_IMPULSE_CONTEXT_RESET_GRACE_TIME- See Also:
-
timeEntitySatOnShoulder
private long timeEntitySatOnShoulder -
inventory
-
enderChestInventory
-
inventoryMenu
-
containerMenu
-
foodData
-
jumpTriggerTime
protected int jumpTriggerTime -
clientLoaded
private boolean clientLoaded -
clientLoadedTimeoutTimer
protected int clientLoadedTimeoutTimer -
oBob
public float oBob -
bob
public float bob -
takeXpDelay
public int takeXpDelay -
xCloakO
public double xCloakO -
yCloakO
public double yCloakO -
zCloakO
public double zCloakO -
xCloak
public double xCloak -
yCloak
public double yCloak -
zCloak
public double zCloak -
sleepCounter
private int sleepCounter -
wasUnderwater
protected boolean wasUnderwater -
abilities
-
experienceLevel
public int experienceLevel -
totalExperience
public int totalExperience -
experienceProgress
public float experienceProgress -
enchantmentSeed
protected int enchantmentSeed -
defaultFlySpeed
protected final float defaultFlySpeed- See Also:
-
lastLevelUpTime
private int lastLevelUpTime -
gameProfile
private final com.mojang.authlib.GameProfile gameProfileThe player's unique game profile -
reducedDebugInfo
private boolean reducedDebugInfo -
lastItemInMainHand
-
cooldowns
-
lastDeathLocation
-
fishing
-
hurtDir
protected float hurtDir -
currentImpulseImpactPos
-
currentExplosionCause
-
ignoreFallDamageFromCurrentImpulse
private boolean ignoreFallDamageFromCurrentImpulse -
currentImpulseContextResetGraceTime
private int currentImpulseContextResetGraceTime -
prefixes
-
suffixes
-
forcedPose
-
lastDayTimeTick
private long lastDayTimeTick -
displayname
-
-
Constructor Details
-
Player
-
-
Method Details
-
createEquipment
- Overrides:
createEquipmentin classLivingEntity
-
blockActionRestricted
-
createAttributes
-
defineSynchedData
- Overrides:
defineSynchedDatain classLivingEntity
-
tick
public void tick()- Overrides:
tickin classLivingEntity
-
getMaxHeadRotationRelativeToBody
protected float getMaxHeadRotationRelativeToBody()- Overrides:
getMaxHeadRotationRelativeToBodyin classLivingEntity
-
isSecondaryUseActive
public boolean isSecondaryUseActive() -
wantsToStopRiding
protected boolean wantsToStopRiding() -
isStayingOnGroundSurface
protected boolean isStayingOnGroundSurface() -
updateIsUnderwater
protected boolean updateIsUnderwater() -
onAboveBubbleColumn
- Overrides:
onAboveBubbleColumnin classEntity
-
onInsideBubbleColumn
public void onInsideBubbleColumn(boolean p_368607_) - Overrides:
onInsideBubbleColumnin classEntity
-
turtleHelmetTick
private void turtleHelmetTick() -
isEquipped
-
createItemCooldowns
-
moveCloak
private void moveCloak() -
updatePlayerPose
protected void updatePlayerPose() -
getDesiredPose
-
canPlayerFitWithinBlocksAndEntitiesWhen
-
getSwimSound
- Overrides:
getSwimSoundin classEntity
-
getSwimSplashSound
- Overrides:
getSwimSplashSoundin classEntity
-
getSwimHighSpeedSplashSound
- Overrides:
getSwimHighSpeedSplashSoundin classEntity
-
getDimensionChangingDelay
public int getDimensionChangingDelay()- Overrides:
getDimensionChangingDelayin classEntity
-
playSound
-
playNotifySound
-
getSoundSource
- Overrides:
getSoundSourcein classEntity
-
getFireImmuneTicks
protected int getFireImmuneTicks()- Overrides:
getFireImmuneTicksin classEntity
-
handleEntityEvent
public void handleEntityEvent(byte p_36120_) Description copied from class:LivingEntityHandler forinvalid reference
World#setEntityState- Overrides:
handleEntityEventin classLivingEntity
-
closeContainer
public void closeContainer() -
doCloseContainer
protected void doCloseContainer() -
rideTick
public void rideTick()- Overrides:
rideTickin classLivingEntity
-
aiStep
public void aiStep()- Overrides:
aiStepin classLivingEntity
-
tickRegeneration
protected void tickRegeneration() -
playShoulderEntityAmbientSound
-
touch
-
getScore
public int getScore() -
setScore
public void setScore(int score) Set player's score -
increaseScore
public void increaseScore(int score) Add to player's score -
startAutoSpinAttack
-
getWeaponItem
- Overrides:
getWeaponItemin classLivingEntity
-
die
Called when the mob's health reaches 0.- Overrides:
diein classLivingEntity
-
dropEquipment
- Overrides:
dropEquipmentin classLivingEntity
-
destroyVanishingCursedItems
protected void destroyVanishingCursedItems() -
getHurtSound
- Overrides:
getHurtSoundin classLivingEntity
-
getDeathSound
- Overrides:
getDeathSoundin classLivingEntity
-
handleCreativeModeItemDrop
-
drop
Drops an item into the world. -
getDestroySpeed
Deprecated.Neo:getDestroySpeed(BlockState, BlockPos)instead -
getDestroySpeed
-
hasCorrectToolForDrops
Deprecated. -
hasCorrectToolForDrops
-
readAdditionalSaveData
(abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readAdditionalSaveDatain classLivingEntity
-
addAdditionalSaveData
- Overrides:
addAdditionalSaveDatain classLivingEntity
-
isInvulnerableTo
- Overrides:
isInvulnerableToin classLivingEntity
-
hurtServer
- Overrides:
hurtServerin classLivingEntity
-
blockUsingItem
- Overrides:
blockUsingItemin classLivingEntity
-
canBeSeenAsEnemy
public boolean canBeSeenAsEnemy()- Overrides:
canBeSeenAsEnemyin classLivingEntity
-
canHarmPlayer
-
hurtArmor
- Overrides:
hurtArmorin classLivingEntity
-
hurtHelmet
- Overrides:
hurtHelmetin classLivingEntity
-
actuallyHurt
- Overrides:
actuallyHurtin classLivingEntity
-
isTextFilteringEnabled
public boolean isTextFilteringEnabled() -
openTextEdit
-
openMinecartCommandBlock
-
openCommandBlock
-
openStructureBlock
-
openTestBlock
-
openTestInstanceBlock
-
openJigsawBlock
-
openHorseInventory
-
openMenu
-
sendMerchantOffers
public void sendMerchantOffers(int containerId, MerchantOffers offers, int villagerLevel, int villagerXp, boolean showProgress, boolean canRestock) -
openItemGui
-
interactOn
-
removeVehicle
public void removeVehicle()- Overrides:
removeVehiclein classEntity
-
isImmobile
protected boolean isImmobile()- Overrides:
isImmobilein classLivingEntity
-
isAffectedByFluids
public boolean isAffectedByFluids()- Overrides:
isAffectedByFluidsin classLivingEntity
-
maybeBackOffFromEdge
- Overrides:
maybeBackOffFromEdgein classEntity
-
isAboveGround
private boolean isAboveGround(float maxUpStep) -
canFallAtLeast
private boolean canFallAtLeast(double x, double z, double distance) -
attack
Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called on it. Args: targetEntity -
getEnchantedDamage
-
doAutoAttackOnTouch
- Overrides:
doAutoAttackOnTouchin classLivingEntity
-
crit
Called when the entity is dealt a critical hit. -
magicCrit
-
sweepAttack
public void sweepAttack() -
respawn
public void respawn() -
remove
- Overrides:
removein classLivingEntity
-
isClientAuthoritative
public boolean isClientAuthoritative()- Overrides:
isClientAuthoritativein classEntity
-
isLocalClientAuthoritative
protected boolean isLocalClientAuthoritative()- Overrides:
isLocalClientAuthoritativein classEntity
-
isLocalPlayer
public boolean isLocalPlayer() -
canSimulateMovement
public boolean canSimulateMovement()- Overrides:
canSimulateMovementin classEntity
-
isEffectiveAi
public boolean isEffectiveAi()- Overrides:
isEffectiveAiin classEntity
-
getGameProfile
public com.mojang.authlib.GameProfile getGameProfile() -
getInventory
-
getAbilities
-
hasInfiniteMaterials
public boolean hasInfiniteMaterials()- Overrides:
hasInfiniteMaterialsin classLivingEntity
-
preventsBlockDrops
public boolean preventsBlockDrops() -
updateTutorialInventoryAction
-
hasContainerOpen
public boolean hasContainerOpen() -
canDropItems
public boolean canDropItems() -
startSleepInBed
public com.mojang.datafixers.util.Either<Player.BedSleepingProblem,Unit> startSleepInBed(BlockPos bedPos) -
stopSleepInBed
public void stopSleepInBed(boolean wakeImmediately, boolean updateLevelForSleepingPlayers) -
stopSleeping
public void stopSleeping()- Overrides:
stopSleepingin classLivingEntity
-
isSleepingLongEnough
public boolean isSleepingLongEnough() -
getSleepTimer
public int getSleepTimer() -
displayClientMessage
-
awardStat
-
awardStat
-
awardStat
Add a stat once -
awardStat
Adds a value to a statistic field. -
resetStat
-
awardRecipes
-
triggerRecipeCrafted
-
awardRecipesByKey
-
resetRecipes
-
travel
- Overrides:
travelin classLivingEntity
-
canGlide
protected boolean canGlide()- Overrides:
canGlidein classLivingEntity
-
updateSwimming
public void updateSwimming()- Overrides:
updateSwimmingin classEntity
-
freeAt
-
getSpeed
public float getSpeed()- Overrides:
getSpeedin classLivingEntity
-
causeFallDamage
- Overrides:
causeFallDamagein classLivingEntity
-
tryToStartFallFlying
public boolean tryToStartFallFlying() -
startFallFlying
public void startFallFlying() -
doWaterSplashEffect
protected void doWaterSplashEffect()- Overrides:
doWaterSplashEffectin classEntity
-
playStepSound
- Overrides:
playStepSoundin classEntity
-
getFallSounds
- Overrides:
getFallSoundsin classLivingEntity
-
killedEntity
- Overrides:
killedEntityin classEntity
-
makeStuckInBlock
- Overrides:
makeStuckInBlockin classEntity
-
giveExperiencePoints
public void giveExperiencePoints(int xpPoints) -
getEnchantmentSeed
public int getEnchantmentSeed() -
onEnchantmentPerformed
-
giveExperienceLevels
public void giveExperienceLevels(int levels) Add experience levels to this player. -
getXpNeededForNextLevel
public int getXpNeededForNextLevel() -
causeFoodExhaustion
public void causeFoodExhaustion(float exhaustion) Increases exhaustion level by the supplied amount. -
getWardenSpawnTracker
-
getFoodData
-
canEat
public boolean canEat(boolean canAlwaysEat) -
isHurt
public boolean isHurt() -
mayBuild
public boolean mayBuild() -
mayUseItemAt
Returns whether this player can modify the block at a certain location with the given stack.The position being queried is
pos.offset(facing.getOpposite()).- Returns:
- Whether this player may modify the queried location in the current world
- See Also:
-
getBaseExperienceReward
- Overrides:
getBaseExperienceRewardin classLivingEntity
-
isAlwaysExperienceDropper
protected boolean isAlwaysExperienceDropper()- Overrides:
isAlwaysExperienceDropperin classLivingEntity
-
shouldShowName
public boolean shouldShowName()- Overrides:
shouldShowNamein classLivingEntity
-
getMovementEmission
- Overrides:
getMovementEmissionin classEntity
-
onUpdateAbilities
public void onUpdateAbilities() -
getName
-
getEnderChestInventory
-
doesEmitEquipEvent
- Overrides:
doesEmitEquipEventin classLivingEntity
-
addItem
-
setEntityOnShoulder
-
removeEntitiesOnShoulder
protected void removeEntitiesOnShoulder() -
respawnEntityOnShoulder
-
gameMode
-
isSpectator
public boolean isSpectator()- Overrides:
isSpectatorin classEntity
-
canBeHitByProjectile
public boolean canBeHitByProjectile()- Overrides:
canBeHitByProjectilein classEntity
-
isSwimming
public boolean isSwimming()- Overrides:
isSwimmingin classEntity
-
isCreative
public boolean isCreative() -
isPushedByFluid
public boolean isPushedByFluid()- Overrides:
isPushedByFluidin classEntity
-
getScoreboard
-
getDisplayName
- Specified by:
getDisplayNamein interfaceNameable- Specified by:
getDisplayNamein interfaceScoreHolder- Overrides:
getDisplayNamein classEntity
-
decorateDisplayNameComponent
-
getScoreboardName
- Specified by:
getScoreboardNamein interfaceScoreHolder- Overrides:
getScoreboardNamein classEntity
-
internalSetAbsorptionAmount
protected void internalSetAbsorptionAmount(float p_296426_) - Overrides:
internalSetAbsorptionAmountin classLivingEntity
-
getAbsorptionAmount
public float getAbsorptionAmount()- Overrides:
getAbsorptionAmountin classLivingEntity
-
isModelPartShown
-
getSlot
- Overrides:
getSlotin classLivingEntity
-
isReducedDebugInfo
public boolean isReducedDebugInfo() -
setReducedDebugInfo
public void setReducedDebugInfo(boolean reducedDebugInfo) -
setRemainingFireTicks
public void setRemainingFireTicks(int ticks) - Overrides:
setRemainingFireTicksin classEntity
-
getMainArm
- Specified by:
getMainArmin classLivingEntity
-
setMainArm
-
getShoulderEntityLeft
-
setShoulderEntityLeft
-
getShoulderEntityRight
-
setShoulderEntityRight
-
getCurrentItemAttackStrengthDelay
public float getCurrentItemAttackStrengthDelay() -
getAttackStrengthScale
public float getAttackStrengthScale(float adjustTicks) Returns the percentage of attack power available based on the cooldown (zero to one). -
resetAttackStrengthTicker
public void resetAttackStrengthTicker() -
getCooldowns
-
getBlockSpeedFactor
protected float getBlockSpeedFactor()- Overrides:
getBlockSpeedFactorin classLivingEntity
-
getLuck
public float getLuck()- Overrides:
getLuckin classLivingEntity
-
canUseGameMasterBlocks
public boolean canUseGameMasterBlocks() -
getPermissionLevel
public int getPermissionLevel() -
hasPermissions
public boolean hasPermissions(int permissionLevel) -
getDefaultDimensions
- Overrides:
getDefaultDimensionsin classLivingEntity
-
getDismountPoses
- Overrides:
getDismountPosesin classLivingEntity
-
getProjectile
- Overrides:
getProjectilein classLivingEntity
-
getRopeHoldPosition
- Overrides:
getRopeHoldPositionin classEntity
-
isAlwaysTicking
public boolean isAlwaysTicking()- Specified by:
isAlwaysTickingin interfaceEntityAccess- Overrides:
isAlwaysTickingin classEntity
-
isScoping
public boolean isScoping() -
shouldBeSaved
public boolean shouldBeSaved()- Specified by:
shouldBeSavedin interfaceEntityAccess- Overrides:
shouldBeSavedin classEntity
-
getLastDeathLocation
-
setLastDeathLocation
-
getHurtDir
public float getHurtDir()- Overrides:
getHurtDirin classLivingEntity
-
animateHurt
public void animateHurt(float p_265280_) - Overrides:
animateHurtin classLivingEntity
-
canSprint
public boolean canSprint() -
getFlyingSpeed
protected float getFlyingSpeed()- Overrides:
getFlyingSpeedin classLivingEntity
-
hasClientLoaded
public boolean hasClientLoaded() -
tickClientLoadTimeout
public void tickClientLoadTimeout() -
setClientLoaded
public void setClientLoaded(boolean clientLoaded) -
blockInteractionRange
public double blockInteractionRange() -
entityInteractionRange
public double entityInteractionRange() -
canInteractWithEntity
-
canInteractWithEntity
-
canInteractWithBlock
-
setIgnoreFallDamageFromCurrentImpulse
public void setIgnoreFallDamageFromCurrentImpulse(boolean ignoreFallDamageFromCurrentImpulse) -
isIgnoringFallDamageFromCurrentImpulse
public boolean isIgnoringFallDamageFromCurrentImpulse() -
tryResetCurrentImpulseContext
public void tryResetCurrentImpulseContext() -
resetCurrentImpulseContext
public void resetCurrentImpulseContext() -
shouldRotateWithMinecart
public boolean shouldRotateWithMinecart() -
onClimbable
public boolean onClimbable()- Overrides:
onClimbablein classLivingEntity
-
debugInfo
-
getPrefixes
-
getSuffixes
-
refreshDisplayName
public void refreshDisplayName()Neo: Force the displayed name to refresh, by firingPlayerEvent.NameFormat, using the real player name as event parameter. -
setForcedPose
Neo: Force a pose for the player. If set, the vanilla pose determination and clearance check is skipped. Make sure the pose is clear yourself (e.g. in PlayerTick). This has to be set just once, do not set it every tick. Make sure to clear (null) the pose if not required anymore and only use if necessary. -
getForcedPose
Neo:- Returns:
- The forced pose if set, null otherwise
-
getDestroySpeed(BlockState, BlockPos)instead