Class AbstractEntityCitizen

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.Mob
net.minecraft.world.entity.PathfinderMob
All Implemented Interfaces:
IStuckHandlerEntity, IItemHandlerCapProvider, net.minecraft.commands.CommandSource, net.minecraft.network.syncher.SyncedDataHolder, net.minecraft.world.entity.Attackable, net.minecraft.world.entity.EquipmentUser, net.minecraft.world.entity.Leashable, net.minecraft.world.entity.npc.Npc, net.minecraft.world.entity.Targeting, net.minecraft.world.inventory.MenuConstructor, net.minecraft.world.level.entity.EntityAccess, net.minecraft.world.MenuProvider, net.minecraft.world.Nameable, net.minecraft.world.scores.ScoreHolder, net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.client.extensions.IMenuProviderExtension, net.neoforged.neoforge.common.extensions.IEntityExtension, net.neoforged.neoforge.common.extensions.ILivingEntityExtension, net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Direct Known Subclasses:
EntityCitizen, VisitorCitizen

public abstract class AbstractEntityCitizen extends AbstractCivilianEntity implements net.minecraft.world.MenuProvider, IItemHandlerCapProvider
The abstract citizen entity.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.world.entity.LivingEntity

    net.minecraft.world.entity.LivingEntity.Fallsounds

    Nested classes/interfaces inherited from class net.minecraft.world.entity.Entity

    net.minecraft.world.entity.Entity.MoveFunction, net.minecraft.world.entity.Entity.MovementEmission, net.minecraft.world.entity.Entity.RemovalReason

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField

    Nested classes/interfaces inherited from interface net.minecraft.world.entity.Leashable

    net.minecraft.world.entity.Leashable.LeashData
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.network.syncher.EntityDataAccessor<net.minecraft.core.BlockPos>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Integer>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Integer>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Boolean>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Boolean>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Integer>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<String>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Integer>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<String>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<String>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<String>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<Integer>
     
    static final net.minecraft.network.syncher.EntityDataAccessor<String>
     
    static final int
     
    The AI for citizens, controlling different global states

    Fields inherited from class com.minecolonies.api.entity.citizen.AbstractCivilianEntity

    nextPlayerCollisionTime

    Fields inherited from class com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity

    lastKnockBack, randomVariance

    Fields inherited from class net.minecraft.world.entity.PathfinderMob

    DEFAULT_WALK_TARGET_VALUE

    Fields inherited from class net.minecraft.world.entity.Mob

    ambientSoundTime, armorDropChances, bodyArmorDropChance, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, lookControl, MAX_ENCHANTED_ARMOR_CHANCE, MAX_ENCHANTED_WEAPON_CHANCE, MAX_PICKUP_LOOT_CHANCE, MAX_WEARING_ARMOR_CHANCE, moveControl, navigation, PICKUP_REACH, PRESERVE_ITEM_DROP_CHANCE, PRESERVE_ITEM_DROP_CHANCE_THRESHOLD, RANDOM_SPAWN_BONUS_ID, targetSelector, UPDATE_GOAL_SELECTOR_EVERY_N_TICKS, xpReward

    Fields inherited from class net.minecraft.world.entity.LivingEntity

    animStep, animStepO, appliedScale, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, ATTRIBUTES_FIELD, autoSpinAttackDmg, autoSpinAttackItemStack, autoSpinAttackTicks, BASE_JUMP_POWER, BODY_ARMOR_OFFSET, brain, damageContainers, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BABY_SCALE, DEFAULT_BASE_GRAVITY, EQUIPMENT_SLOT_OFFSET, EXTRA_RENDER_CULLING_SIZE_WITH_BIG_HAT, fallFlyTicks, HAND_SLOTS, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYHeadRot, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, MIN_MOVEMENT_DISTANCE, noActionTime, oAttackAnim, oRun, PLAYER_HURT_EXPERIENCE_TIME, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, SWING_DURATION, swinging, swingingArm, swingTime, timeOffs, USE_ITEM_INTERVAL, useItem, useItemRemaining, walkAnimation, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza

    Fields inherited from class net.minecraft.world.entity.Entity

    BASE_SAFE_FALL_DISTANCE, BASE_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, CONTENTS_SLOT_INDEX, DATA_POSE, DATA_SHARED_FLAGS_ID, DEFAULT_BB_HEIGHT, DEFAULT_BB_WIDTH, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_2, DELTA_AFFECTED_BY_BLOCKS_BELOW_0_5, DELTA_AFFECTED_BY_BLOCKS_BELOW_1_0, dimensions, ENTITY_COUNTER, entityData, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOld

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY

    Fields inherited from interface net.minecraft.commands.CommandSource

    NULL

    Fields inherited from interface net.minecraft.world.entity.Leashable

    LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DIST

    Fields inherited from interface net.minecraft.world.scores.ScoreHolder

    WILDCARD, WILDCARD_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractEntityCitizen(net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.PathfinderMob> type, net.minecraft.world.level.Level world)
    Constructor for a new citizen typed entity.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    float
    calculateDamageAfterAbsorbs(net.minecraft.world.damagesource.DamageSource source, float damage)
    Calculate adjusted damage.
    abstract void
    callForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange)
    Calls a guard for help against an attacker.
    boolean
    Disable vanilla's item picking stuff as we're doing it ourselves
    boolean
    Check if can drop loot.
    abstract void
    Decrease the saturation of the citizen for 1 action.
    abstract void
    Decrease the saturation of the citizen for 1 action.
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
    void
     
    The Handler for all colony related methods.
    abstract ICitizenData
    Getter for the citizendata.
    Get the citizen data view.
    The Handler for all experience related methods.
    The Handler for all inventory related methods.
    The Handler for all job related methods.
    The Handler for all job related methods.
    static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder
    Get the default attributes with their values.
    @NotNull net.minecraft.network.chat.Component
     
    Get the entities state controller
    abstract @NotNull InventoryCitizen
    Return this citizens inventory.
    @Nullable net.neoforged.neoforge.items.IItemHandler
    getItemHandlerCap(net.minecraft.core.Direction facing)
     
    abstract @NotNull net.neoforged.neoforge.items.IItemHandler
     
    abstract ILocation
    Get the ILocation of the citizen.
    net.minecraft.resources.ResourceLocation
    Get the model assigned to the citizen.
     
    int
     
    net.minecraft.util.RandomSource
    Getter of the citizens random object.
    int
    Check if recently hit.
    Getter for the render metadata.
    abstract float
     
    abstract float
     
    net.minecraft.world.entity.ai.goal.GoalSelector
     
    int
     
    @NotNull net.minecraft.resources.ResourceLocation
    Getter of the resource location of the texture.
    int
    Getter for the texture id.
    int
     
    @NotNull net.minecraft.world.InteractionResult
    interactAt(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.Vec3 vec, net.minecraft.world.InteractionHand hand)
     
    boolean
     
    boolean
    Disable vanilla steering logic for villagers
    abstract boolean
     
    boolean
    Getter which checks if the citizen is female.
    boolean
    Returns false if the newer Entity AI code should be run.
    boolean
     
    boolean
    Disallow pushing from fluids to prevent stuck
    boolean
     
    void
    Mark the equipment as dirty.
    void
    onArmorAdd(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot)
    On armor equip.
    void
    onArmorRemove(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot)
    On armor removal.
    void
    onPlayerCollide(net.minecraft.world.entity.player.Player player)
    On player collision action
    abstract void
    Play move away sound when running from an entity.
    void
    push(@NotNull net.minecraft.world.entity.Entity entityIn)
    Ignores entity collisions are colliding for a while, solves stuck e.g.
    abstract void
     
    abstract void
     
    abstract void
     
    abstract void
     
    abstract void
     
    void
    setFemale(boolean female)
    Set the gender.
    abstract void
    setIsChild(boolean isChild)
    Sets whether this entity is a child
    void
    setItemSlot(net.minecraft.world.entity.EquipmentSlot slot, @NotNull net.minecraft.world.item.ItemStack newItem)
     
    void
    setModelId(net.minecraft.resources.ResourceLocation model)
    Set the model id.
    void
    setOwnRotation(float yaw, float pitch)
    Set the rotation of the citizen.
    void
    setRenderMetadata(String renderMetadata)
    Set the render meta data.
    void
    Sets the textures of all citizens and distinguishes between male and female.
    void
    Set the texture dirty.
    void
    setTextureId(int textureId)
    Set the texture id.

    Methods inherited from class net.minecraft.world.entity.PathfinderMob

    checkSpawnRules, closeRangeLeashBehaviour, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, handleLeashAtDistance, isPanicking, isPathFinding, shouldStayCloseToLeashHolder

    Methods inherited from class net.minecraft.world.entity.Mob

    addAdditionalSaveData, ate, baseTick, canAttackType, canFireProjectileWeapon, canHoldItem, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, canUseSlot, checkAndHandleImportantInteractions, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clampHeadRotationToBody, clearRestriction, convertTo, createBodyControl, createMobAttributes, createNavigation, customServerAiStep, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, dropPreservedEquipment, dropPreservedEquipment, enchantSpawnedArmor, enchantSpawnedWeapon, equip, equip, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorAndBodyArmorSlots, getArmorSlots, getAttackBoundingBox, getBaseExperienceReward, getBodyArmorItem, getControllingPassenger, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashData, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getPathfindingMalus, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, getTargetFromBrain, handleEntityEvent, hasRestriction, interact, isAggressive, isBodyArmorItem, isEffectiveAi, isLeftHanded, isMaxGroupSizeReached, isPersistenceRequired, isSpawnCancelled, isSunBurnTick, isWearingBodyArmor, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, leashTooFarBehaviour, lookAt, mobInteract, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playAttackSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, readAdditionalSaveData, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, removeWhenFarAway, requiresCustomPersistence, restrictTo, serverAiStep, setAggressive, setBaby, setBodyArmorItem, setCanPickUpLoot, setDropChance, setGuaranteedDrop, setItemSlotAndDropWhenKilled, setLeashData, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, stopInPlace, tick, tickHeadTurn, updateControlFlags, wantsToPickUp

    Methods inherited from class net.minecraft.world.entity.LivingEntity

    activeLocationDependentEnchantments, actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, canUsePortal, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, die, doAutoAttackOnTouch, doesEmitEquipEvent, doHurtEquipment, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDeathSound, getDefaultDimensions, getDefaultGravity, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getExperienceReward, getFallFlyingTicks, getFallSounds, getFluidFallingAdjustedMovement, getFlyingSpeed, getHealth, getHitbox, getHurtDir, getHurtSound, getItemInHand, getJumpBoostPower, getJumpPower, getJumpPower, getKillCredit, getKnockback, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxAbsorption, getMaxHeadRotationRelativeToBody, getMaxHealth, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getPreciseBodyRotation, getProjectile, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSlotForHand, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getWeaponItem, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasInfiniteMaterials, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, heal, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, igniteForTicks, indicateDamage, internalSetAbsorptionAmount, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBaby, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInvulnerableTo, isPickable, isSensitiveToWater, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeBrain, makeSound, maxUpStep, onBelowWorld, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, onSyncedDataUpdated, playBlockFallSound, randomTeleport, recreateFromPacket, releaseUsingItem, remove, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeEffectsCuredBy, resetForwardDirectionOfRelativePortalPosition, rideTick, sanitizeScale, sendEffectToPassengers, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRiderFaceForward, shouldShowName, skipDropExperience, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, tickRidden, travel, triggerItemUseEffects, triggerOnDeathMobEffects, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed, wouldNotSuffocateAtTargetPose

    Methods inherited from class net.minecraft.world.entity.Entity

    absMoveTo, absMoveTo, absRotateTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, adjustSpawnLocation, applyGravity, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canChangeDimensions, canCollideWith, canControlVehicle, canRide, canSprint, canTrample, captureDrops, captureDrops, checkBelowWorld, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collideBoundingBox, copyPosition, couldAcceptPassenger, countPlayerPassengers, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, deflection, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, fireImmune, fixupDimensions, fudgePositionAfterSizeChange, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAttachments, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getCapability, getCapability, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDefaultPassengerAttachmentPoint, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getEncodeId, getEntityData, getEyeHeight, getEyeHeight, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getGravity, getHandHoldingItemAngle, getId, getInBlockState, getIndirectPassengers, getKnownMovement, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, is, isAddedToLevel, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInvulnerable, isInWater, isInWaterOrBubble, isInWaterOrRain, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromLevel, onSyncedDataUpdated, pick, placePortalTicket, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, push, reapplyPosition, refreshDimensions, registryAccess, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setAsInsidePortal, setBoundingBox, setCustomName, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSilent, setSwimming, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, waterSwimSound

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingData, hasAttachments, hasData, removeData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minecraft.commands.CommandSource

    alwaysAccepts

    Methods inherited from interface net.minecraft.world.entity.EquipmentUser

    equip, equip, equip, resolveSlot

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, hasData, removeData, setData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IEntityExtension

    canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, captureDrops, captureDrops, copyAttachmentsFrom, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, hasCustomOutlineRendering, isAddedToLevel, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToLevel, onRemovedFromLevel, revive, sendPairingData, serializeNBT, shouldRiderSit

    Methods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider

    getItemHandlerCap, getItemHandlerCap

    Methods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension

    canDrownInFluidType, canSwimInFluidType, moveInFluid, onDamageTaken, self, sinkInFluid

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension

    shouldTriggerClientSideContainerClosingOnOpen

    Methods inherited from interface net.minecraft.world.entity.Leashable

    canHaveALeashAttachedToIt, elasticRangeLeashBehaviour, getLeashHolder, isLeashed, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashData

    Methods inherited from interface net.minecraft.world.inventory.MenuConstructor

    createMenu

    Methods inherited from interface net.minecraft.world.scores.ScoreHolder

    getFeedbackDisplayName
  • Field Details

    • ENTITY_AI_TICKRATE

      public static final int ENTITY_AI_TICKRATE
      See Also:
    • DATA_LEVEL

      public static final net.minecraft.network.syncher.EntityDataAccessor<Integer> DATA_LEVEL
    • DATA_TEXTURE

      public static final net.minecraft.network.syncher.EntityDataAccessor<Integer> DATA_TEXTURE
    • DATA_IS_FEMALE

      public static final net.minecraft.network.syncher.EntityDataAccessor<Integer> DATA_IS_FEMALE
    • DATA_COLONY_ID

      public static final net.minecraft.network.syncher.EntityDataAccessor<Integer> DATA_COLONY_ID
    • DATA_CITIZEN_ID

      public static final net.minecraft.network.syncher.EntityDataAccessor<Integer> DATA_CITIZEN_ID
    • DATA_MODEL

      public static final net.minecraft.network.syncher.EntityDataAccessor<String> DATA_MODEL
    • DATA_RENDER_METADATA

      public static final net.minecraft.network.syncher.EntityDataAccessor<String> DATA_RENDER_METADATA
    • DATA_IS_ASLEEP

      public static final net.minecraft.network.syncher.EntityDataAccessor<Boolean> DATA_IS_ASLEEP
    • DATA_IS_CHILD

      public static final net.minecraft.network.syncher.EntityDataAccessor<Boolean> DATA_IS_CHILD
    • DATA_BED_POS

      public static final net.minecraft.network.syncher.EntityDataAccessor<net.minecraft.core.BlockPos> DATA_BED_POS
    • DATA_STYLE

      public static final net.minecraft.network.syncher.EntityDataAccessor<String> DATA_STYLE
    • DATA_TEXTURE_SUFFIX

      public static final net.minecraft.network.syncher.EntityDataAccessor<String> DATA_TEXTURE_SUFFIX
    • DATA_JOB

      public static final net.minecraft.network.syncher.EntityDataAccessor<String> DATA_JOB
    • entityStateController

      protected ITickRateStateMachine<IState> entityStateController
      The AI for citizens, controlling different global states
  • Constructor Details

    • AbstractEntityCitizen

      public AbstractEntityCitizen(net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.PathfinderMob> type, net.minecraft.world.level.Level world)
      Constructor for a new citizen typed entity.
      Parameters:
      type - the Entity type.
      world - the world.
  • Method Details

    • getDefaultAttributes

      public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder getDefaultAttributes()
      Get the default attributes with their values.
      Returns:
      the attribute modifier map.
    • getTasks

      public net.minecraft.world.entity.ai.goal.GoalSelector getTasks()
    • getTicksExisted

      public int getTicksExisted()
    • canPickUpLoot

      public boolean canPickUpLoot()
      Disable vanilla's item picking stuff as we're doing it ourselves
      Overrides:
      canPickUpLoot in class net.minecraft.world.entity.Mob
    • isControlledByLocalInstance

      public boolean isControlledByLocalInstance()
      Disable vanilla steering logic for villagers
      Overrides:
      isControlledByLocalInstance in class net.minecraft.world.entity.Entity
    • calculateDamageAfterAbsorbs

      public float calculateDamageAfterAbsorbs(net.minecraft.world.damagesource.DamageSource source, float damage)
      Calculate adjusted damage. This doesn't actually damage armor, for non-player entities.
      Parameters:
      source -
      damage -
      Returns:
    • interactAt

      @NotNull public @NotNull net.minecraft.world.InteractionResult interactAt(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.Vec3 vec, net.minecraft.world.InteractionHand hand)
      Overrides:
      interactAt in class net.minecraft.world.entity.Entity
    • isNoAi

      public boolean isNoAi()
      Returns false if the newer Entity AI code should be run.
      Overrides:
      isNoAi in class net.minecraft.world.entity.Mob
    • setTexture

      public void setTexture()
      Sets the textures of all citizens and distinguishes between male and female.
    • getCitizenDataView

      public abstract ICitizenDataView getCitizenDataView()
      Get the citizen data view.
      Returns:
      the view.
    • getTexture

      @NotNull public @NotNull net.minecraft.resources.ResourceLocation getTexture()
      Getter of the resource location of the texture.
      Returns:
      location of the texture.
    • setTextureDirty

      public void setTextureDirty()
      Set the texture dirty.
    • getModelType

      public net.minecraft.resources.ResourceLocation getModelType()
      Get the model assigned to the citizen.
      Returns:
      the model.
    • defineSynchedData

      protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
      Overrides:
      defineSynchedData in class net.minecraft.world.entity.Mob
    • isFemale

      public boolean isFemale()
      Getter which checks if the citizen is female.
      Returns:
      true if female.
    • setFemale

      public void setFemale(boolean female)
      Set the gender.
      Parameters:
      female - true if female, false if male.
    • getNavigation

      @NotNull public @NotNull AbstractAdvancedPathNavigate getNavigation()
      Overrides:
      getNavigation in class net.minecraft.world.entity.Mob
    • push

      public void push(@NotNull @NotNull net.minecraft.world.entity.Entity entityIn)
      Ignores entity collisions are colliding for a while, solves stuck e.g. for many trying to take the same door
      Overrides:
      push in class AbstractCivilianEntity
      Parameters:
      entityIn - entity to collide with
    • onPlayerCollide

      public void onPlayerCollide(net.minecraft.world.entity.player.Player player)
      Description copied from class: AbstractCivilianEntity
      On player collision action
      Overrides:
      onPlayerCollide in class AbstractCivilianEntity
      Parameters:
      player -
    • isPushable

      public boolean isPushable()
      Overrides:
      isPushable in class net.minecraft.world.entity.LivingEntity
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class net.minecraft.world.entity.Mob
    • setOwnRotation

      public void setOwnRotation(float yaw, float pitch)
      Set the rotation of the citizen.
      Parameters:
      yaw - the rotation yaw.
      pitch - the rotation pitch.
    • setModelId

      public void setModelId(net.minecraft.resources.ResourceLocation model)
      Set the model id.
      Parameters:
      model - the model.
    • setRenderMetadata

      public void setRenderMetadata(String renderMetadata)
      Set the render meta data.
      Parameters:
      renderMetadata - the metadata to set.
    • getTextureId

      public int getTextureId()
      Getter for the texture id.
      Returns:
      the texture id.
    • setTextureId

      public void setTextureId(int textureId)
      Set the texture id.
      Parameters:
      textureId - the id of the texture.
    • getRenderMetadata

      public String getRenderMetadata()
      Getter for the render metadata.
      Returns:
      the meta data.
    • getRandom

      public net.minecraft.util.RandomSource getRandom()
      Getter of the citizens random object.
      Overrides:
      getRandom in class net.minecraft.world.entity.Entity
      Returns:
      random object.
    • getOffsetTicks

      public int getOffsetTicks()
    • isBlocking

      public boolean isBlocking()
      Overrides:
      isBlocking in class net.minecraft.world.entity.LivingEntity
    • getRecentlyHit

      public int getRecentlyHit()
      Check if recently hit.
      Returns:
      the count of how often.
    • checkCanDropLoot

      public boolean checkCanDropLoot()
      Check if can drop loot.
      Returns:
      true if so.
    • getLocation

      public abstract ILocation getLocation()
      Get the ILocation of the citizen.
      Returns:
      an ILocation object which contains the dimension and is unique.
    • getCitizenData

      public abstract ICitizenData getCitizenData()
      Getter for the citizendata. Tries to get it from the colony is the data is null.
      Returns:
      the data.
    • getInventoryCitizen

      @NotNull public abstract @NotNull InventoryCitizen getInventoryCitizen()
      Return this citizens inventory.
      Returns:
      the inventory this citizen has.
    • getItemHandlerCitizen

      @NotNull public abstract @NotNull net.neoforged.neoforge.items.IItemHandler getItemHandlerCitizen()
    • setIsChild

      public abstract void setIsChild(boolean isChild)
      Sets whether this entity is a child
      Parameters:
      isChild - boolean
    • playMoveAwaySound

      public abstract void playMoveAwaySound()
      Play move away sound when running from an entity.
    • decreaseSaturationForAction

      public abstract void decreaseSaturationForAction()
      Decrease the saturation of the citizen for 1 action.
    • decreaseSaturationForContinuousAction

      public abstract void decreaseSaturationForContinuousAction()
      Decrease the saturation of the citizen for 1 action.
    • getCitizenExperienceHandler

      public abstract ICitizenExperienceHandler getCitizenExperienceHandler()
      The Handler for all experience related methods.
      Returns:
      the instance of the handler.
    • getCitizenInventoryHandler

      public abstract ICitizenInventoryHandler getCitizenInventoryHandler()
      The Handler for all inventory related methods.
      Returns:
      the instance of the handler.
    • setCitizenInventoryHandler

      public abstract void setCitizenInventoryHandler(ICitizenInventoryHandler citizenInventoryHandler)
    • getCitizenColonyHandler

      public abstract ICitizenColonyHandler getCitizenColonyHandler()
      The Handler for all colony related methods.
      Returns:
      the instance of the handler.
    • setCitizenColonyHandler

      public abstract void setCitizenColonyHandler(ICitizenColonyHandler citizenColonyHandler)
    • getCitizenJobHandler

      public abstract ICitizenJobHandler getCitizenJobHandler()
      The Handler for all job related methods.
      Returns:
      the instance of the handler.
    • getCitizenSleepHandler

      public abstract ICitizenSleepHandler getCitizenSleepHandler()
      The Handler for all job related methods.
      Returns:
      the instance of the handler.
    • getRotationYaw

      public abstract float getRotationYaw()
    • getRotationPitch

      public abstract float getRotationPitch()
    • isDead

      public abstract boolean isDead()
    • setCitizenSleepHandler

      public abstract void setCitizenSleepHandler(ICitizenSleepHandler citizenSleepHandler)
    • setCitizenJobHandler

      public abstract void setCitizenJobHandler(ICitizenJobHandler citizenJobHandler)
    • setCitizenExperienceHandler

      public abstract void setCitizenExperienceHandler(ICitizenExperienceHandler citizenExperienceHandler)
    • callForHelp

      public abstract void callForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange)
      Calls a guard for help against an attacker.
      Parameters:
      attacker - the attacking entity
      guardHelpRange - the squaredistance in which we search for nearby guards
    • detectEquipmentUpdates

      public void detectEquipmentUpdates()
      Overrides:
      detectEquipmentUpdates in class net.minecraft.world.entity.LivingEntity
    • setItemSlot

      public void setItemSlot(net.minecraft.world.entity.EquipmentSlot slot, @NotNull @NotNull net.minecraft.world.item.ItemStack newItem)
      Specified by:
      setItemSlot in interface net.minecraft.world.entity.EquipmentUser
      Overrides:
      setItemSlot in class net.minecraft.world.entity.Mob
    • onArmorRemove

      public void onArmorRemove(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot)
      On armor removal.
      Parameters:
      stack - the removed armor.
    • onArmorAdd

      public void onArmorAdd(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot)
      On armor equip.
      Parameters:
      stack - the added armor.
    • markEquipmentDirty

      public void markEquipmentDirty()
      Mark the equipment as dirty.
    • isPushedByFluid

      public boolean isPushedByFluid()
      Disallow pushing from fluids to prevent stuck
      Overrides:
      isPushedByFluid in class net.minecraft.world.entity.Entity
      Returns:
    • getEntityStateController

      public ITickRateStateMachine<IState> getEntityStateController()
      Get the entities state controller
      Returns:
    • isSleeping

      public boolean isSleeping()
      Overrides:
      isSleeping in class net.minecraft.world.entity.LivingEntity
    • getItemHandlerCap

      @Nullable public @Nullable net.neoforged.neoforge.items.IItemHandler getItemHandlerCap(net.minecraft.core.Direction facing)
      Specified by:
      getItemHandlerCap in interface IItemHandlerCapProvider
      Returns:
      direction-aware itemHandler
    • getTeamColor

      public int getTeamColor()
      Overrides:
      getTeamColor in class net.minecraft.world.entity.Entity
    • getDisplayName

      @NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()
      Specified by:
      getDisplayName in interface net.minecraft.world.MenuProvider
      Specified by:
      getDisplayName in interface net.minecraft.world.Nameable
      Specified by:
      getDisplayName in interface net.minecraft.world.scores.ScoreHolder
      Overrides:
      getDisplayName in class net.minecraft.world.entity.Entity