Class EntityCitizen

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.entity.Entity
net.minecraft.world.entity.LivingEntity
net.minecraft.world.entity.Mob
All Implemented Interfaces:
IThreatTableEntity, 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>

public class EntityCitizen extends AbstractEntityCitizen implements IThreatTableEntity
The Class used to represent the citizen entities.
  • 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 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
    EntityCitizen(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
    addAdditionalSaveData(net.minecraft.nbt.CompoundTag compound)
     
    void
    Called frequently so the entity can update its state every tick as required.
    void
    callForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange)
    Calls a guard for help against an attacker.
    boolean
    A boolean check to test if the citizen can climb vines.
    boolean
    A boolean check to test if the citizen can path on rails.
    @NotNull net.minecraft.world.InteractionResult
    checkAndHandleImportantInteractions(net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand)
    Called when a player tries to interact with a citizen.
    @Nullable net.minecraft.world.inventory.AbstractContainerMenu
    createMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull net.minecraft.world.entity.player.Player player)
     
    void
    Decrease the saturation of the citizen for 1 action.
    void
    Decrease the saturation of the citizen for 1 action.
    protected void
    defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
     
    void
    die(@NotNull net.minecraft.world.damagesource.DamageSource damageSource)
    Called when the mob's health reaches 0.
    protected void
    doPush(net.minecraft.world.entity.Entity entity)
     
    protected void
     
    boolean
     
    float
     
    @NotNull Iterable<net.minecraft.world.item.ItemStack>
     
    int
     
    Get the AI controlling the citizens behaviour
    The Handler for all colony related methods.
    Getter for the citizendata.
    Getter of the dataview, the clientside representation of the citizen.
    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.
    Getter for the civilian data
    int
    Getter for the citizen id.
    net.minecraft.world.damagesource.CombatTracker
     
    Return this citizens inventory.
    @NotNull net.minecraft.world.item.ItemStack
    getItemBySlot(net.minecraft.world.entity.EquipmentSlot slotType)
     
    @NotNull net.neoforged.neoforge.items.IItemHandler
     
    Get the ILocation of the citizen.
    int
     
    float
     
    float
     
    @NotNull String
     
    float
     
    int
    Get the team name of this entity.
    Get the entities threat table
    int
     
    boolean
    hurt(@NotNull net.minecraft.world.damagesource.DamageSource damageSource, float damage)
     
    boolean
    Whether this entity is active and loaded
    boolean
     
    boolean
     
    boolean
     
    boolean
    isInteractionItem(net.minecraft.world.item.ItemStack stack)
    Tests if the itemstack is used for citizen interactions
    boolean
     
    void
    markDirty(int time)
    Mark the citizen dirty to synch the data with the client.
    void
    onPlayerCollide(net.minecraft.world.entity.player.Player player)
    On player collision action
    void
    onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> dataAccessor)
     
    protected void
    pickUpItem(net.minecraft.world.entity.item.ItemEntity itemEntity)
     
    void
    Play move away sound when running from an entity.
    void
    queueSound(@NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions)
    Queue a sound at the citizen.
    void
    queueSound(@NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions, float volume, float pitch)
    Queue a sound at the citizen.
    void
    readAdditionalSaveData(net.minecraft.nbt.CompoundTag compound)
     
    boolean
    Refreshes the saved view data
    void
    remove(@NotNull net.minecraft.world.entity.Entity.RemovalReason reason)
     
    boolean
     
    void
     
    void
     
    void
    setCitizenId(int id)
    Setter for the citizen id.
    void
     
    void
     
    void
     
    void
    Setter for the citizen data.
    void
    setCustomName(@Nullable net.minecraft.network.chat.Component name)
     
    void
    setGlowing(boolean isGlowing)
     
    void
    setIsChild(boolean isChild)
    Sets whether this entity is a child
    void
    setMaxAir(int maxAir)
    Sets the max air
    void
    setRemoved(net.minecraft.world.entity.Entity.RemovalReason reason)
     
    void
    Set the metadata for rendering.
    void
    Sets the textures of all citizens and distinguishes between male and female.
    void
    Sets the visible status if there is none
    void
     

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

    checkBedExists, startRiding, toString

    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

    ate, baseTick, canAttackType, canFireProjectileWeapon, canHoldItem, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, canUseSlot, 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, 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, playAmbientSound, playAttackSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, removeWhenFarAway, restrictTo, serverAiStep, setAggressive, setBaby, setBodyArmorItem, setCanPickUpLoot, setDropChance, setGuaranteedDrop, setItemSlotAndDropWhenKilled, setLeashData, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, 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, doAutoAttackOnTouch, doesEmitEquipEvent, doHurtEquipment, dropAllDeathLoot, dropExperience, eat, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getArmorCoverPercentage, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, 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, 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, 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, playBlockFallSound, randomTeleport, recreateFromPacket, releaseUsingItem, 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, 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, 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, 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, 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, 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, setCustomNameVisible, setData, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, 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.scores.ScoreHolder

    getFeedbackDisplayName
  • Constructor Details

    • EntityCitizen

      public EntityCitizen(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

    • checkAndHandleImportantInteractions

      @NotNull public @NotNull net.minecraft.world.InteractionResult checkAndHandleImportantInteractions(net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand)
      Called when a player tries to interact with a citizen.
      Overrides:
      checkAndHandleImportantInteractions in class net.minecraft.world.entity.Mob
      Parameters:
      player - which interacts with the citizen.
      Returns:
      If citizen should interact or not.
    • isInteractionItem

      public boolean isInteractionItem(net.minecraft.world.item.ItemStack stack)
      Tests if the itemstack is used for citizen interactions
      Parameters:
      stack -
      Returns:
    • getScoreboardName

      @NotNull public @NotNull String getScoreboardName()
      Specified by:
      getScoreboardName in interface net.minecraft.world.scores.ScoreHolder
      Overrides:
      getScoreboardName in class net.minecraft.world.entity.Entity
    • getCitizenDataView

      public ICitizenDataView getCitizenDataView()
      Getter of the dataview, the clientside representation of the citizen.
      Specified by:
      getCitizenDataView in class AbstractEntityCitizen
      Returns:
      the view.
    • addAdditionalSaveData

      public void addAdditionalSaveData(net.minecraft.nbt.CompoundTag compound)
      Overrides:
      addAdditionalSaveData in class net.minecraft.world.entity.Mob
    • readAdditionalSaveData

      public void readAdditionalSaveData(net.minecraft.nbt.CompoundTag compound)
      Overrides:
      readAdditionalSaveData in class net.minecraft.world.entity.Mob
    • aiStep

      public void aiStep()
      Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons. use this to react to sunlight and start to burn.
      Overrides:
      aiStep in class AbstractEntityCitizen
    • refreshCitizenDataView

      public boolean refreshCitizenDataView()
      Refreshes the saved view data
      Returns:
      false
    • getMaxAirSupply

      public int getMaxAirSupply()
      Overrides:
      getMaxAirSupply in class net.minecraft.world.entity.Entity
    • canPathOnRails

      public boolean canPathOnRails()
      A boolean check to test if the citizen can path on rails.
      Returns:
      true if so.
    • canClimbVines

      public boolean canClimbVines()
      A boolean check to test if the citizen can climb vines.
      Returns:
      true if so.
    • isBaby

      public boolean isBaby()
      Overrides:
      isBaby in class net.minecraft.world.entity.LivingEntity
    • defineSynchedData

      protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder)
      Overrides:
      defineSynchedData in class AbstractEntityCitizen
    • setRenderMetadata

      public void setRenderMetadata(String metadata)
      Set the metadata for rendering.
      Overrides:
      setRenderMetadata in class AbstractEntityCitizen
      Parameters:
      metadata - the metadata required.
    • getLocation

      public ILocation getLocation()
      Get the ILocation of the citizen.
      Specified by:
      getLocation in class AbstractEntityCitizen
      Returns:
      an ILocation object which contains the dimension and is unique.
    • getCitizenData

      public ICitizenData getCitizenData()
      Getter for the citizendata. Tries to get it from the colony is the data is null.
      Specified by:
      getCitizenData in class AbstractEntityCitizen
      Returns:
      the data.
    • getCivilianData

      public ICivilianData getCivilianData()
      Getter for the civilian data
      Specified by:
      getCivilianData in class AbstractCivilianEntity
      Returns:
      the data.
    • setCivilianData

      public void setCivilianData(@Nullable @Nullable ICivilianData data)
      Setter for the citizen data.
      Specified by:
      setCivilianData in class AbstractCivilianEntity
      Parameters:
      data - the data to set.
    • getInventoryCitizen

      @NotNull public @NotNull InventoryCitizen getInventoryCitizen()
      Return this citizens inventory.
      Specified by:
      getInventoryCitizen in class AbstractEntityCitizen
      Returns:
      the inventory this citizen has.
    • getItemHandlerCitizen

      @NotNull public @NotNull net.neoforged.neoforge.items.IItemHandler getItemHandlerCitizen()
      Specified by:
      getItemHandlerCitizen in class AbstractEntityCitizen
    • markDirty

      public void markDirty(int time)
      Mark the citizen dirty to synch the data with the client.
      Specified by:
      markDirty in class AbstractCivilianEntity
    • setIsChild

      public void setIsChild(boolean isChild)
      Sets whether this entity is a child
      Specified by:
      setIsChild in class AbstractEntityCitizen
      Parameters:
      isChild - boolean
    • playMoveAwaySound

      public void playMoveAwaySound()
      Play move away sound when running from an entity.
      Specified by:
      playMoveAwaySound in class AbstractEntityCitizen
    • decreaseSaturationForAction

      public void decreaseSaturationForAction()
      Decrease the saturation of the citizen for 1 action.
      Specified by:
      decreaseSaturationForAction in class AbstractEntityCitizen
    • decreaseSaturationForContinuousAction

      public void decreaseSaturationForContinuousAction()
      Decrease the saturation of the citizen for 1 action.
      Specified by:
      decreaseSaturationForContinuousAction in class AbstractEntityCitizen
    • getCivilianID

      public int getCivilianID()
      Getter for the citizen id.
      Specified by:
      getCivilianID in class AbstractCivilianEntity
      Returns:
      the id.
    • setCitizenId

      public void setCitizenId(int id)
      Setter for the citizen id.
      Specified by:
      setCitizenId in class AbstractCivilianEntity
      Parameters:
      id - the id to set.
    • getCitizenExperienceHandler

      public ICitizenExperienceHandler getCitizenExperienceHandler()
      The Handler for all experience related methods.
      Specified by:
      getCitizenExperienceHandler in class AbstractEntityCitizen
      Returns:
      the instance of the handler.
    • getCitizenInventoryHandler

      public ICitizenInventoryHandler getCitizenInventoryHandler()
      The Handler for all inventory related methods.
      Specified by:
      getCitizenInventoryHandler in class AbstractEntityCitizen
      Returns:
      the instance of the handler.
    • setCitizenInventoryHandler

      public void setCitizenInventoryHandler(ICitizenInventoryHandler citizenInventoryHandler)
      Specified by:
      setCitizenInventoryHandler in class AbstractEntityCitizen
    • getCitizenColonyHandler

      public ICitizenColonyHandler getCitizenColonyHandler()
      The Handler for all colony related methods.
      Specified by:
      getCitizenColonyHandler in class AbstractEntityCitizen
      Returns:
      the instance of the handler.
    • setCitizenColonyHandler

      public void setCitizenColonyHandler(ICitizenColonyHandler citizenColonyHandler)
      Specified by:
      setCitizenColonyHandler in class AbstractEntityCitizen
    • getCitizenJobHandler

      public ICitizenJobHandler getCitizenJobHandler()
      The Handler for all job related methods.
      Specified by:
      getCitizenJobHandler in class AbstractEntityCitizen
      Returns:
      the instance of the handler.
    • getCitizenSleepHandler

      public ICitizenSleepHandler getCitizenSleepHandler()
      The Handler for all job related methods.
      Specified by:
      getCitizenSleepHandler in class AbstractEntityCitizen
      Returns:
      the instance of the handler.
    • setVisibleStatusIfNone

      public void setVisibleStatusIfNone(VisibleCitizenStatus status)
      Sets the visible status if there is none
      Parameters:
      status - status to set
    • getRotationYaw

      public float getRotationYaw()
      Specified by:
      getRotationYaw in class AbstractEntityCitizen
    • getRotationPitch

      public float getRotationPitch()
      Specified by:
      getRotationPitch in class AbstractEntityCitizen
    • isDead

      public boolean isDead()
      Specified by:
      isDead in class AbstractEntityCitizen
    • setCitizenSleepHandler

      public void setCitizenSleepHandler(ICitizenSleepHandler citizenSleepHandler)
      Specified by:
      setCitizenSleepHandler in class AbstractEntityCitizen
    • setCitizenJobHandler

      public void setCitizenJobHandler(ICitizenJobHandler citizenJobHandler)
      Specified by:
      setCitizenJobHandler in class AbstractEntityCitizen
    • setCitizenExperienceHandler

      public void setCitizenExperienceHandler(ICitizenExperienceHandler citizenExperienceHandler)
      Specified by:
      setCitizenExperienceHandler in class AbstractEntityCitizen
    • hurt

      public boolean hurt(@NotNull @NotNull net.minecraft.world.damagesource.DamageSource damageSource, float damage)
      Overrides:
      hurt in class AbstractFastMinecoloniesEntity
    • getSpeed

      public float getSpeed()
      Overrides:
      getSpeed in class net.minecraft.world.entity.LivingEntity
    • callForHelp

      public void callForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange)
      Description copied from class: AbstractEntityCitizen
      Calls a guard for help against an attacker.
      Specified by:
      callForHelp in class AbstractEntityCitizen
      Parameters:
      attacker - the attacking entity
      guardHelpRange - the squaredistance in which we search for nearby guards
    • doPush

      protected void doPush(net.minecraft.world.entity.Entity entity)
      Overrides:
      doPush in class net.minecraft.world.entity.LivingEntity
    • onPlayerCollide

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

      public float getAgeScale()
      Overrides:
      getAgeScale in class net.minecraft.world.entity.LivingEntity
    • die

      public void die(@NotNull @NotNull net.minecraft.world.damagesource.DamageSource damageSource)
      Called when the mob's health reaches 0.
      Overrides:
      die in class net.minecraft.world.entity.LivingEntity
      Parameters:
      damageSource - the attacking entity.
    • remove

      public void remove(@NotNull @NotNull net.minecraft.world.entity.Entity.RemovalReason reason)
      Overrides:
      remove in class net.minecraft.world.entity.LivingEntity
    • dropEquipment

      protected void dropEquipment()
      Overrides:
      dropEquipment in class net.minecraft.world.entity.LivingEntity
    • getAllSlots

      @NotNull public @NotNull Iterable<net.minecraft.world.item.ItemStack> getAllSlots()
      Overrides:
      getAllSlots in class net.minecraft.world.entity.LivingEntity
    • getItemBySlot

      @NotNull public @NotNull net.minecraft.world.item.ItemStack getItemBySlot(net.minecraft.world.entity.EquipmentSlot slotType)
      Specified by:
      getItemBySlot in interface net.minecraft.world.entity.EquipmentUser
      Overrides:
      getItemBySlot in class net.minecraft.world.entity.Mob
    • getArmorValue

      public int getArmorValue()
      Overrides:
      getArmorValue in class net.minecraft.world.entity.LivingEntity
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class net.minecraft.world.entity.Entity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class net.minecraft.world.entity.Entity
    • setRemoved

      public void setRemoved(net.minecraft.world.entity.Entity.RemovalReason reason)
      Specified by:
      setRemoved in interface net.minecraft.world.level.entity.EntityAccess
      Overrides:
      setRemoved in class net.minecraft.world.entity.Entity
    • setCustomName

      public void setCustomName(@Nullable @Nullable net.minecraft.network.chat.Component name)
      Overrides:
      setCustomName in class net.minecraft.world.entity.Entity
    • spawnAnim

      public void spawnAnim()
      Overrides:
      spawnAnim in class net.minecraft.world.entity.Mob
    • pickUpItem

      protected void pickUpItem(net.minecraft.world.entity.item.ItemEntity itemEntity)
      Overrides:
      pickUpItem in class net.minecraft.world.entity.Mob
    • requiresCustomPersistence

      public boolean requiresCustomPersistence()
      Overrides:
      requiresCustomPersistence in class net.minecraft.world.entity.Mob
    • createMenu

      @Nullable public @Nullable net.minecraft.world.inventory.AbstractContainerMenu createMenu(int id, @NotNull @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull @NotNull net.minecraft.world.entity.player.Player player)
      Specified by:
      createMenu in interface net.minecraft.world.inventory.MenuConstructor
    • setTexture

      public void setTexture()
      Description copied from class: AbstractEntityCitizen
      Sets the textures of all citizens and distinguishes between male and female.
      Overrides:
      setTexture in class AbstractEntityCitizen
    • queueSound

      public void queueSound(@NotNull @NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions)
      Description copied from class: AbstractCivilianEntity
      Queue a sound at the citizen.
      Specified by:
      queueSound in class AbstractCivilianEntity
      Parameters:
      soundEvent - the sound event to play.
      length - the length of the event.
      repetitions - the number of times to play it.
    • queueSound

      public void queueSound(@NotNull @NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions, float volume, float pitch)
      Description copied from class: AbstractCivilianEntity
      Queue a sound at the citizen.
      Specified by:
      queueSound in class AbstractCivilianEntity
      Parameters:
      soundEvent - the sound event to play.
      length - the length of the event.
      repetitions - the number of times to play it.
    • isActive

      public boolean isActive()
      Whether this entity is active and loaded
      Returns:
    • getThreatTable

      public ThreatTable getThreatTable()
      Description copied from interface: IThreatTableEntity
      Get the entities threat table
      Specified by:
      getThreatTable in interface IThreatTableEntity
      Returns:
    • getCitizenAI

      public ITickRateStateMachine<IState> getCitizenAI()
      Get the AI controlling the citizens behaviour
      Returns:
    • isSuppressingBounce

      public boolean isSuppressingBounce()
      Overrides:
      isSuppressingBounce in class net.minecraft.world.entity.Entity
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> dataAccessor)
      Specified by:
      onSyncedDataUpdated in interface net.minecraft.network.syncher.SyncedDataHolder
      Overrides:
      onSyncedDataUpdated in class net.minecraft.world.entity.LivingEntity
    • isCurrentlyGlowing

      public boolean isCurrentlyGlowing()
      Overrides:
      isCurrentlyGlowing in class net.minecraft.world.entity.LivingEntity
    • setGlowing

      public void setGlowing(boolean isGlowing)
    • getCombatTracker

      public net.minecraft.world.damagesource.CombatTracker getCombatTracker()
      Overrides:
      getCombatTracker in class net.minecraft.world.entity.LivingEntity
    • setMaxAir

      public void setMaxAir(int maxAir)
      Sets the max air
      Parameters:
      maxAir -
    • getTeamId

      public int getTeamId()
      Description copied from class: AbstractFastMinecoloniesEntity
      Get the team name of this entity. todo sam make colony ids unique across dimensions.
      Specified by:
      getTeamId in class AbstractFastMinecoloniesEntity
      Returns:
      the team name.