Package net.minecraft.entity.passive
Class FoxEntity
- All Implemented Interfaces:
CommandOutput
,Nameable
public class FoxEntity extends AnimalEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.passive.PassiveEntity
PassiveEntity.PassiveData
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater
-
Field Summary
Fields Modifier and Type Field Description private static Predicate<Entity>
CHICKEN_AND_RABBIT_FILTER
private int
eatingTime
private float
extraRollingHeight
private Goal
followBabyTurtleGoal
private Goal
followChickenAndRabbitGoal
private Goal
followFishGoal
private static TrackedData<Byte>
FOX_FLAGS
private float
headRollProgress
private static Predicate<Entity>
JUST_ATTACKED_SOMETHING_FILTER
private float
lastExtraRollingHeight
private float
lastHeadRollProgress
private static Predicate<Entity>
NOTICEABLE_PLAYER_FILTER
private static TrackedData<Optional<UUID>>
OTHER_TRUSTED
private static TrackedData<Optional<UUID>>
OWNER
private static Predicate<ItemEntity>
PICKABLE_DROP_FILTER
private static TrackedData<Integer>
TYPE
Fields inherited from class net.minecraft.entity.passive.PassiveEntity
breedingAge, forcedAge, happyTicksRemaining
Fields inherited from class net.minecraft.entity.mob.MobEntity
ambientSoundChance, armorDropChances, experiencePoints, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector
Fields inherited from class net.minecraft.entity.LivingEntity
activeItemStack, attackingPlayer, bodyTrackingIncrements, bodyYaw, brain, dead, deathTime, defaultMaxHealth, despawnCounter, field_6215, flyingSpeed, forwardSpeed, handSwinging, handSwingProgress, handSwingTicks, headTrackingIncrements, headYaw, hurtTime, itemUseTimeLeft, jumping, knockbackVelocity, lastAttackedTicks, lastDamageTaken, lastHandSwingProgress, lastLimbDistance, limbAngle, limbDistance, LIVING_FLAGS, lookDirection, maxHurtTime, playerHitTimer, preferredHand, prevBodyYaw, prevHeadYaw, prevLookDirection, prevStepBobbingAmount, randomLargeSeed, randomSmallSeed, riptideTicks, roll, scoreAmount, serverHeadYaw, serverPitch, serverX, serverY, serverYaw, serverZ, sidewaysSpeed, SLEEPING_DIMENSIONS, stepBobbingAmount, stuckArrowTimer, stuckStingerTimer, upwardSpeed
Fields inherited from class net.minecraft.entity.Entity
age, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yaw
Fields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY
-
Constructor Summary
Constructors Constructor Description FoxEntity(EntityType<? extends FoxEntity> type, World world)
-
Method Summary
Modifier and Type Method Description private void
addTrustedUuid(UUID uuid)
private void
addTypeSpecificGoals()
private boolean
canEat(ItemStack stack)
boolean
canEquip(ItemStack stack)
static boolean
canJumpChase(FoxEntity fox, LivingEntity chasedEntity)
boolean
canPickupItem(ItemStack stack)
private boolean
canTrust(UUID uuid)
protected int
computeFallDamage(float fallDistance, float damageMultiplier)
FoxEntity
createChild(ServerWorld serverWorld, PassiveEntity passiveEntity)
static DefaultAttributeContainer.Builder
createFoxAttributes()
protected void
drop(DamageSource source)
private void
dropItem(ItemStack stack)
protected void
eat(PlayerEntity player, ItemStack stack)
protected float
getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
protected SoundEvent
getAmbientSound()
float
getBodyRotationHeightOffset(float tickDelta)
protected SoundEvent
getDeathSound()
SoundEvent
getEatSound(ItemStack stack)
private boolean
getFoxFlag(int bitmask)
FoxEntity.Type
getFoxType()
float
getHeadRoll(float tickDelta)
protected SoundEvent
getHurtSound(DamageSource source)
private List<UUID>
getTrustedUuids()
void
handleStatus(byte status)
protected void
initDataTracker()
protected void
initEquipment(LocalDifficulty difficulty)
protected void
initGoals()
EntityData
initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CompoundTag entityTag)
private boolean
isAggressive()
boolean
isBreedingItem(ItemStack stack)
boolean
isChasing()
boolean
isFullyCrouched()
protected boolean
isImmobile()
boolean
isInSneakingPose()
Returns whether the entity is in a crouching pose.boolean
isRollingHead()
boolean
isSitting()
boolean
isSleeping()
boolean
isWalking()
protected void
loot(ItemEntity item)
Vec3d
method_29919()
protected void
onPlayerSpawnedChild(PlayerEntity player, MobEntity child)
void
playAmbientSound()
void
readCustomDataFromTag(CompoundTag tag)
private void
setAggressive(boolean aggressive)
void
setChasing(boolean chasing)
void
setCrouching(boolean crouching)
private void
setFoxFlag(int mask, boolean value)
void
setRollingHead(boolean rollingHead)
void
setSitting(boolean sitting)
private void
setSleeping(boolean sleeping)
void
setTarget(LivingEntity target)
private void
setType(FoxEntity.Type type)
private void
setWalking(boolean walking)
private void
spit(ItemStack stack)
private void
stopActions()
private void
stopSleeping()
void
tick()
void
tickMovement()
private boolean
wantsToPickupItem()
void
writeCustomDataToTag(CompoundTag tag)
Methods inherited from class net.minecraft.entity.passive.AnimalEntity
breed, canBreedWith, canEat, canImmediatelyDespawn, damage, getCurrentExperience, getHeightOffset, getLoveTicks, getLovingPlayer, getMinAmbientSoundDelay, getPathfindingFavor, interactMob, isInLove, isValidNaturalSpawn, lovePlayer, mobTick, resetLoveTicks, setLoveTicks
Methods inherited from class net.minecraft.entity.passive.PassiveEntity
getBreedingAge, growUp, growUp, isBaby, isReadyToBreed, onGrowUp, onTrackedDataSet, setBaby, setBreedingAge
Methods inherited from class net.minecraft.entity.mob.PathAwareEntity
canSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeash
Methods inherited from class net.minecraft.entity.mob.MobEntity
attachLeash, baseTick, canBeControlledByRider, canBeLeashedBy, canEquipmentSlotContain, canGather, canMobSpawn, canMoveVoluntarily, cannotDespawn, canPickUpLoot, canSpawn, canTarget, canTarget, canUseRangedWeapon, checkDespawn, createBodyControl, createMobAttributes, createNavigation, detachLeash, dropEquipment, dropLoot, equip, equipLootStack, equipStack, getArmorItems, getBodyYawSpeed, getDropChance, getEquipmentForSlot, getEquippedStack, getHoldingEntity, getItemsHand, getJumpControl, getLimitPerChunk, getLookControl, getLookPitchSpeed, getLookYawSpeed, getLootContextBuilder, getLootTable, getLootTableId, getMainArm, getMoveControl, getNavigation, getPathfindingPenalty, getPositionTarget, getPositionTargetRange, getPreferredEquipmentSlot, getSafeFallDistance, getTarget, getVisibilityCache, hasPositionTarget, interact, isAffectedByDaylight, isAiDisabled, isAttacking, isDisallowedInPeaceful, isInWalkTargetRange, isInWalkTargetRange, isLeashed, isLeftHanded, isLogicalSideForUpdatingMovement, isPersistent, lookAtEntity, method_29243, method_29244, method_30076, method_30758, method_30759, movesIndependently, onEatingGrass, playHurtSound, playSpawnEffects, prefersNewDamageableItem, prefersNewEquipment, sendAiDebugData, setAiDisabled, setAttacking, setCanPickUpLoot, setEquipmentDropChance, setForwardSpeed, setHoldingEntityId, setLeftHanded, setMovementSpeed, setPathfindingPenalty, setPersistent, setPositionTarget, setSidewaysSpeed, setUpwardSpeed, spawnsTooManyForEachTry, startRiding, swimUpward, tickNewAi, tryAttack, tryEquip, turnHead, updateDropChances, updateEnchantments, updateGoalControls
Methods inherited from class net.minecraft.entity.LivingEntity
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canSee, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, damageArmor, damageShield, deserializeBrain, destroy, displaySoulSpeedEffects, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getArrowType, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getBrain, getClimbingPos, getDamageTracker, getDespawnCounter, getDimensions, getDrinkSound, getEyeHeight, getFallSound, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getItemUseTime, getItemUseTimeLeft, getJumpVelocity, getLastAttackedTime, getLastAttackTime, getLeaningPitch, getMainHandStack, getMaxHealth, getMovementSpeed, getNextAirOnLand, getNextAirUnderwater, getOffHandStack, getPoses, getPrimeAdversary, getRandom, getRecentDamageSource, getRoll, getScaleFactor, getSleepingDirection, getSleepingPosition, getSoundPitch, getSoundVolume, getStackInHand, getStatusEffect, getStatusEffects, getStingerCount, getStuckArrowCount, getVelocityMultiplier, getVisibilityBoundingBox, getYaw, handleFallDamage, hasStackEquipped, hasStatusEffect, heal, hurtByWater, isAffectedBySplashPotions, isAlive, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isInsideWall, isInSwimmingPose, isMobOrPlayer, isOnSoulSpeedBlock, isPushable, isTarget, isUndead, isUsingItem, isUsingRiptide, jump, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_26317, method_26318, method_29242, method_29499, method_29500, method_29920, method_30633, method_31079, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, playBlockFallSound, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAbsorptionAmount, setAttacker, setAttacking, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setNearbySongPlaying, setOnGround, setRiptideTicks, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldAlwaysDropXp, shouldDisplaySoulSpeedEffects, shouldDropLoot, shouldRenderName, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickRiptide, tickStatusEffects, travel, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles, wakeUp
Methods inherited from class net.minecraft.entity.Entity
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeSpectated, canClimb, canExplosionDestroyBlock, canFly, canStartRiding, canUsePortals, changeLookDirection, checkBlockCollision, collidesWith, copyFrom, copyPositionAndRotation, dealDamage, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFlag, getFluidHeight, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getMountedHeightOffset, getMovementDirection, getName, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, getPassengerDismountOffset, getPassengerList, getPassengersDeep, getPermissionLevel, getPistonBehavior, getPitch, getPos, getPose, getPrimaryPassenger, getRandomBodyY, getRenderDistanceMultiplier, getRootVehicle, getRotationClient, getRotationVec, getRotationVecClient, getRotationVector, getRotationVector, getSavedEntityId, getScoreboardTags, getScoreboardTeam, getServer, getSoundCategory, getSplashSound, getStandingEyeHeight, getSwimSound, getTargetingMargin, getTeamColorValue, getTeleportTarget, getTrackedPosition, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getWidth, getX, getY, getZ, handleAttack, hasCustomName, hashCode, hasNetherPortalCooldown, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interactAt, isAttackable, isChunkPosUpdateRequested, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isOnFire, isOnGround, isPartOf, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29239, method_29241, method_30330, method_30632, method_30634, method_30950, method_30951, method_31166, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, pushOutOfBlocks, raycast, refreshPosition, refreshPositionAfterTeleport, refreshPositionAfterTeleport, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetNetherPortalCooldown, resetPosition, saveSelfToTag, saveToTag, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setGlowing, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
-
Field Details
-
TYPE
-
FOX_FLAGS
-
OWNER
-
OTHER_TRUSTED
-
PICKABLE_DROP_FILTER
-
JUST_ATTACKED_SOMETHING_FILTER
-
CHICKEN_AND_RABBIT_FILTER
-
NOTICEABLE_PLAYER_FILTER
-
followChickenAndRabbitGoal
-
followBabyTurtleGoal
-
followFishGoal
-
headRollProgress
private float headRollProgress -
lastHeadRollProgress
private float lastHeadRollProgress -
extraRollingHeight
private float extraRollingHeight -
lastExtraRollingHeight
private float lastExtraRollingHeight -
eatingTime
private int eatingTime
-
-
Constructor Details
-
FoxEntity
-
-
Method Details
-
initDataTracker
protected void initDataTracker()- Overrides:
initDataTracker
in classPassiveEntity
-
initGoals
protected void initGoals() -
getEatSound
- Overrides:
getEatSound
in classLivingEntity
-
tickMovement
public void tickMovement()- Overrides:
tickMovement
in classAnimalEntity
-
isImmobile
protected boolean isImmobile()- Overrides:
isImmobile
in classLivingEntity
-
canEat
-
initEquipment
- Overrides:
initEquipment
in classMobEntity
-
handleStatus
@Environment(CLIENT) public void handleStatus(byte status)- Overrides:
handleStatus
in classAnimalEntity
-
createFoxAttributes
-
createChild
- Specified by:
createChild
in classPassiveEntity
-
initialize
@Nullable public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)- Overrides:
initialize
in classPassiveEntity
-
addTypeSpecificGoals
private void addTypeSpecificGoals() -
eat
- Overrides:
eat
in classAnimalEntity
-
getActiveEyeHeight
- Overrides:
getActiveEyeHeight
in classLivingEntity
-
getFoxType
-
setType
-
getTrustedUuids
-
addTrustedUuid
-
writeCustomDataToTag
- Overrides:
writeCustomDataToTag
in classAnimalEntity
-
readCustomDataFromTag
- Overrides:
readCustomDataFromTag
in classAnimalEntity
-
isSitting
public boolean isSitting() -
setSitting
public void setSitting(boolean sitting) -
isWalking
public boolean isWalking() -
setWalking
private void setWalking(boolean walking) -
isAggressive
private boolean isAggressive() -
setAggressive
private void setAggressive(boolean aggressive) -
isSleeping
public boolean isSleeping()- Overrides:
isSleeping
in classLivingEntity
-
setSleeping
private void setSleeping(boolean sleeping) -
setFoxFlag
private void setFoxFlag(int mask, boolean value) -
getFoxFlag
private boolean getFoxFlag(int bitmask) -
canEquip
-
canPickupItem
- Overrides:
canPickupItem
in classMobEntity
-
spit
-
dropItem
-
loot
-
tick
public void tick() -
isBreedingItem
- Overrides:
isBreedingItem
in classAnimalEntity
-
onPlayerSpawnedChild
- Overrides:
onPlayerSpawnedChild
in classMobEntity
-
isChasing
public boolean isChasing() -
setChasing
public void setChasing(boolean chasing) -
isFullyCrouched
public boolean isFullyCrouched() -
setCrouching
public void setCrouching(boolean crouching) -
isInSneakingPose
public boolean isInSneakingPose()Returns whether the entity is in a crouching pose.Compared to
Entity.isSneaking()
, it only makes the entity appear crouching and does not bring other effects of sneaking, such as no less obvious name label rendering, no dismounting while riding, etc.This is used by vanilla for non-player entities to crouch, such as for foxes and cats.
- Overrides:
isInSneakingPose
in classEntity
-
setRollingHead
public void setRollingHead(boolean rollingHead) -
isRollingHead
public boolean isRollingHead() -
getHeadRoll
@Environment(CLIENT) public float getHeadRoll(float tickDelta) -
getBodyRotationHeightOffset
@Environment(CLIENT) public float getBodyRotationHeightOffset(float tickDelta) -
setTarget
-
computeFallDamage
protected int computeFallDamage(float fallDistance, float damageMultiplier)- Overrides:
computeFallDamage
in classLivingEntity
-
stopSleeping
private void stopSleeping() -
stopActions
private void stopActions() -
wantsToPickupItem
private boolean wantsToPickupItem() -
playAmbientSound
public void playAmbientSound()- Overrides:
playAmbientSound
in classMobEntity
-
getAmbientSound
- Overrides:
getAmbientSound
in classMobEntity
-
getHurtSound
- Overrides:
getHurtSound
in classLivingEntity
-
getDeathSound
- Overrides:
getDeathSound
in classLivingEntity
-
canTrust
-
drop
- Overrides:
drop
in classLivingEntity
-
canJumpChase
-
method_29919
- Overrides:
method_29919
in classEntity
-