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 |
private static UUID |
BABY_SPEED_BOOST_ID |
private boolean |
cannotHunt |
private static TrackedData<Boolean> |
CHARGING |
private int |
conversionTicks |
private static TrackedData<Boolean> |
IMMUNE_TO_ZOMBIFICATION |
private SimpleInventory |
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, distanceTraveled, fallDistance, 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, 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) |
protected boolean |
canHunt() |
boolean |
canImmediatelyDespawn(double distanceSquared) |
protected boolean |
canInsertIntoInventory(ItemStack stack) |
static boolean |
canSpawn(EntityType<PiglinEntity> type,
WorldAccess world,
SpawnReason spawnReason,
BlockPos pos,
Random random) |
boolean |
canUseRangedWeapon(RangedWeaponItem weapon) |
static DefaultAttributeContainer.Builder |
createPiglinAttributes() |
boolean |
damage(DamageSource source,
float amount) |
protected Brain<?> |
deserializeBrain(com.mojang.serialization.Dynamic<?> dynamic) |
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(WorldAccess world,
LocalDifficulty difficulty,
SpawnReason spawnReason,
EntityData entityData,
CompoundTag entityTag) |
boolean |
interactMob(PlayerEntity player,
Hand hand) |
boolean |
isAdult() |
boolean |
isBaby() |
private boolean |
isCharging() |
protected boolean |
isDisallowedInPeaceful() |
private boolean |
isImmuneToZombification() |
protected void |
loot(ItemEntity item) |
private ItemStack |
makeInitialWeapon() |
protected boolean |
method_24846(ItemStack stack) |
private Entity |
method_26089(Entity entity,
int int2) |
protected Brain.class_5303<PiglinEntity> |
method_28306() |
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() |
protected boolean |
prefersNewEquipment(ItemStack newStack,
ItemStack oldStack) |
void |
readCustomDataFromTag(CompoundTag tag) |
protected void |
sendAiDebugData() |
void |
setBaby(boolean baby) |
private void |
setCannotHunt(boolean cannotHunt) |
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, shouldDropLoot, 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_27964, movesIndependently, onEatingGrass, onPlayerSpawnedChild, 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, updateGoalControlsaddStatusEffect, animateDamage, applyArmorToDamage, applyDamage, applyEnchantmentsToDamage, applyFrostWalker, attackLivingEntity, 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, getAttributeBaseValue, getAttributeInstance, getAttributes, getAttributeValue, getBaseMovementSpeedMultiplier, getBlockState, getBoundingBox, 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_25937, method_26082, method_26317, method_26318, method_27302, method_27303, 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, getFluidHeight, getHardCollisionBox, getHeight, getHeightOffset, getHighSpeedSplashSound, getHorizontalFacing, getHoverEvent, getItemsEquipped, getJumpVelocityMultiplier, getLandingBlockState, getLandingPos, getLastNetherPortalDirection, getLastNetherPortalDirectionVector, 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, 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, isSubmergedIn, isSubmergedInWater, isSwimming, isTeammate, isTeamPlayer, isTouchingWater, isTouchingWaterOrRain, isWet, 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, 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_ID
private static final EntityAttributeModifier BABY_SPEED_BOOST
protected static final ImmutableList<SensorType<? extends Sensor<? super PiglinEntity>>> SENSOR_TYPES
protected static final ImmutableList<MemoryModuleType<?>> MEMORY_MODULE_TYPES
private int conversionTicks
private final SimpleInventory inventory
private boolean cannotHunt
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 canInsertIntoInventory(ItemStack stack)
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, WorldAccess world, SpawnReason spawnReason, BlockPos pos, Random random)
@Nullable public EntityData initialize(WorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, @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.class_5303<PiglinEntity> method_28306()
method_28306 in class LivingEntityprotected Brain<?> deserializeBrain(com.mojang.serialization.Dynamic<?> dynamic)
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 cannotHunt)
protected boolean canHunt()
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 canUseRangedWeapon(RangedWeaponItem weapon)
canUseRangedWeapon in class MobEntityprotected void equipToMainHand(ItemStack stack)
protected void equipToOffHand(ItemStack stack)
protected boolean method_24846(ItemStack stack)
protected boolean prefersNewEquipment(ItemStack newStack, ItemStack oldStack)
prefersNewEquipment 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