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
net.minecraft.world.entity.PathfinderMob
com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity
com.minecolonies.api.entity.citizen.AbstractCivilianEntity
com.minecolonies.api.entity.citizen.AbstractEntityCitizen
com.minecolonies.core.entity.citizen.EntityCitizen
- 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>
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.FallsoundsNested 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.RemovalReasonNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsFieldNested 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.AbstractEntityCitizen
DATA_BED_POS, DATA_CITIZEN_ID, DATA_COLONY_ID, DATA_IS_ASLEEP, DATA_IS_CHILD, DATA_IS_FEMALE, DATA_JOB, DATA_LEVEL, DATA_MODEL, DATA_RENDER_METADATA, DATA_STYLE, DATA_TEXTURE, DATA_TEXTURE_SUFFIX, ENTITY_AI_TICKRATE, entityStateControllerFields inherited from class com.minecolonies.api.entity.citizen.AbstractCivilianEntity
nextPlayerCollisionTimeFields inherited from class com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity
lastKnockBack, randomVarianceFields inherited from class net.minecraft.world.entity.PathfinderMob
DEFAULT_WALK_TARGET_VALUEFields inherited from class net.minecraft.world.entity.Mob
ambientSoundTime, armorDropChances, armorItems, 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, xpRewardFields 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, zzaFields 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, zOldFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEYFields inherited from interface net.minecraft.commands.CommandSource
NULLFields inherited from interface net.minecraft.world.entity.Leashable
LEASH_ELASTIC_DIST, LEASH_TAG, LEASH_TOO_FAR_DISTFields inherited from interface net.minecraft.world.scores.ScoreHolder
WILDCARD, WILDCARD_NAME -
Constructor Summary
ConstructorsConstructorDescriptionEntityCitizen(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 TypeMethodDescriptionvoidaddAdditionalSaveData(net.minecraft.nbt.CompoundTag compound) voidaiStep()Called frequently so the entity can update its state every tick as required.voidcallForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange) Calls a guard for help against an attacker.booleanA boolean check to test if the citizen can climb vines.booleanA boolean check to test if the citizen can path on rails.@NotNull net.minecraft.world.InteractionResultcheckAndHandleImportantInteractions(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.AbstractContainerMenucreateMenu(int id, @NotNull net.minecraft.world.entity.player.Inventory inv, @NotNull net.minecraft.world.entity.player.Player player) voidDecrease the saturation of the citizen for 1 action.voidDecrease the saturation of the citizen for 1 action.protected voiddefineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) voiddie(@NotNull net.minecraft.world.damagesource.DamageSource damageSource) Called when the mob's health reaches 0.protected voiddoPush(net.minecraft.world.entity.Entity entity) protected voidbooleanfloat@NotNull Iterable<net.minecraft.world.item.ItemStack> intGet the AI controlling the citizens behaviourThe 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 dataintGetter for the citizen id.net.minecraft.world.damagesource.CombatTracker@NotNull InventoryCitizenReturn this citizens inventory.@NotNull net.minecraft.world.item.ItemStackgetItemBySlot(net.minecraft.world.entity.EquipmentSlot slotType) @NotNull net.neoforged.neoforge.items.IItemHandlerGet the ILocation of the citizen.intfloatfloat@NotNull StringfloatgetSpeed()intGet the team name of this entity.Get the entities threat tableinthashCode()booleanhurt(@NotNull net.minecraft.world.damagesource.DamageSource damageSource, float damage) booleanisActive()Whether this entity is active and loadedbooleanisBaby()booleanbooleanisDead()booleanisInteractionItem(net.minecraft.world.item.ItemStack stack) Tests if the itemstack is used for citizen interactionsbooleanvoidmarkDirty(int time) Mark the citizen dirty to synch the data with the client.voidonPlayerCollide(net.minecraft.world.entity.player.Player player) On player collision actionvoidonSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> dataAccessor) protected voidpickUpItem(net.minecraft.world.entity.item.ItemEntity itemEntity) voidPlay move away sound when running from an entity.voidqueueSound(@NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions) Queue a sound at the citizen.voidqueueSound(@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.voidreadAdditionalSaveData(net.minecraft.nbt.CompoundTag compound) booleanRefreshes the saved view datavoidremove(@NotNull net.minecraft.world.entity.Entity.RemovalReason reason) booleanvoidsetCitizenColonyHandler(ICitizenColonyHandler citizenColonyHandler) voidsetCitizenExperienceHandler(ICitizenExperienceHandler citizenExperienceHandler) voidsetCitizenId(int id) Setter for the citizen id.voidsetCitizenInventoryHandler(ICitizenInventoryHandler citizenInventoryHandler) voidsetCitizenJobHandler(ICitizenJobHandler citizenJobHandler) voidsetCitizenSleepHandler(ICitizenSleepHandler citizenSleepHandler) voidsetCivilianData(@Nullable ICivilianData data) Setter for the citizen data.voidsetCustomName(@Nullable net.minecraft.network.chat.Component name) voidsetGlowing(boolean isGlowing) voidsetIsChild(boolean isChild) Sets whether this entity is a childvoidsetMaxAir(int maxAir) Sets the max airvoidsetRemoved(net.minecraft.world.entity.Entity.RemovalReason reason) voidsetRenderMetadata(String metadata) Set the metadata for rendering.voidSets the textures of all citizens and distinguishes between male and female.voidSets the visible status if there is nonevoidMethods inherited from class com.minecolonies.api.entity.citizen.AbstractEntityCitizen
calculateDamageAfterAbsorbs, canPickUpLoot, checkCanDropLoot, detectEquipmentUpdates, getDefaultAttributes, getDisplayName, getEntityStateController, getItemHandlerCap, getModelType, getNavigation, getOffsetTicks, getRandom, getRecentlyHit, getRenderMetadata, getTasks, getTeamColor, getTexture, getTextureId, getTicksExisted, interactAt, isBlocking, isControlledByLocalInstance, isFemale, isNoAi, isPushable, isPushedByFluid, isSleeping, markEquipmentDirty, onArmorAdd, onArmorRemove, push, setFemale, setItemSlot, setModelId, setOwnRotation, setTextureDirty, setTextureIdMethods inherited from class com.minecolonies.api.entity.citizen.AbstractCivilianEntity
checkBedExists, startRiding, toStringMethods inherited from class com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity
canBeLeashed, canBeStuck, canSpawnSprintParticle, changeDimension, decreaseAirSupply, hadHorizontalCollission, handlePortal, increaseAirSupply, isHorizontalCollisionMinor, isInWall, isInWaterRainOrBubble, isShiftKeyDown, knockback, onChangedBlock, onInsideBubbleColumn, pushEntities, removeFrost, sendDebugPackets, setCanBeStuck, setSharedFlagOnFire, setShiftKeyDown, setTicksFrozen, tryAddFrost, updateFallFlying, updateFluidOnEyes, updateInWaterStateAndDoFluidPushing, updateSwimAmount, updateSwimmingMethods inherited from class net.minecraft.world.entity.PathfinderMob
checkSpawnRules, closeRangeLeashBehaviour, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, handleLeashAtDistance, isPanicking, isPathFinding, shouldStayCloseToLeashHolderMethods 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, wantsToPickUpMethods 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, wouldNotSuffocateAtTargetPoseMethods 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, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingData, hasAttachments, hasData, removeData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.commands.CommandSource
alwaysAcceptsMethods inherited from interface net.minecraft.world.entity.EquipmentUser
equip, equip, equip, resolveSlotMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, hasData, removeData, setDataMethods 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, shouldRiderSitMethods inherited from interface com.minecolonies.api.util.IItemHandlerCapProvider
getItemHandlerCap, getItemHandlerCapMethods inherited from interface net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface net.neoforged.neoforge.client.extensions.IMenuProviderExtension
shouldTriggerClientSideContainerClosingOnOpenMethods inherited from interface net.minecraft.world.entity.Leashable
canHaveALeashAttachedToIt, elasticRangeLeashBehaviour, getLeashHolder, isLeashed, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashDataMethods 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:
checkAndHandleImportantInteractionsin classnet.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
- Specified by:
getScoreboardNamein interfacenet.minecraft.world.scores.ScoreHolder- Overrides:
getScoreboardNamein classnet.minecraft.world.entity.Entity
-
getCitizenDataView
Getter of the dataview, the clientside representation of the citizen.- Specified by:
getCitizenDataViewin classAbstractEntityCitizen- Returns:
- the view.
-
addAdditionalSaveData
public void addAdditionalSaveData(net.minecraft.nbt.CompoundTag compound) - Overrides:
addAdditionalSaveDatain classnet.minecraft.world.entity.Mob
-
readAdditionalSaveData
public void readAdditionalSaveData(net.minecraft.nbt.CompoundTag compound) - Overrides:
readAdditionalSaveDatain classnet.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:
aiStepin classAbstractEntityCitizen
-
refreshCitizenDataView
public boolean refreshCitizenDataView()Refreshes the saved view data- Returns:
- false
-
getMaxAirSupply
public int getMaxAirSupply()- Overrides:
getMaxAirSupplyin classnet.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:
isBabyin classnet.minecraft.world.entity.LivingEntity
-
defineSynchedData
protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) - Overrides:
defineSynchedDatain classAbstractEntityCitizen
-
setRenderMetadata
Set the metadata for rendering.- Overrides:
setRenderMetadatain classAbstractEntityCitizen- Parameters:
metadata- the metadata required.
-
getLocation
Get the ILocation of the citizen.- Specified by:
getLocationin classAbstractEntityCitizen- Returns:
- an ILocation object which contains the dimension and is unique.
-
getCitizenData
Getter for the citizendata. Tries to get it from the colony is the data is null.- Specified by:
getCitizenDatain classAbstractEntityCitizen- Returns:
- the data.
-
getCivilianData
Getter for the civilian data- Specified by:
getCivilianDatain classAbstractCivilianEntity- Returns:
- the data.
-
setCivilianData
Setter for the citizen data.- Specified by:
setCivilianDatain classAbstractCivilianEntity- Parameters:
data- the data to set.
-
getInventoryCitizen
Return this citizens inventory.- Specified by:
getInventoryCitizenin classAbstractEntityCitizen- Returns:
- the inventory this citizen has.
-
getItemHandlerCitizen
@NotNull public @NotNull net.neoforged.neoforge.items.IItemHandler getItemHandlerCitizen()- Specified by:
getItemHandlerCitizenin classAbstractEntityCitizen
-
markDirty
public void markDirty(int time) Mark the citizen dirty to synch the data with the client.- Specified by:
markDirtyin classAbstractCivilianEntity
-
setIsChild
public void setIsChild(boolean isChild) Sets whether this entity is a child- Specified by:
setIsChildin classAbstractEntityCitizen- Parameters:
isChild- boolean
-
playMoveAwaySound
public void playMoveAwaySound()Play move away sound when running from an entity.- Specified by:
playMoveAwaySoundin classAbstractEntityCitizen
-
decreaseSaturationForAction
public void decreaseSaturationForAction()Decrease the saturation of the citizen for 1 action.- Specified by:
decreaseSaturationForActionin classAbstractEntityCitizen
-
decreaseSaturationForContinuousAction
public void decreaseSaturationForContinuousAction()Decrease the saturation of the citizen for 1 action.- Specified by:
decreaseSaturationForContinuousActionin classAbstractEntityCitizen
-
getCivilianID
public int getCivilianID()Getter for the citizen id.- Specified by:
getCivilianIDin classAbstractCivilianEntity- Returns:
- the id.
-
setCitizenId
public void setCitizenId(int id) Setter for the citizen id.- Specified by:
setCitizenIdin classAbstractCivilianEntity- Parameters:
id- the id to set.
-
getCitizenExperienceHandler
The Handler for all experience related methods.- Specified by:
getCitizenExperienceHandlerin classAbstractEntityCitizen- Returns:
- the instance of the handler.
-
getCitizenInventoryHandler
The Handler for all inventory related methods.- Specified by:
getCitizenInventoryHandlerin classAbstractEntityCitizen- Returns:
- the instance of the handler.
-
setCitizenInventoryHandler
- Specified by:
setCitizenInventoryHandlerin classAbstractEntityCitizen
-
getCitizenColonyHandler
The Handler for all colony related methods.- Specified by:
getCitizenColonyHandlerin classAbstractEntityCitizen- Returns:
- the instance of the handler.
-
setCitizenColonyHandler
- Specified by:
setCitizenColonyHandlerin classAbstractEntityCitizen
-
getCitizenJobHandler
The Handler for all job related methods.- Specified by:
getCitizenJobHandlerin classAbstractEntityCitizen- Returns:
- the instance of the handler.
-
getCitizenSleepHandler
The Handler for all job related methods.- Specified by:
getCitizenSleepHandlerin classAbstractEntityCitizen- Returns:
- the instance of the handler.
-
setVisibleStatusIfNone
Sets the visible status if there is none- Parameters:
status- status to set
-
getRotationYaw
public float getRotationYaw()- Specified by:
getRotationYawin classAbstractEntityCitizen
-
getRotationPitch
public float getRotationPitch()- Specified by:
getRotationPitchin classAbstractEntityCitizen
-
isDead
public boolean isDead()- Specified by:
isDeadin classAbstractEntityCitizen
-
setCitizenSleepHandler
- Specified by:
setCitizenSleepHandlerin classAbstractEntityCitizen
-
setCitizenJobHandler
- Specified by:
setCitizenJobHandlerin classAbstractEntityCitizen
-
setCitizenExperienceHandler
- Specified by:
setCitizenExperienceHandlerin classAbstractEntityCitizen
-
hurt
public boolean hurt(@NotNull @NotNull net.minecraft.world.damagesource.DamageSource damageSource, float damage) - Overrides:
hurtin classAbstractFastMinecoloniesEntity
-
getSpeed
public float getSpeed()- Overrides:
getSpeedin classnet.minecraft.world.entity.LivingEntity
-
callForHelp
public void callForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange) Description copied from class:AbstractEntityCitizenCalls a guard for help against an attacker.- Specified by:
callForHelpin classAbstractEntityCitizen- Parameters:
attacker- the attacking entityguardHelpRange- the squaredistance in which we search for nearby guards
-
doPush
protected void doPush(net.minecraft.world.entity.Entity entity) - Overrides:
doPushin classnet.minecraft.world.entity.LivingEntity
-
onPlayerCollide
public void onPlayerCollide(net.minecraft.world.entity.player.Player player) Description copied from class:AbstractCivilianEntityOn player collision action- Overrides:
onPlayerCollidein classAbstractEntityCitizen- Parameters:
player-
-
getAgeScale
public float getAgeScale()- Overrides:
getAgeScalein classnet.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:
diein classnet.minecraft.world.entity.LivingEntity- Parameters:
damageSource- the attacking entity.
-
remove
public void remove(@NotNull @NotNull net.minecraft.world.entity.Entity.RemovalReason reason) - Overrides:
removein classnet.minecraft.world.entity.LivingEntity
-
dropEquipment
protected void dropEquipment()- Overrides:
dropEquipmentin classnet.minecraft.world.entity.LivingEntity
-
getAllSlots
- Overrides:
getAllSlotsin classnet.minecraft.world.entity.LivingEntity
-
getItemBySlot
@NotNull public @NotNull net.minecraft.world.item.ItemStack getItemBySlot(net.minecraft.world.entity.EquipmentSlot slotType) - Specified by:
getItemBySlotin interfacenet.minecraft.world.entity.EquipmentUser- Overrides:
getItemBySlotin classnet.minecraft.world.entity.Mob
-
getArmorValue
public int getArmorValue()- Overrides:
getArmorValuein classnet.minecraft.world.entity.LivingEntity
-
equals
- Overrides:
equalsin classnet.minecraft.world.entity.Entity
-
hashCode
public int hashCode()- Overrides:
hashCodein classnet.minecraft.world.entity.Entity
-
setRemoved
public void setRemoved(net.minecraft.world.entity.Entity.RemovalReason reason) - Specified by:
setRemovedin interfacenet.minecraft.world.level.entity.EntityAccess- Overrides:
setRemovedin classnet.minecraft.world.entity.Entity
-
setCustomName
public void setCustomName(@Nullable @Nullable net.minecraft.network.chat.Component name) - Overrides:
setCustomNamein classnet.minecraft.world.entity.Entity
-
spawnAnim
public void spawnAnim()- Overrides:
spawnAnimin classnet.minecraft.world.entity.Mob
-
pickUpItem
protected void pickUpItem(net.minecraft.world.entity.item.ItemEntity itemEntity) - Overrides:
pickUpItemin classnet.minecraft.world.entity.Mob
-
requiresCustomPersistence
public boolean requiresCustomPersistence()- Overrides:
requiresCustomPersistencein classnet.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:
createMenuin interfacenet.minecraft.world.inventory.MenuConstructor
-
setTexture
public void setTexture()Description copied from class:AbstractEntityCitizenSets the textures of all citizens and distinguishes between male and female.- Overrides:
setTexturein classAbstractEntityCitizen
-
queueSound
public void queueSound(@NotNull @NotNull net.minecraft.sounds.SoundEvent soundEvent, net.minecraft.core.BlockPos pos, int length, int repetitions) Description copied from class:AbstractCivilianEntityQueue a sound at the citizen.- Specified by:
queueSoundin classAbstractCivilianEntity- 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:AbstractCivilianEntityQueue a sound at the citizen.- Specified by:
queueSoundin classAbstractCivilianEntity- 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
Description copied from interface:IThreatTableEntityGet the entities threat table- Specified by:
getThreatTablein interfaceIThreatTableEntity- Returns:
-
getCitizenAI
Get the AI controlling the citizens behaviour- Returns:
-
isSuppressingBounce
public boolean isSuppressingBounce()- Overrides:
isSuppressingBouncein classnet.minecraft.world.entity.Entity
-
onSyncedDataUpdated
public void onSyncedDataUpdated(net.minecraft.network.syncher.EntityDataAccessor<?> dataAccessor) - Specified by:
onSyncedDataUpdatedin interfacenet.minecraft.network.syncher.SyncedDataHolder- Overrides:
onSyncedDataUpdatedin classnet.minecraft.world.entity.LivingEntity
-
isCurrentlyGlowing
public boolean isCurrentlyGlowing()- Overrides:
isCurrentlyGlowingin classnet.minecraft.world.entity.LivingEntity
-
setGlowing
public void setGlowing(boolean isGlowing) -
getCombatTracker
public net.minecraft.world.damagesource.CombatTracker getCombatTracker()- Overrides:
getCombatTrackerin classnet.minecraft.world.entity.LivingEntity
-
setMaxAir
public void setMaxAir(int maxAir) Sets the max air- Parameters:
maxAir-
-
getTeamId
public int getTeamId()Description copied from class:AbstractFastMinecoloniesEntityGet the team name of this entity. todo sam make colony ids unique across dimensions.- Specified by:
getTeamIdin classAbstractFastMinecoloniesEntity- Returns:
- the team name.
-