public class PiglinEntity extends HostileEntity implements CrossbowUser
| Modifier and Type | Class and Description |
|---|---|
static class |
PiglinEntity.Activity |
Entity.PositionUpdater| Modifier and Type | Field and Description |
|---|---|
private static TrackedData<Boolean> |
BABY |
private static EntityAttributeModifier |
BABY_SPEED_BOOST_MODIFIER |
private static UUID |
BABY_SPEED_BOOST_MODIFIER_ID |
private static TrackedData<Boolean> |
CHARGING |
private int |
conversionTicks |
private boolean |
field_23738 |
private static TrackedData<Boolean> |
IMMUNE_TO_ZOMBIFICATION |
private BasicInventory |
inventory |
protected static ImmutableList<MemoryModuleType<?>> |
MEMORY_MODULE_TYPES |
protected static ImmutableList<SensorType<? extends Sensor<? super PiglinEntity>>> |
SENSOR_TYPES |
ambientSoundChance, armorDropChances, experiencePoints, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelectoractiveItemStack, 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, upwardSpeedage, 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, yawDUMMY| Constructor and Description |
|---|
PiglinEntity(EntityType<? extends HostileEntity> type,
World world) |
| Modifier and Type | Method and Description |
|---|---|
protected ItemStack |
addItem(ItemStack stack) |
void |
attack(LivingEntity target,
float pullProgress) |
boolean |
canConvert() |
boolean |
canGather(ItemStack stack) |
boolean |
canImmediatelyDespawn(double distanceSquared) |
static boolean |
canSpawn(EntityType<PiglinEntity> type,
IWorld world,
SpawnType spawnType,
BlockPos pos,
Random random) |
static DefaultAttributeContainer.Builder |
createPiglinAttributes() |
boolean |
damage(DamageSource source,
float amount) |
protected Brain<?> |
deserializeBrain(com.mojang.datafixers.Dynamic<?> data) |
protected void |
dropEquipment(DamageSource source,
int lootingMultiplier,
boolean allowDrops) |
private void |
equipAtChance(EquipmentSlot slot,
ItemStack stack) |
protected void |
equipToMainHand(ItemStack stack) |
protected void |
equipToOffHand(ItemStack stack) |
protected float |
getActiveEyeHeight(EntityPose pose,
EntityDimensions dimensions) |
PiglinEntity.Activity |
getActivity() |
protected SoundEvent |
getAmbientSound() |
Brain<PiglinEntity> |
getBrain() |
protected int |
getCurrentExperience(PlayerEntity player) |
protected SoundEvent |
getDeathSound() |
protected SoundEvent |
getHurtSound(DamageSource source) |
LivingEntity |
getTarget() |
protected void |
initDataTracker() |
protected void |
initEquipment(LocalDifficulty difficulty) |
EntityData |
initialize(IWorld world,
LocalDifficulty difficulty,
SpawnType spawnType,
EntityData entityData,
CompoundTag entityTag) |
boolean |
interactMob(PlayerEntity player,
Hand hand) |
boolean |
isAdult() |
boolean |
isBaby() |
protected boolean |
isBetterItemFor(ItemStack itemStack,
ItemStack itemStack2) |
private boolean |
isCharging() |
protected boolean |
isDisallowedInPeaceful() |
private boolean |
isImmuneToZombification() |
protected void |
loot(ItemEntity item) |
private ItemStack |
makeInitialWeapon() |
protected boolean |
method_24846(ItemStack stack) |
boolean |
method_25938(RangedWeaponItem rangedWeaponItem) |
private Entity |
method_26089(Entity entity,
int int2) |
protected boolean |
method_26952() |
protected boolean |
method_27085(ItemStack itemStack) |
protected void |
mobTick() |
void |
onTrackedDataSet(TrackedData<?> data) |
protected void |
playAdmireItemSound() |
void |
playAmbientSound() |
protected void |
playAngrySound() |
protected void |
playCelebrateSound() |
protected void |
playJealousSound() |
protected void |
playRetreatSound() |
protected void |
playStepSound(BlockPos pos,
BlockState state) |
private void |
playZombifySound() |
void |
postShoot() |
void |
readCustomDataFromTag(CompoundTag tag) |
protected void |
sendAiDebugData() |
void |
setBaby(boolean baby) |
private void |
setCannotHunt(boolean bool) |
void |
setCharging(boolean charging) |
private void |
setImmuneToZombification(boolean immuneToZombification) |
void |
shoot(LivingEntity target,
ItemStack crossbow,
ProjectileEntity projectile,
float multiShotSpray) |
boolean |
startRiding(Entity entity,
boolean force) |
void |
writeCustomDataToTag(CompoundTag tag) |
private void |
zombify(ServerWorld world) |
canDropLootAndXp, canSpawnIgnoreLightLevel, canSpawnInDark, createHostileAttributes, getArrowType, getFallSound, getPathfindingFavor, getSoundCategory, getSplashSound, getSwimSound, isAngryAt, isSpawnDark, method_27071, tickMovement, updateDespawnCountercanSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeashattachLeash, 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_20417, method_25939, movesIndependently, onEatingGrass, onPlayerSpawnedChild, playHurtSound, playSpawnEffects, setAiDisabled, setAttacking, setCanPickUpLoot, setEquipmentDropChance, setForwardSpeed, setHoldingEntityId, setLeftHanded, setMovementSpeed, setPathfindingPenalty, setPersistent, setPositionTarget, setSidewaysSpeed, setTarget, setUpwardSpeed, spawnsTooManyForEachTry, swimUpward, tick, tickNewAi, tryAttack, tryEquip, turnHead, updateEnchantmentsaddStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyFrostWalker, attackLivingEntity, attemptSprintingParticles, canBeRiddenInWater, canBreatheInWater, canHaveStatusEffect, canSee, canWalkOnLava, clearActiveItem, clearPotionSwirls, clearSleepingPosition, clearStatusEffects, collides, computeFallDamage, consumeItem, containsOnlyAmbientEffects, createLivingAttributes, createSpawnPacket, damageArmor, damageShield, destroy, drop, dropInventory, dropXp, eatFood, endCombat, enterCombat, fall, getAbsorptionAmount, getActiveHand, getActiveItem, getActiveStatusEffects, getArmor, getArmorVisibility, getAttackDistanceScalingFactor, getAttacker, getAttacking, getAttribute, getAttributeInstance, getAttributes, getBaseMovementSpeedMultiplier, getBlockState, getDamageTracker, getDespawnCounter, getDimensions, getDrinkSound, getEatSound, getEyeHeight, getGroup, getHandSwingProgress, getHeadYaw, getHealth, 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, 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, onAttacking, onDeath, onEquipStack, onKilledBy, onStatusEffectApplied, onStatusEffectRemoved, onStatusEffectUpgraded, 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, wakeUpaddPassenger, 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, getStandingEyeHeight, 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, 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, wouldPoseNotCollideclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetProjectileLaunchVelocity, shoot, shootprivate static final TrackedData<Boolean> BABY
private static final TrackedData<Boolean> IMMUNE_TO_ZOMBIFICATION
private static final TrackedData<Boolean> CHARGING
private static final UUID BABY_SPEED_BOOST_MODIFIER_ID
private static final EntityAttributeModifier BABY_SPEED_BOOST_MODIFIER
protected static final ImmutableList<SensorType<? extends Sensor<? super PiglinEntity>>> SENSOR_TYPES
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_MODULE_TYPES
private int conversionTicks
private final BasicInventory inventory
private boolean field_23738
public PiglinEntity(EntityType<? extends HostileEntity> type, World world)
public void writeCustomDataToTag(CompoundTag tag)
writeCustomDataToTag in class MobEntitypublic void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag in class MobEntityprotected void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)
dropEquipment in class MobEntityprotected boolean method_27085(ItemStack itemStack)
protected void initDataTracker()
initDataTracker in class MobEntitypublic void onTrackedDataSet(TrackedData<?> data)
onTrackedDataSet in class LivingEntitypublic static DefaultAttributeContainer.Builder createPiglinAttributes()
public static boolean canSpawn(EntityType<PiglinEntity> type, IWorld world, SpawnType spawnType, BlockPos pos, Random random)
@Nullable public EntityData initialize(IWorld world, LocalDifficulty difficulty, SpawnType spawnType, @Nullable EntityData entityData, @Nullable CompoundTag entityTag)
initialize in class MobEntityprotected boolean isDisallowedInPeaceful()
isDisallowedInPeaceful in class HostileEntitypublic boolean canImmediatelyDespawn(double distanceSquared)
canImmediatelyDespawn in class MobEntityprotected void initEquipment(LocalDifficulty difficulty)
initEquipment in class MobEntityprivate void equipAtChance(EquipmentSlot slot, ItemStack stack)
protected Brain<?> deserializeBrain(com.mojang.datafixers.Dynamic<?> data)
deserializeBrain in class LivingEntitypublic Brain<PiglinEntity> getBrain()
getBrain in class LivingEntitypublic boolean interactMob(PlayerEntity player, Hand hand)
interactMob in class MobEntityprotected float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
getActiveEyeHeight in class LivingEntitypublic boolean isBaby()
isBaby in class LivingEntitypublic boolean isAdult()
private void setImmuneToZombification(boolean immuneToZombification)
private boolean isImmuneToZombification()
private void setCannotHunt(boolean bool)
protected boolean method_26952()
public boolean canConvert()
protected int getCurrentExperience(PlayerEntity player)
getCurrentExperience in class MobEntityprivate void zombify(ServerWorld world)
@Nullable public LivingEntity getTarget()
getTarget in interface CrossbowUsergetTarget in class MobEntityprivate ItemStack makeInitialWeapon()
private boolean isCharging()
public void setCharging(boolean charging)
setCharging in interface CrossbowUserpublic void postShoot()
postShoot in interface CrossbowUserpublic PiglinEntity.Activity getActivity()
public boolean damage(DamageSource source, float amount)
damage in class HostileEntitypublic void attack(LivingEntity target, float pullProgress)
attack in interface RangedAttackMobpublic void shoot(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray)
shoot in interface CrossbowUserpublic boolean method_25938(RangedWeaponItem rangedWeaponItem)
method_25938 in class MobEntityprotected void equipToMainHand(ItemStack stack)
protected void equipToOffHand(ItemStack stack)
protected boolean method_24846(ItemStack stack)
protected boolean isBetterItemFor(ItemStack itemStack, ItemStack itemStack2)
isBetterItemFor in class MobEntityprotected void loot(ItemEntity item)
public boolean startRiding(Entity entity, boolean force)
startRiding in class MobEntityprotected SoundEvent getAmbientSound()
getAmbientSound in class MobEntityprotected SoundEvent getHurtSound(DamageSource source)
getHurtSound in class HostileEntityprotected SoundEvent getDeathSound()
getDeathSound in class HostileEntityprotected void playStepSound(BlockPos pos, BlockState state)
playStepSound in class Entityprotected void playAdmireItemSound()
public void playAmbientSound()
playAmbientSound in class MobEntityprotected void playAngrySound()
protected void playCelebrateSound()
protected void playRetreatSound()
protected void playJealousSound()
private void playZombifySound()
protected void sendAiDebugData()
sendAiDebugData in class MobEntity