public abstract class MobEntity extends LivingEntity
Entity.PositionUpdater
Modifier and Type | Field and Description |
---|---|
int |
ambientSoundChance |
protected float[] |
armorDropChances |
private DefaultedList<ItemStack> |
armorItems |
private BodyControl |
bodyControl |
protected int |
experiencePoints |
protected GoalSelector |
goalSelector |
protected float[] |
handDropChances |
private DefaultedList<ItemStack> |
handItems |
private Entity |
holdingEntity |
private int |
holdingEntityId |
protected JumpControl |
jumpControl |
private CompoundTag |
leashTag |
protected LookControl |
lookControl |
private Identifier |
lootTable |
private long |
lootTableSeed |
private static TrackedData<Byte> |
MOB_FLAGS |
protected MoveControl |
moveControl |
protected EntityNavigation |
navigation |
private Map<PathNodeType,Float> |
pathfindingPenalties |
private boolean |
persistent |
private boolean |
pickUpLoot |
private BlockPos |
positionTarget |
private float |
positionTargetRange |
private LivingEntity |
target |
protected GoalSelector |
targetSelector |
private MobVisibilityCache |
visibilityCache |
activeItemStack, attackingPlayer, bodyTrackingIncrements, bodyYaw, brain, dead, deathTime, defaultMaximumHealth, despawnCounter, field_20347, 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, pushCooldown, randomLargeSeed, randomSmallSeed, roll, scoreAmount, serverHeadYaw, serverPitch, serverX, serverY, serverYaw, serverZ, sidewaysSpeed, SLEEPING_DIMENSIONS, stepBobbingAmount, stuckArrowTimer, upwardSpeed
age, chunkX, chunkY, chunkZ, dataTracker, dimension, distanceTraveled, fallDistance, firstUpdate, FLAGS, glowing, horizontalCollision, horizontalSpeed, ignoreCameraFrustum, inanimate, inLava, inNetherPortal, lastNetherPortalDirection, lastNetherPortalDirectionVector, lastNetherPortalPosition, lastRenderX, lastRenderY, lastRenderZ, LOGGER, movementMultiplier, netherPortalCooldown, netherPortalTime, noClip, onGround, pitch, POSE, prevHorizontalSpeed, prevPitch, prevX, prevY, prevYaw, prevZ, pushSpeedReduction, random, removed, ridingCooldown, stepHeight, submergedInWater, teleporting, timeUntilRegen, touchingWater, trackedX, trackedY, trackedZ, updateNeeded, uuid, uuidString, velocityDirty, velocityModified, verticalCollision, waterHeight, world, yaw
DUMMY
Modifier | Constructor and Description |
---|---|
protected |
MobEntity(EntityType<? extends MobEntity> type,
World world) |
addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyFrostWalker, attackLivingEntity, attemptSprintingParticles, canBeRiddenInWater, canBreatheInWater, canDropLootAndXp, canHaveStatusEffect, canSee, canWalkOnLava, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createLivingAttributes, createSpawnPacket, damage, damageArmor, damageShield, deserializeBrain, destroy, drop, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveEyeHeight, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getArrowType, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttribute, getAttributeInstance, getAttributes, getBaseMovementSpeedMultiplier, getBlockState, getBrain, getDamageTracker, getDeathSound, getDespawnCounter, getDimensions, getDrinkSound, getEatSound, getEyeHeight, getFallSound, getGroup, getHandSwingProgress, getHeadYaw, getHealth, getHurtSound, getItemUseTime, getItemUseTimeLeft, getJumpVelocity, getLastAttackedTime, getLastAttackTime, getLeaningPitch, getMainHandStack, getMaximumHealth, getMovementSpeed, getNextAirOnLand, getNextAirUnderwater, getOffHandStack, getPoses, getPrimeAdversary, getRandom, getRecentDamageSource, getRoll, getScaleFactor, getSleepingDirection, getSleepingPosition, getSoundPitch, getSoundVolume, getStackInHand, getStatusEffect, getStatusEffects, getStingerCount, getStuckArrowCount, getVelocityMultiplier, getYaw, handleFallDamage, hasStackEquipped, hasStatusEffect, heal, isAffectedBySplashPotions, isAlive, isBaby, isBlocking, isClimbing, isFallFlying, isHolding, isHolding, isHoldingOntoLadder, isImmobile, isInsideWall, isInSwimmingPose, isMobOrPlayer, isPushable, isSleeping, isTarget, isUndead, isUsingItem, isUsingRiptide, jump, kill, knockback, knockDownwards, lookAt, markEffectsDirty, method_24832, method_24833, method_25937, method_26081, method_26082, method_26317, method_26318, method_26826, method_27071, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, onTrackedDataSet, playBlockFallSound, push, pushAway, pushAwayFrom, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAbsorptionAmount, setAttacker, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setNearbySongPlaying, setOnGround, setPushCooldown, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldAlwaysDropXp, shouldRenderName, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickStatusEffects, travel, updatePostDeath, updatePotionVisibility, updateTrackedHeadRotation, updateTrackedPositionAndAngles, wakeUp
addPassenger, addScoreboardTag, addVelocity, adjustMovementForCollisions, adjustMovementForCollisions, adjustMovementForPiston, adjustMovementForSneaking, adjustSingleAxisMovementForCollisions, afterSpawn, applyMirror, applyRotation, bypassesLandingEffects, bypassesSteppingEffects, calculateBoundsForPose, calculateDimensions, calculateNextStepSoundDistance, canAddPassenger, canAvoidTraps, canBeSpectated, canClimb, canExplosionDestroyBlock, canFly, canStartRiding, canUsePortals, changeDimension, changeLookDirection, checkBlockCollision, copyFrom, copyPositionAndRotation, dealDamage, detach, distanceTo, doesNotCollide, doesRenderOnFire, dropItem, dropItem, dropStack, dropStack, entityDataRequiresOperator, equals, extinguish, fromTag, getAir, getBlockPos, getBodyY, getBoundingBox, getBrightnessAtEyes, getBurningDuration, getCameraPosVec, getCollisionBox, getCommandSource, getCustomName, getDataTracker, getDefaultName, getDefaultNetherPortalCooldown, getDisplayName, getEffectiveExplosionResistance, getEntityId, getEntityName, getEntityWorld, getEyeHeight, getEyeY, getFireTicks, getFlag, getHardCollisionBox, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastNetherPortalDirection, getLastNetherPortalDirectionVector, getMaxAir, getMaxNetherPortalTime, getMountedHeightOffset, getMovementDirection, getName, getOppositeRotationVector, getOppositeRotationVector, getParticleX, getParticleZ, 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, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getVisibilityBoundingBox, getWaterHeight, getWidth, getX, getY, getZ, handleAttack, hasCustomName, hashCode, hasNoGravity, hasPassenger, hasPassengerDeep, hasPassengers, hasPassengerType, hasPermissionLevel, hasPlayerRider, hasVehicle, hasWings, interactAt, isAttackable, isConnectedThroughVehicle, isCustomNameVisible, isDescending, isFireImmune, isGlowing, isImmuneToExplosion, isInLava, isInRange, isInsideWaterOrBubbleColumn, isInSneakingPose, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isLiving, isOnFire, isOnGround, isPartOf, isSilent, isSneaking, isSneaky, isSpectator, isSprinting, isSubmergedIn, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_24826, method_24829, move, moveToBoundingBoxCenter, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, playStepSound, playSwimSound, populateCrashReport, positAfterTeleport, pushOutOfBlocks, rayTrace, refreshPosition, refreshPositionAndAngles, refreshPositionAndAngles, remove, removeAllPassengers, removePassenger, removeScoreboardTag, requestTeleport, resetPosition, saveSelfToTag, saveToTag, sendSystemMessage, setAir, setBoundingBox, setCustomName, setCustomNameVisible, setEntityId, setFireTicks, setFlag, setGlowing, setInLava, setInNetherPortal, setInvisible, setInvulnerable, setNoGravity, setOnFireFor, setOnFireFromLava, setPos, setPose, setRenderDistanceMultiplier, setRotation, setSilent, setSneaking, setSwimming, setUuid, setVelocity, setVelocity, setVelocityClient, setWorld, shouldBroadcastConsoleToOps, shouldLeaveSwimmingPose, shouldReceiveFeedback, shouldRender, shouldRender, shouldSetPositionOnLoad, shouldTrackOutput, slowMovement, spawnSprintingParticles, squaredDistanceTo, squaredDistanceTo, squaredDistanceTo, squaredHorizontalLength, startRiding, streamPassengersRecursively, teleport, teleportRequested, tickNetherPortal, tickNetherPortalCooldown, toListTag, toListTag, toString, toTag, updateKilledAdvancementCriterion, updateMovementInFluid, updatePassengerPosition, updatePassengerPosition, updatePosition, updatePositionAndAngles, updatePositionsRecursively, updateSwimming, updateTrackedPosition, updateVelocity, updateWaterState, wouldPoseNotCollide
private static final TrackedData<Byte> MOB_FLAGS
public int ambientSoundChance
protected int experiencePoints
protected LookControl lookControl
protected MoveControl moveControl
protected JumpControl jumpControl
private final BodyControl bodyControl
protected EntityNavigation navigation
protected final GoalSelector goalSelector
protected final GoalSelector targetSelector
private LivingEntity target
private final MobVisibilityCache visibilityCache
private final DefaultedList<ItemStack> handItems
protected final float[] handDropChances
private final DefaultedList<ItemStack> armorItems
protected final float[] armorDropChances
private boolean pickUpLoot
private boolean persistent
private final Map<PathNodeType,Float> pathfindingPenalties
private Identifier lootTable
private long lootTableSeed
private int holdingEntityId
@Nullable private CompoundTag leashTag
private BlockPos positionTarget
private float positionTargetRange
protected MobEntity(EntityType<? extends MobEntity> type, World world)
protected void initGoals()
public static DefaultAttributeContainer.Builder createMobAttributes()
protected EntityNavigation createNavigation(World world)
protected boolean movesIndependently()
public float getPathfindingPenalty(PathNodeType nodeType)
public void setPathfindingPenalty(PathNodeType nodeType, float penalty)
protected BodyControl createBodyControl()
public LookControl getLookControl()
public MoveControl getMoveControl()
public JumpControl getJumpControl()
public EntityNavigation getNavigation()
public MobVisibilityCache getVisibilityCache()
@Nullable public LivingEntity getTarget()
public void setTarget(@Nullable LivingEntity target)
public boolean canTarget(EntityType<?> type)
canTarget
in class LivingEntity
public boolean method_25938(RangedWeaponItem rangedWeaponItem)
public void onEatingGrass()
protected void initDataTracker()
initDataTracker
in class LivingEntity
public int getMinAmbientSoundDelay()
public void playAmbientSound()
public void baseTick()
baseTick
in class LivingEntity
protected void playHurtSound(DamageSource source)
playHurtSound
in class LivingEntity
private void resetSoundDelay()
protected int getCurrentExperience(PlayerEntity player)
getCurrentExperience
in class LivingEntity
public void playSpawnEffects()
@Environment(value=CLIENT) public void handleStatus(byte status)
handleStatus
in class LivingEntity
public void tick()
tick
in class LivingEntity
protected void method_20417()
protected float turnHead(float bodyRotation, float headRotation)
turnHead
in class LivingEntity
@Nullable protected SoundEvent getAmbientSound()
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag
in class LivingEntity
public void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag
in class LivingEntity
protected void dropLoot(DamageSource source, boolean causedByPlayer)
dropLoot
in class LivingEntity
protected LootContext.Builder getLootContextBuilder(boolean causedByPlayer, DamageSource source)
getLootContextBuilder
in class LivingEntity
public final Identifier getLootTable()
getLootTable
in class LivingEntity
protected Identifier getLootTableId()
public void setForwardSpeed(float forwardSpeed)
public void setUpwardSpeed(float upwardSpeed)
public void setSidewaysSpeed(float sidewaysMovement)
public void setMovementSpeed(float movementSpeed)
setMovementSpeed
in class LivingEntity
public void tickMovement()
tickMovement
in class LivingEntity
protected void loot(ItemEntity item)
public boolean tryEquip(ItemStack equipment)
protected void equipLootStack(EquipmentSlot equipmentSlot, ItemStack stack)
public void method_25939(EquipmentSlot equipmentSlot)
public boolean canPickupItem(ItemStack stack)
public boolean canGather(ItemStack stack)
public boolean canImmediatelyDespawn(double distanceSquared)
public boolean cannotDespawn()
protected boolean isDisallowedInPeaceful()
public void checkDespawn()
checkDespawn
in class Entity
protected final void tickNewAi()
tickNewAi
in class LivingEntity
protected void sendAiDebugData()
protected void mobTick()
public int getLookPitchSpeed()
public int getBodyYawSpeed()
public int getLookYawSpeed()
public void lookAtEntity(Entity targetEntity, float maxYawChange, float maxPitchChange)
private float changeAngle(float oldAngle, float newAngle, float maxChangeInAngle)
public static boolean canMobSpawn(EntityType<? extends MobEntity> type, IWorld world, SpawnType spawnType, BlockPos pos, Random random)
public boolean canSpawn(WorldView world)
public int getLimitPerChunk()
public boolean spawnsTooManyForEachTry(int count)
public int getSafeFallDistance()
getSafeFallDistance
in class Entity
public Iterable<ItemStack> getItemsHand()
getItemsHand
in class Entity
public Iterable<ItemStack> getArmorItems()
getArmorItems
in class LivingEntity
public ItemStack getEquippedStack(EquipmentSlot slot)
getEquippedStack
in class LivingEntity
public void equipStack(EquipmentSlot slot, ItemStack stack)
equipStack
in class LivingEntity
protected void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)
dropEquipment
in class LivingEntity
protected float getDropChance(EquipmentSlot equipmentSlot)
protected void initEquipment(LocalDifficulty difficulty)
public static EquipmentSlot getPreferredEquipmentSlot(ItemStack stack)
@Nullable public static Item getEquipmentForSlot(EquipmentSlot equipmentSlot, int equipmentLevel)
protected void updateEnchantments(LocalDifficulty difficulty)
@Nullable public EntityData initialize(IWorld world, LocalDifficulty difficulty, SpawnType spawnType, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)
public boolean canBeControlledByRider()
public void setPersistent()
public void setEquipmentDropChance(EquipmentSlot slot, float float2)
public boolean canPickUpLoot()
public void setCanPickUpLoot(boolean bool)
public boolean canPickUp(ItemStack stack)
canPickUp
in class LivingEntity
public boolean isPersistent()
public final boolean interact(PlayerEntity player, Hand hand)
protected void onPlayerSpawnedChild(PlayerEntity player, MobEntity child)
protected boolean interactMob(PlayerEntity player, Hand hand)
public boolean isInWalkTargetRange()
public boolean isInWalkTargetRange(BlockPos pos)
public void setPositionTarget(BlockPos target, int range)
public BlockPos getPositionTarget()
public float getPositionTargetRange()
public boolean hasPositionTarget()
protected void updateLeash()
public void detachLeash(boolean sendPacket, boolean bool)
public boolean canBeLeashedBy(PlayerEntity player)
public boolean isLeashed()
public void attachLeash(Entity entity, boolean bool)
@Environment(value=CLIENT) public void setHoldingEntityId(int id)
public boolean startRiding(Entity entity, boolean force)
startRiding
in class Entity
private void deserializeLeashTag()
public boolean isLogicalSideForUpdatingMovement()
isLogicalSideForUpdatingMovement
in class Entity
public static boolean canEquipmentSlotContain(EquipmentSlot slot, ItemStack item)
public boolean canMoveVoluntarily()
canMoveVoluntarily
in class LivingEntity
public void setAiDisabled(boolean aiDisabled)
public void setLeftHanded(boolean leftHanded)
public void setAttacking(boolean attacking)
public boolean isAiDisabled()
public boolean isLeftHanded()
public boolean isAttacking()
public void setBaby(boolean baby)
public Arm getMainArm()
getMainArm
in class LivingEntity
public boolean canTarget(LivingEntity target)
canTarget
in class LivingEntity
public boolean tryAttack(Entity target)
tryAttack
in class LivingEntity
private void method_24521(PlayerEntity playerEntity, ItemStack itemStack, ItemStack itemStack2)
protected boolean isInDaylight()
protected void swimUpward(Tag<Fluid> fluid)
swimUpward
in class LivingEntity