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, targetSelector
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
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, updateDespawnCounter
canSpawn, getPathfindingFavor, getRunFromLeashSpeed, isNavigating, updateForLeashLength, updateLeash
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_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, updateEnchantments
addStatusEffect, 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, 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, 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, wouldPoseNotCollide
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getProjectileLaunchVelocity, shoot, shoot
private 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 MobEntity
public void readCustomDataFromTag(CompoundTag tag)
readCustomDataFromTag
in class MobEntity
protected void dropEquipment(DamageSource source, int lootingMultiplier, boolean allowDrops)
dropEquipment
in class MobEntity
protected boolean method_27085(ItemStack itemStack)
protected void initDataTracker()
initDataTracker
in class MobEntity
public void onTrackedDataSet(TrackedData<?> data)
onTrackedDataSet
in class LivingEntity
public 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 MobEntity
protected boolean isDisallowedInPeaceful()
isDisallowedInPeaceful
in class HostileEntity
public boolean canImmediatelyDespawn(double distanceSquared)
canImmediatelyDespawn
in class MobEntity
protected void initEquipment(LocalDifficulty difficulty)
initEquipment
in class MobEntity
private void equipAtChance(EquipmentSlot slot, ItemStack stack)
protected Brain<?> deserializeBrain(com.mojang.datafixers.Dynamic<?> data)
deserializeBrain
in class LivingEntity
public Brain<PiglinEntity> getBrain()
getBrain
in class LivingEntity
public boolean interactMob(PlayerEntity player, Hand hand)
interactMob
in class MobEntity
protected float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions)
getActiveEyeHeight
in class LivingEntity
public boolean isBaby()
isBaby
in class LivingEntity
public 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 MobEntity
private void zombify(ServerWorld world)
@Nullable public LivingEntity getTarget()
getTarget
in interface CrossbowUser
getTarget
in class MobEntity
private ItemStack makeInitialWeapon()
private boolean isCharging()
public void setCharging(boolean charging)
setCharging
in interface CrossbowUser
public void postShoot()
postShoot
in interface CrossbowUser
public PiglinEntity.Activity getActivity()
public boolean damage(DamageSource source, float amount)
damage
in class HostileEntity
public void attack(LivingEntity target, float pullProgress)
attack
in interface RangedAttackMob
public void shoot(LivingEntity target, ItemStack crossbow, ProjectileEntity projectile, float multiShotSpray)
shoot
in interface CrossbowUser
public boolean method_25938(RangedWeaponItem rangedWeaponItem)
method_25938
in class MobEntity
protected 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 MobEntity
protected void loot(ItemEntity item)
public boolean startRiding(Entity entity, boolean force)
startRiding
in class MobEntity
protected SoundEvent getAmbientSound()
getAmbientSound
in class MobEntity
protected SoundEvent getHurtSound(DamageSource source)
getHurtSound
in class HostileEntity
protected SoundEvent getDeathSound()
getDeathSound
in class HostileEntity
protected void playStepSound(BlockPos pos, BlockState state)
playStepSound
in class Entity
protected void playAdmireItemSound()
public void playAmbientSound()
playAmbientSound
in class MobEntity
protected void playAngrySound()
protected void playCelebrateSound()
protected void playRetreatSound()
protected void playJealousSound()
private void playZombifySound()
protected void sendAiDebugData()
sendAiDebugData
in class MobEntity