Package net.minecraft.entity.mob
Class PiglinEntity
- All Implemented Interfaces:
RangedAttackMob,CrossbowUser,Monster,CommandOutput,Nameable
public class PiglinEntity extends HostileEntity implements CrossbowUser
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPiglinEntity.Activity -
Field Summary
Fields Modifier and Type Field Description private static TrackedData<Boolean>BABYprivate static EntityAttributeModifierBABY_SPEED_BOOSTprivate static UUIDBABY_SPEED_BOOST_IDprivate booleancannotHuntprivate static TrackedData<Boolean>CHARGINGprivate intconversionTicksprivate static TrackedData<Boolean>dancingprivate static TrackedData<Boolean>IMMUNE_TO_ZOMBIFICATIONprivate SimpleInventoryinventoryprotected static ImmutableList<MemoryModuleType<?>>MEMORY_MODULE_TYPESprotected static ImmutableList<SensorType<? extends Sensor<? super PiglinEntity>>>SENSOR_TYPESFields inherited from class net.minecraft.entity.mob.MobEntity
ambientSoundChance, armorDropChances, experiencePoints, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelectorFields 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, pushCooldown, randomLargeSeed, randomSmallSeed, roll, scoreAmount, serverHeadYaw, serverPitch, serverX, serverY, serverYaw, serverZ, sidewaysSpeed, SLEEPING_DIMENSIONS, stepBobbingAmount, stuckArrowTimer, stuckStingerTimer, upwardSpeedFields inherited from class net.minecraft.entity.Entity
age, chunkX, chunkY, chunkZ, dataTracker, distanceTraveled, fallDistance, field_25599, firstUpdate, FLAGS, fluidHeight, 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, world, yaw -
Constructor Summary
Constructors Constructor Description PiglinEntity(EntityType<? extends HostileEntity> type, World world) -
Method Summary
Modifier and Type Method Description protected ItemStackaddItem(ItemStack stack)voidattack(LivingEntity target, float pullProgress)booleancanConvert()booleancanGather(ItemStack stack)protected booleancanHunt()booleancanImmediatelyDespawn(double distanceSquared)protected booleancanInsertIntoInventory(ItemStack stack)static booleancanSpawn(EntityType<PiglinEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random)booleancanUseRangedWeapon(RangedWeaponItem weapon)protected Brain.Profile<PiglinEntity>createBrainProfile()static DefaultAttributeContainer.BuildercreatePiglinAttributes()booleandamage(DamageSource source, float amount)protected Brain<?>deserializeBrain(com.mojang.serialization.Dynamic<?> dynamic)protected voiddropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)private voidequipAtChance(EquipmentSlot slot, ItemStack stack)protected voidequipToMainHand(ItemStack stack)protected voidequipToOffHand(ItemStack stack)protected floatgetActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)PiglinEntity.ActivitygetActivity()protected SoundEventgetAmbientSound()Brain<PiglinEntity>getBrain()protected intgetCurrentExperience(PlayerEntity player)protected SoundEventgetDeathSound()doublegetHeightOffset()protected SoundEventgetHurtSound(DamageSource source)doublegetMountedHeightOffset()LivingEntitygetTarget()protected voidinitDataTracker()protected voidinitEquipment(LocalDifficulty difficulty)EntityDatainitialize(WorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CompoundTag entityTag)ActionResultinteractMob(PlayerEntity player, Hand hand)booleanisAdult()booleanisBaby()private booleanisCharging()booleanisDancing()protected booleanisDisallowedInPeaceful()private booleanisHoldingTool()private booleanisImmuneToZombification()protected voidloot(ItemEntity item)private ItemStackmakeInitialWeapon()protected booleanmethod_24846(ItemStack stack)private Entitymethod_26089(Entity entity, int int2)protected voidmethod_30086(SoundEvent soundEvent)protected voidmobTick()voidonTrackedDataSet(TrackedData<?> data)protected voidplayStepSound(BlockPos pos, BlockState state)voidpostShoot()protected booleanprefersNewEquipment(ItemStack newStack, ItemStack oldStack)voidreadCustomDataFromTag(CompoundTag tag)protected voidsendAiDebugData()voidsetBaby(boolean baby)private voidsetCannotHunt(boolean cannotHunt)voidsetCharging(boolean charging)voidsetDancing(boolean dancing)voidsetImmuneToZombification(boolean immuneToZombification)voidshoot(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray)booleanstartRiding(Entity entity, boolean force)voidwriteCustomDataToTag(CompoundTag tag)private voidzombify(ServerWorld serverWorld)Methods inherited from class net.minecraft.entity.mob.HostileEntity
canDropLootAndXp, canSpawnIgnoreLightLevel, canSpawnInDark, createHostileAttributes, getArrowType, getFallSound, getPathfindingFavor, getSoundCategory, getSplashSound, getSwimSound, isAngryAt, isSpawnDark, shouldDropLoot, tickMovement, updateDespawnCounterMethods inherited from class net.minecraft.entity.mob.MobEntityWithAi
canSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeashMethods inherited from class net.minecraft.entity.mob.MobEntity
attachLeash, baseTick, canBeControlledByRider, canBeLeashedBy, canEquipmentSlotContain, canMobSpawn, canMoveVoluntarily, cannotDespawn, canPickUp, canPickupItem, canPickUpLoot, canSpawn, canTarget, canTarget, checkDespawn, createBodyControl, createMobAttributes, createNavigation, detachLeash, dropLoot, equip, equipLootStack, equipStack, getArmorItems, getBodyYawSpeed, getDropChance, getEquipmentForSlot, getEquippedStack, getHoldingEntity, getItemsHand, getJumpControl, getLimitPerChunk, getLookControl, getLookPitchSpeed, getLookYawSpeed, getLootContextBuilder, getLootTable, getLootTableId, getMainArm, getMinAmbientSoundDelay, getMoveControl, getNavigation, getPathfindingPenalty, getPositionTarget, getPositionTargetRange, getPreferredEquipmentSlot, getSafeFallDistance, getVisibilityCache, handleStatus, hasPositionTarget, initGoals, interact, isAiDisabled, isAttacking, isInDaylight, isInWalkTargetRange, isInWalkTargetRange, isLeashed, isLeftHanded, isLogicalSideForUpdatingMovement, isPersistent, lookAtEntity, method_29243, method_29244, method_30076, movesIndependently, onEatingGrass, onPlayerSpawnedChild, playAmbientSound, playHurtSound, playSpawnEffects, prefersNewDamageableItem, setAiDisabled, setAttacking, setCanPickUpLoot, setEquipmentDropChance, setForwardSpeed, setHoldingEntityId, setLeftHanded, setMovementSpeed, setPathfindingPenalty, setPersistent, setPositionTarget, setSidewaysSpeed, setTarget, setUpwardSpeed, spawnsTooManyForEachTry, swimUpward, tick, tickNewAi, tryAttack, tryEquip, turnHead, updateDropChances, updateEnchantments, updateGoalControlsMethods inherited from class net.minecraft.entity.LivingEntity
addSoulSpeedBoostIfNeeded, addStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyMovementEffects, applyStatusEffect, attackLivingEntity, canBeRiddenInWater, canBreatheInWater, canHaveStatusEffect, canSee, canWalkOnFluid, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createLivingAttributes, createSpawnPacket, damageArmor, damageShield, destroy, displaySoulSpeedEffects, drop, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, getClimbingPos, getDamageTracker, getDespawnCounter, getDimensions, getDrinkSound, getEatSound, getEyeHeight, 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, getYaw, handleFallDamage, hasStackEquipped, hasStatusEffect, heal, hurtByWater, isAffectedBySplashPotions, isAlive, 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_29499, method_29500, method_29920, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, playBlockFallSound, push, pushAway, pushAwayFrom, removeSoulSpeedBoost, removeStatusEffect, removeStatusEffectInternal, scheduleVelocityUpdate, sendEquipmentBreakStatus, sendPickup, sendToolBreakStatus, setAbsorptionAmount, setAttacker, setAttacking, setCurrentHand, setDespawnCounter, setHeadYaw, setHealth, setJumping, setLivingFlag, setNearbySongPlaying, setOnGround, setPushCooldown, setSleepingPosition, setSprinting, setStackInHand, setStingerCount, setStuckArrowCount, setYaw, shouldAlwaysDropXp, shouldDisplaySoulSpeedEffects, shouldRenderName, sleep, spawnConsumptionEffects, stopRiding, stopUsingItem, swingHand, swingHand, takeKnockback, takeShieldHit, teleport, tickCramming, tickHandSwing, tickRiding, tickStatusEffects, travel, 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, 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, getFluidHeight, getHardCollisionBox, getHeight, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastNetherPortalDirection, getLastNetherPortalDirectionVector, getMaxAir, getMaxNetherPortalTime, 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, getStandingEyeHeight, getTargetingMargin, getTeamColorValue, getType, getUuid, getUuidAsString, getVehicle, getVelocity, getVelocityAffectingPos, getVisibilityBoundingBox, 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, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, method_29239, method_29240, method_29241, method_29495, method_29919, move, moveToBoundingBoxCenter, offsetX, offsetZ, onBlockCollision, onBubbleColumnCollision, onBubbleColumnSurfaceCollision, onKilledOther, onPassengerLookAround, onPlayerCollision, onStartedTrackingBy, onStoppedTrackingBy, onStruckByLightning, onSwimmingStart, playFlySound, playSound, 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, 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, updateVelocity, updateWaterState, wouldPoseNotCollideMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.entity.CrossbowUser
getProjectileLaunchVelocity, shoot, shoot
-
Field Details
-
BABY
-
IMMUNE_TO_ZOMBIFICATION
-
CHARGING
-
dancing
-
BABY_SPEED_BOOST_ID
-
BABY_SPEED_BOOST
-
SENSOR_TYPES
protected static final ImmutableList<SensorType<? extends Sensor<? super PiglinEntity>>> SENSOR_TYPES -
MEMORY_MODULE_TYPES
-
conversionTicks
private int conversionTicks -
inventory
-
cannotHunt
private boolean cannotHunt
-
-
Constructor Details
-
Method Details
-
writeCustomDataToTag
- Overrides:
writeCustomDataToTagin classMobEntity
-
readCustomDataFromTag
- Overrides:
readCustomDataFromTagin classMobEntity
-
dropEquipment
- Overrides:
dropEquipmentin classMobEntity
-
addItem
-
canInsertIntoInventory
-
initDataTracker
protected void initDataTracker()- Overrides:
initDataTrackerin classMobEntity
-
onTrackedDataSet
- Overrides:
onTrackedDataSetin classLivingEntity
-
createPiglinAttributes
-
canSpawn
public static boolean canSpawn(EntityType<PiglinEntity> type, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random) -
initialize
@Nullable public EntityData initialize(WorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)- Overrides:
initializein classMobEntity
-
isDisallowedInPeaceful
protected boolean isDisallowedInPeaceful()- Overrides:
isDisallowedInPeacefulin classHostileEntity
-
canImmediatelyDespawn
public boolean canImmediatelyDespawn(double distanceSquared)- Overrides:
canImmediatelyDespawnin classMobEntity
-
initEquipment
- Overrides:
initEquipmentin classMobEntity
-
equipAtChance
-
createBrainProfile
- Overrides:
createBrainProfilein classLivingEntity
-
deserializeBrain
- Overrides:
deserializeBrainin classLivingEntity
-
getBrain
- Overrides:
getBrainin classLivingEntity
-
interactMob
- Overrides:
interactMobin classMobEntity
-
getActiveEyeHeight
- Overrides:
getActiveEyeHeightin classLivingEntity
-
getHeightOffset
public double getHeightOffset()- Overrides:
getHeightOffsetin classEntity
-
getMountedHeightOffset
public double getMountedHeightOffset()- Overrides:
getMountedHeightOffsetin classEntity
-
setBaby
public void setBaby(boolean baby) -
isBaby
public boolean isBaby()- Overrides:
isBabyin classLivingEntity
-
isAdult
public boolean isAdult() -
setImmuneToZombification
public void setImmuneToZombification(boolean immuneToZombification) -
isImmuneToZombification
private boolean isImmuneToZombification() -
setCannotHunt
private void setCannotHunt(boolean cannotHunt) -
canHunt
protected boolean canHunt() -
canConvert
public boolean canConvert() -
mobTick
protected void mobTick() -
getCurrentExperience
- Overrides:
getCurrentExperiencein classMobEntity
-
zombify
-
getTarget
- Specified by:
getTargetin interfaceCrossbowUser- Overrides:
getTargetin classMobEntity
-
makeInitialWeapon
-
isCharging
private boolean isCharging() -
setCharging
public void setCharging(boolean charging)- Specified by:
setChargingin interfaceCrossbowUser
-
postShoot
public void postShoot()- Specified by:
postShootin interfaceCrossbowUser
-
getActivity
-
isDancing
public boolean isDancing() -
setDancing
public void setDancing(boolean dancing) -
isHoldingTool
private boolean isHoldingTool() -
damage
- Overrides:
damagein classHostileEntity
-
attack
- Specified by:
attackin interfaceRangedAttackMob
-
shoot
public void shoot(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray)- Specified by:
shootin interfaceCrossbowUser
-
canUseRangedWeapon
- Overrides:
canUseRangedWeaponin classMobEntity
-
equipToMainHand
-
equipToOffHand
-
canGather
-
method_24846
-
prefersNewEquipment
- Overrides:
prefersNewEquipmentin classMobEntity
-
loot
-
startRiding
- Overrides:
startRidingin classMobEntity
-
method_26089
-
getAmbientSound
- Overrides:
getAmbientSoundin classMobEntity
-
getHurtSound
- Overrides:
getHurtSoundin classHostileEntity
-
getDeathSound
- Overrides:
getDeathSoundin classHostileEntity
-
playStepSound
- Overrides:
playStepSoundin classEntity
-
method_30086
-
sendAiDebugData
protected void sendAiDebugData()- Overrides:
sendAiDebugDatain classMobEntity
-