Package net.minecraft.entity.mob
Class MobEntity
java.lang.Object
net.minecraft.entity.Entity
net.minecraft.entity.LivingEntity
net.minecraft.entity.mob.MobEntity
- All Implemented Interfaces:
class_5568,CommandOutput,Nameable
- Direct Known Subclasses:
AmbientEntity,EnderDragonEntity,FlyingEntity,PathAwareEntity,SlimeEntity
public abstract class MobEntity extends LivingEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.PositionUpdater, Entity.RemovalReason -
Field Summary
Fields Modifier and Type Field Description intambientSoundChanceprotected float[]armorDropChancesprivate DefaultedList<ItemStack>armorItemsprivate BodyControlbodyControlprotected intexperiencePointsprotected GoalSelectorgoalSelectorprotected float[]handDropChancesprivate DefaultedList<ItemStack>handItemsprivate EntityholdingEntityprivate intholdingEntityIdprotected JumpControljumpControlprivate CompoundTagleashTagprotected LookControllookControlprivate IdentifierlootTableprivate longlootTableSeedprivate static TrackedData<Byte>MOB_FLAGSprotected MoveControlmoveControlprotected EntityNavigationnavigationprivate Map<PathNodeType,Float>pathfindingPenaltiesprivate booleanpersistentprivate booleanpickUpLootprivate BlockPospositionTargetprivate floatpositionTargetRangeprivate LivingEntitytargetprotected GoalSelectortargetSelectorprivate MobVisibilityCachevisibilityCacheFields 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, upwardSpeedFields inherited from class net.minecraft.entity.Entity
age, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inNetherPortal, inPowderSnow, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, ridingCooldown, stepHeight, submergedInWater, timeUntilRegen, touchingWater, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, world, yawFields inherited from interface net.minecraft.server.command.CommandOutput
DUMMY -
Constructor Summary
Constructors Modifier Constructor Description protectedMobEntity(EntityType<? extends MobEntity> type, World world) -
Method Summary
Methods inherited from class net.minecraft.entity.LivingEntity
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canFreeze, canHaveStatusEffect, canSee, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createBrainProfile, createLivingAttributes, createSpawnPacket, damage, damageArmor, damageShield, deserializeBrain, destroy, displaySoulSpeedEffects, drop, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveEyeHeight, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getArrowType, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getBrain, getClimbingPos, getDamageTracker, getDeathSound, getDespawnCounter, getDimensions, getDrinkSound, getEatSound, getEyeHeight, getFallSound, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getHurtSound, 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, isBaby, isBlocking, isClimbing, isDead, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isImmobile, isInsideWall, isInSwimmingPose, isMobOrPlayer, isOnSoulSpeedBlock, isPushable, isSleeping, isTarget, isUndead, isUsingItem, isUsingRiptide, jump, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_26317, method_26318, method_29242, method_29500, method_30633, method_31079, method_32318, method_32324, method_32325, method_32326, method_33190, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, onTrackedDataSet, 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, shouldSwimInFluids, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickRiptide, tickStatusEffects, travel, triggerItemPickedUpByEntityCriteria, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles, wakeUpMethods 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, discard, dismountVehicle, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, emitGameEvent, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBlockX, getBlockY, getBlockZ, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getChunkPos, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFirstPassenger, getFlag, getFluidHeight, getFreezingScale, getFrozenTicks, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getMaxAir, getMaxNetherPortalTime, getMinFreezeDamageTicks, 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, isCollidable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isFreezing, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInSneakingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isOnFire, isOnGround, isPartOf, isPlayer, isRemoved, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29241, method_29919, method_30330, method_30632, method_30634, method_30950, method_30951, method_31166, method_31473, method_31744, method_31746, method_31748, method_32875, method_32877, method_33189, move, moveToBoundingBoxCenter, moveToWorld, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onSpawnPacket, 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, setFrozenTicks, setGlowing, setInNetherPortal, setInPowderSnow, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setRemoved, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldSpawnSprintingParticles, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, unsetRemoved, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerForDismount, updatePassengerPosition, updatePosition, updatePositionAndAngles, updateSwimming, updateTrackedPosition, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
-
Field Details
-
MOB_FLAGS
-
ambientSoundChance
public int ambientSoundChance -
experiencePoints
protected int experiencePoints -
lookControl
-
moveControl
-
jumpControl
-
bodyControl
-
goalSelector
-
targetSelector
-
target
-
visibilityCache
-
handItems
-
handDropChances
protected final float[] handDropChances -
armorItems
-
armorDropChances
protected final float[] armorDropChances -
pickUpLoot
private boolean pickUpLoot -
persistent
private boolean persistent -
pathfindingPenalties
-
lootTable
-
lootTableSeed
private long lootTableSeed -
holdingEntity
-
holdingEntityId
private int holdingEntityId -
leashTag
-
positionTarget
-
positionTargetRange
private float positionTargetRange
-
-
Constructor Details
-
MobEntity
-
-
Method Details
-
initGoals
protected void initGoals() -
createMobAttributes
-
movesIndependently
protected boolean movesIndependently()When true, causes this entity to take over pathfinding for its controlling passenger. -
getPathfindingPenalty
-
setPathfindingPenalty
-
method_29244
-
createBodyControl
-
getLookControl
-
getMoveControl
-
getJumpControl
-
getVisibilityCache
-
getTarget
-
setTarget
-
canTarget
- Overrides:
canTargetin classLivingEntity
-
canUseRangedWeapon
-
onEatingGrass
public void onEatingGrass() -
initDataTracker
protected void initDataTracker()- Overrides:
initDataTrackerin classLivingEntity
-
getMinAmbientSoundDelay
public int getMinAmbientSoundDelay() -
playAmbientSound
public void playAmbientSound() -
baseTick
public void baseTick()- Overrides:
baseTickin classLivingEntity
-
playHurtSound
- Overrides:
playHurtSoundin classLivingEntity
-
resetSoundDelay
private void resetSoundDelay() -
getCurrentExperience
- Overrides:
getCurrentExperiencein classLivingEntity
-
playSpawnEffects
public void playSpawnEffects() -
handleStatus
@Environment(CLIENT) public void handleStatus(byte status)- Overrides:
handleStatusin classLivingEntity
-
tick
public void tick()- Overrides:
tickin classLivingEntity
-
updateGoalControls
protected void updateGoalControls() -
turnHead
protected float turnHead(float bodyRotation, float headRotation)- Overrides:
turnHeadin classLivingEntity
-
getAmbientSound
-
writeCustomDataToTag
- Overrides:
writeCustomDataToTagin classLivingEntity
-
readCustomDataFromTag
- Overrides:
readCustomDataFromTagin classLivingEntity
-
dropLoot
- Overrides:
dropLootin classLivingEntity
-
getLootContextBuilder
- Overrides:
getLootContextBuilderin classLivingEntity
-
getLootTable
- Overrides:
getLootTablein classLivingEntity
-
getLootTableId
-
setForwardSpeed
public void setForwardSpeed(float forwardSpeed) -
setUpwardSpeed
public void setUpwardSpeed(float upwardSpeed) -
setSidewaysSpeed
public void setSidewaysSpeed(float sidewaysMovement) -
setMovementSpeed
public void setMovementSpeed(float movementSpeed)- Overrides:
setMovementSpeedin classLivingEntity
-
tickMovement
public void tickMovement()- Overrides:
tickMovementin classLivingEntity
-
loot
-
tryEquip
-
equipLootStack
-
updateDropChances
-
prefersNewEquipment
-
prefersNewDamageableItem
-
canPickupItem
-
canGather
-
canImmediatelyDespawn
public boolean canImmediatelyDespawn(double distanceSquared) -
cannotDespawn
public boolean cannotDespawn() -
isDisallowedInPeaceful
protected boolean isDisallowedInPeaceful() -
checkDespawn
public void checkDespawn()- Overrides:
checkDespawnin classEntity
-
tickNewAi
protected final void tickNewAi()- Overrides:
tickNewAiin classLivingEntity
-
sendAiDebugData
protected void sendAiDebugData() -
mobTick
protected void mobTick() -
getLookPitchSpeed
public int getLookPitchSpeed() -
getBodyYawSpeed
public int getBodyYawSpeed() -
getLookYawSpeed
public int getLookYawSpeed() -
lookAtEntity
-
changeAngle
private float changeAngle(float oldAngle, float newAngle, float maxChangeInAngle) -
canMobSpawn
public static boolean canMobSpawn(EntityType<? extends MobEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) -
canSpawn
-
canSpawn
-
getLimitPerChunk
public int getLimitPerChunk() -
spawnsTooManyForEachTry
public boolean spawnsTooManyForEachTry(int count) -
getSafeFallDistance
public int getSafeFallDistance()- Overrides:
getSafeFallDistancein classEntity
-
getItemsHand
- Overrides:
getItemsHandin classEntity
-
getArmorItems
- Specified by:
getArmorItemsin classLivingEntity
-
getEquippedStack
- Specified by:
getEquippedStackin classLivingEntity
-
equipStack
- Specified by:
equipStackin classLivingEntity
-
dropEquipment
- Overrides:
dropEquipmentin classLivingEntity
-
getDropChance
-
initEquipment
-
getEquipmentForSlot
-
updateEnchantments
-
method_30759
protected void method_30759(float float2) -
method_30758
-
initialize
@Nullable public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag) -
canBeControlledByRider
public boolean canBeControlledByRider() -
setPersistent
public void setPersistent() -
setEquipmentDropChance
-
canPickUpLoot
public boolean canPickUpLoot() -
setCanPickUpLoot
public void setCanPickUpLoot(boolean pickUpLoot) -
canEquip
- Overrides:
canEquipin classLivingEntity
-
isPersistent
public boolean isPersistent() -
interact
Called when a player interacts with this entity. -
method_29506
-
onPlayerSpawnedChild
-
interactMob
-
isInWalkTargetRange
public boolean isInWalkTargetRange() -
isInWalkTargetRange
-
setPositionTarget
-
getPositionTarget
-
getPositionTargetRange
public float getPositionTargetRange() -
hasPositionTarget
public boolean hasPositionTarget() -
method_29243
-
updateLeash
protected void updateLeash() -
detachLeash
public void detachLeash(boolean sendPacket, boolean dropItem) -
canBeLeashedBy
-
isLeashed
public boolean isLeashed() -
getHoldingEntity
-
attachLeash
-
setHoldingEntityId
@Environment(CLIENT) public void setHoldingEntityId(int id) -
startRiding
- Overrides:
startRidingin classEntity
-
deserializeLeashTag
private void deserializeLeashTag() -
isLogicalSideForUpdatingMovement
public boolean isLogicalSideForUpdatingMovement()- Overrides:
isLogicalSideForUpdatingMovementin classEntity
-
canMoveVoluntarily
public boolean canMoveVoluntarily()- Overrides:
canMoveVoluntarilyin classLivingEntity
-
setAiDisabled
public void setAiDisabled(boolean aiDisabled) -
setLeftHanded
public void setLeftHanded(boolean leftHanded) -
setAttacking
public void setAttacking(boolean attacking) -
isAiDisabled
public boolean isAiDisabled() -
isLeftHanded
public boolean isLeftHanded() -
isAttacking
public boolean isAttacking() -
setBaby
public void setBaby(boolean baby) -
getMainArm
- Specified by:
getMainArmin classLivingEntity
-
method_33191
-
canTarget
- Overrides:
canTargetin classLivingEntity
-
tryAttack
- Overrides:
tryAttackin classLivingEntity
-
disablePlayerShield
-
isAffectedByDaylight
protected boolean isAffectedByDaylight() -
swimUpward
- Overrides:
swimUpwardin classLivingEntity
-
method_30076
protected void method_30076()- Overrides:
method_30076in classEntity
-
getPickBlockStack
- Overrides:
getPickBlockStackin classEntity
-