Package net.minecraftforge.common.util
Class FakePlayer
- All Implemented Interfaces:
CommandSource
,EntityAccess
,Nameable
,ICapabilityProvider
,ICapabilityProviderImpl<Entity>
,ICapabilitySerializable<CompoundTag>
,IForgeEntity
,IForgeLivingEntity
,IForgePlayer
,INBTSerializable<CompoundTag>
A basic fake server player implementation that can be used to simulate player actions.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.player.Player
Player.BedSleepingProblem
Nested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity
LivingEntity.Fallsounds
Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity
Entity.MoveFunction, Entity.MovementEmission, Entity.RemovalReason
Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
CapabilityProvider.AsField<B extends ICapabilityProviderImpl<B>>
-
Field Summary
Fields inherited from class net.minecraft.server.level.ServerPlayer
connection, containerCounter, gameMode, latency, server, wonGame
Fields inherited from class net.minecraft.world.entity.player.Player
bob, containerMenu, CROUCH_BB_HEIGHT, DATA_PLAYER_MAIN_HAND, DATA_PLAYER_MODE_CUSTOMISATION, DATA_SHOULDER_LEFT, DATA_SHOULDER_RIGHT, DEFAULT_EYE_HEIGHT, defaultFlySpeed, enchantmentSeed, ENDER_SLOT_OFFSET, enderChestInventory, experienceLevel, experienceProgress, fishing, foodData, inventoryMenu, jumpTriggerTime, MAX_HEALTH, MAX_NAME_LENGTH, oBob, PERSISTED_NBT_TAG, SLEEP_DURATION, STANDING_DIMENSIONS, SWIMMING_BB_HEIGHT, SWIMMING_BB_WIDTH, takeXpDelay, totalExperience, WAKE_UP_DURATION, wardenSpawnTracker, wasUnderwater, xCloak, xCloakO, yCloak, yCloakO, zCloak, zCloakO
Fields inherited from class net.minecraft.world.entity.LivingEntity
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BASE_GRAVITY, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, flyingSpeed, HAND_SLOTS, hurtDir, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, lyHeadRot, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, oRun, PLAYER_HURT_EXPERIENCE_TIME, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, timeOffs, USE_ITEM_INTERVAL, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
Fields inherited from class net.minecraft.world.entity.Entity
BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW, 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, isInsidePortal, level, MAX_ENTITY_TAG_COUNT, maxUpStep, minorHorizontalCollision, moveDist, noCulling, noPhysics, onGround, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
canHarmPlayer
(Player player) void
die
(DamageSource source) void
displayClientMessage
(Component chatComponent, boolean actionBar) @Nullable MinecraftServer
boolean
isInvulnerableTo
(DamageSource source) void
tick()
void
Methods inherited from class net.minecraft.server.level.ServerPlayer
addAdditionalSaveData, allowsListing, attack, awardKillScore, awardRecipes, awardRecipesByKey, broadcastToPlayer, canChatInColor, changeDimension, checkFallDamage, closeContainer, completeUsingItem, createItemCooldowns, crit, disconnect, dismountTo, doCheckFallDamage, doCloseContainer, doTick, drop, drop, findDimensionEntryPoint, getAddEntityPacket, getAdvancements, getCamera, getChatVisibility, getExitPortal, getIpAddress, getLanguage, getLastActionTime, getLastSectionPos, getLevel, getPermissionLevel, getRecipeBook, getRespawnAngle, getRespawnDimension, getRespawnPosition, getStats, getTabListDisplayName, getTabListFooter, getTabListHeader, getTextFilter, giveExperienceLevels, giveExperiencePoints, hasChangedDimension, hasDisconnected, hurt, initInventoryMenu, initMenu, isChangingDimension, isCreative, isRespawnForced, isSpectator, isTextFilteringEnabled, loadGameTypes, lookAt, lookAt, magicCrit, mayInteract, moveTo, nextContainerCounter, onChangedBlock, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnchantmentPerformed, onEnterCombat, onInsideBlock, onItemPickup, onLeaveCombat, onUpdateAbilities, openCommandBlock, openHorseInventory, openItemGui, openMenu, openTextEdit, playNotifySound, processPortalCooldown, readAdditionalSaveData, refreshTabListName, resetFallDistance, resetLastActionTime, resetRecipes, resetSentInfo, resetStat, restoreFrom, sendChatHeader, sendChatMessage, sendMerchantOffers, sendServerStatus, sendSystemMessage, sendSystemMessage, sendTexturePack, setCamera, setExperienceLevels, setExperiencePoints, setGameMode, setLastSectionPos, setLevel, setPlayerInput, setRespawnPosition, setTabListFooter, setTabListHeader, setTabListHeaderFooter, shouldFilterMessageTo, startRiding, startSleepInBed, startSleeping, stopRiding, stopSleepInBed, swing, take, teleportTo, teleportTo, trackChunk, trackEnteredOrExitedLavaOnVehicle, trackStartFallingPosition, untrackChunk, updateInvisibilityStatus, updateUsingItem
Methods inherited from class net.minecraft.world.entity.player.Player
actuallyHurt, addItem, aiStep, asChatSender, awardStat, awardStat, awardStat, blockActionRestricted, blockUsingShield, canBeSeenAsEnemy, canEat, canTakeItem, canUseGameMasterBlocks, causeFallDamage, causeFoodExhaustion, checkMovementStatistics, createAttributes, defineSynchedData, destroyVanishingCursedItems, disableShield, doAutoAttackOnTouch, doesEmitEquipEvent, doWaterSplashEffect, drop, dropEquipment, eat, findRespawnPositionAndUseSpawnBlock, freeAt, getAbilities, getAbsorptionAmount, getArmorSlots, getAttackStrengthScale, getBlockSpeedFactor, getCapability, getCooldowns, getCurrentItemAttackStrengthDelay, getDeathSound, getDestroySpeed, getDigSpeed, getDimensionChangingDelay, getDimensions, getDismountPoses, getDisplayName, getEnchantmentSeed, getEnderChestInventory, getExperienceReward, getFallSounds, getFireImmuneTicks, getFoodData, getForcedPose, getGameProfile, getHandSlots, getHurtSound, getInventory, getItemBySlot, getLastDeathLocation, getLuck, getMainArm, getMovementEmission, getMyRidingOffset, getName, getPortalWaitTime, getPrefixes, getProfilePublicKey, getProjectile, getRopeHoldPosition, getScore, getScoreboard, getScoreboardName, getShoulderEntityLeft, getShoulderEntityRight, getSleepTimer, getSlot, getSoundSource, getSpeed, getStandingEyeHeight, getSuffixes, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getWardenSpawnTracker, getXpNeededForNextLevel, handleEntityEvent, hasContainerOpen, hasCorrectToolForDrops, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseScore, interactOn, isAffectedByFluids, isAlwaysExperienceDropper, isAlwaysTicking, isHurt, isImmobile, isLocalPlayer, isModelPartShown, isPushedByFluid, isReducedDebugInfo, isScoping, isSecondaryUseActive, isSleepingLongEnough, isStayingOnGroundSurface, isSwimming, jumpFromGround, makeStuckInBlock, maybeBackOffFromEdge, mayBuild, mayUseItemAt, onSoulSpeedBlock, openJigsawBlock, openMinecartCommandBlock, openStructureBlock, playSound, refreshDisplayName, remove, removeEntitiesOnShoulder, removeVehicle, resetAttackStrengthTicker, respawn, rideTick, serverAiStep, setAbsorptionAmount, setEntityOnShoulder, setForcedPose, setItemSlot, setLastDeathLocation, setMainArm, setReducedDebugInfo, setRemainingFireTicks, setScore, setShoulderEntityLeft, setShoulderEntityRight, shouldBeSaved, shouldRemoveSoulSpeed, shouldShowName, startAutoSpinAttack, startFallFlying, stopFallFlying, stopSleeping, sweepAttack, travel, tryToStartFallFlying, updateIsUnderwater, updatePlayerPose, updateSwimming, updateTutorialInventoryAction, wantsToStopRiding, wasKilled
Methods inherited from class net.minecraft.world.entity.LivingEntity
addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, baseTick, blockedByShield, brainProvider, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canAttackType, canBeAffected, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canSpawnSoulSpeedParticle, canStandOnFluid, checkAutoSpinAttack, clearSleepingPos, createLivingAttributes, createLootContext, createWitherRose, curePotionEffects, decreaseAirSupply, doHurtTarget, doPush, dropAllDeathLoot, dropCustomDeathLoot, dropExperience, dropFromLootTable, forceAddEffect, getActiveEffects, getActiveEffectsMap, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBoundingBoxForCulling, getBrain, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getEyeHeight, getFallFlyingTicks, getFluidFallingAdjustedMovement, getHealth, getItemInHand, getJumpBoostPower, getJumpPower, getKillCredit, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getLootTable, getMainHandItem, getMaxHealth, getMobType, getNoActionTime, getOffhandItem, getRandom, getRelativePortalPosition, getScale, getSleepingPos, getSoundVolume, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, increaseAirSupply, invalidateCaps, isAffectedByPotions, isAlive, isAutoSpinAttack, isBaby, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isEffectiveAi, isFallFlying, isHolding, isHolding, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpInLiquid, kill, knockback, lerpHeadTo, lerpTo, makeBrain, onClimbable, onEquipItem, onSyncedDataUpdated, outOfWorld, playBlockFallSound, playEquipSound, playHurtSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, reviveCaps, rideableUnderWater, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setOnGround, setRecordPlayingNearby, setSleepingPos, setSpeed, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRiderFaceForward, skipDropExperience, spawnSoulSpeedParticle, startUsingItem, stopUsingItem, swing, tickDeath, tickEffects, tickHeadTurn, triggerItemUseEffects, tryAddFrost, tryAddSoulSpeed, updateEffectVisibility, updateSwingTime, verifyEquippedItem, wasExperienceConsumed
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, blockPosition, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkDespawn, checkInsideBlocks, checkOutOfWorld, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, createCommandSourceStack, createHoverEvent, dampensVibrations, discard, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, ejectPassengers, equals, fillCrashReportCategory, fireImmune, gameEvent, gameEvent, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDirection, getDismountLocationForPassenger, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getHandHoldingItemAngle, getId, getIndirectPassengers, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxFallDistance, getMaxHeightFluidType, getMotionDirection, getOnPos, getOnPosLegacy, getPassengers, getPassengersAndSelf, getPassengersRidingOffset, getPercentFrozen, getPersistentData, getPickRadius, getPickResult, getPistonPushReaction, getPose, getPosition, getPositionCodec, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRotationVector, getSelfAndPassengers, getSharedFlag, getStringUUID, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, interact, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isRemoved, isShiftKeyDown, isSilent, isSprinting, isSteppingCarefully, isSuppressingBounce, isUnderWater, isVehicle, isVisuallyCrawling, lavaHurt, lerpMotion, limitPistonMovement, load, makeBoundingBox, markHurt, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, pick, playEntityOnFireExtinguishedSound, playerTouch, playSound, playStepSound, playSwimSound, position, positionRider, processFlappingMovement, push, reapplyPosition, refreshDimensions, removeAfterChangingDimensions, removePassenger, removeTag, repositionEntityAfterLoad, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevelCallback, setNoGravity, setOldPosAndRot, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemoved, setRot, setSecondsOnFire, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, serializeNBT, shouldRiderSit
Methods inherited from interface net.minecraftforge.common.extensions.IForgeLivingEntity
canDrownInFluidType, canSwimInFluidType, jumpInFluid, moveInFluid, self, sinkInFluid
Methods inherited from interface net.minecraftforge.common.extensions.IForgePlayer
canHit, canInteractWith, canInteractWith, getAttackRange, getReachDistance, isCloseEnough
-
Constructor Details
-
FakePlayer
-
-
Method Details
-
displayClientMessage
- Overrides:
displayClientMessage
in classServerPlayer
-
awardStat
- Overrides:
awardStat
in classServerPlayer
-
isInvulnerableTo
- Overrides:
isInvulnerableTo
in classServerPlayer
-
canHarmPlayer
- Overrides:
canHarmPlayer
in classServerPlayer
-
die
- Overrides:
die
in classServerPlayer
-
tick
public void tick()- Overrides:
tick
in classServerPlayer
-
updateOptions
- Overrides:
updateOptions
in classServerPlayer
-
getServer
-