Class AbstractEntityCitizen
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.entity.Entity>
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
- All Implemented Interfaces:
IStuckHandlerEntity,net.minecraft.commands.CommandSource,net.minecraft.world.entity.Attackable,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.minecraftforge.common.capabilities.ICapabilityProvider,net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.entity.Entity>,net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>,net.minecraftforge.common.extensions.IForgeEntity,net.minecraftforge.common.extensions.IForgeLivingEntity,net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- Direct Known Subclasses:
EntityCitizen,VisitorCitizen
public abstract class AbstractEntityCitizen
extends AbstractCivilianEntity
implements net.minecraft.world.MenuProvider
The abstract citizen entity.
-
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.minecraftforge.common.capabilities.CapabilityProvider
net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 intprotected ITickRateStateMachine<IState>The AI for citizens, controlling different global statesFields 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, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, LEASH_TAG, 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, targetSelector, UPDATE_GOAL_SELECTOR_EVERY_N_TICKS, xpRewardFields inherited from class net.minecraft.world.entity.LivingEntity
animStep, animStepO, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, DEATH_DURATION, deathScore, deathTime, DEFAULT_BASE_GRAVITY, DEFAULT_EYE_HEIGHT, 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, lerpYRot, lerpZ, LIVING_ENTITY_FLAG_IS_USING, LIVING_ENTITY_FLAG_OFF_HAND, LIVING_ENTITY_FLAG_SPIN_ATTACK, lyHeadRot, 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_TICKS_REQUIRED_TO_FREEZE, blocksBuilding, BOARDING_COOLDOWN, boardingCooldown, BREATHING_DISTANCE_BELOW_EYES, 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, eyeHeight, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, isInsidePortal, level, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, PASSENGERS_TAG, portalEntrancePos, portalTime, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, vehicle, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRotO, yo, yOld, yRotO, zo, zOldFields inherited from interface net.minecraft.commands.CommandSource
NULL -
Constructor Summary
ConstructorsConstructorDescriptionAbstractEntityCitizen(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 TypeMethodDescriptionvoidaiStep()floatcalculateDamageAfterAbsorbs(net.minecraft.world.damagesource.DamageSource source, float damage) Calculate adjusted damage.abstract voidcallForHelp(net.minecraft.world.entity.Entity attacker, int guardHelpRange) Calls a guard for help against an attacker.booleanDisable vanilla's item picking stuff as we're doing it ourselvesbooleanCheck if can drop loot.abstract voidDecrease the saturation of the citizen for 1 action.abstract voidDecrease the saturation of the citizen for 1 action.protected voidvoidabstract ICitizenColonyHandlerThe Handler for all colony related methods.abstract ICitizenDataGetter for the citizendata.abstract ICitizenDataViewGet the citizen data view.abstract ICitizenExperienceHandlerThe Handler for all experience related methods.abstract ICitizenInventoryHandlerThe Handler for all inventory related methods.abstract ICitizenJobHandlerThe Handler for all job related methods.abstract ICitizenSleepHandlerThe Handler for all job related methods.static net.minecraft.world.entity.ai.attributes.AttributeSupplier.BuilderGet the default attributes with their values.@NotNull net.minecraft.network.chat.ComponentGet the entities state controllerabstract @NotNull InventoryCitizenReturn this citizens inventory.abstract @NotNull net.minecraftforge.items.IItemHandlerabstract ILocationGet the ILocation of the citizen.net.minecraft.resources.ResourceLocationGet the model assigned to the citizen.@NotNull AbstractAdvancedPathNavigateintnet.minecraft.util.RandomSourceGetter of the citizens random object.intCheck if recently hit.Getter for the render metadata.abstract floatabstract floatnet.minecraft.world.entity.ai.goal.GoalSelectorgetTasks()int@NotNull net.minecraft.resources.ResourceLocationGetter of the resource location of the texture.intGetter for the texture id.int@NotNull net.minecraft.world.InteractionResultinteractAt(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.Vec3 vec, net.minecraft.world.InteractionHand hand) booleanbooleanDisable vanilla steering logic for villagersabstract booleanisDead()booleanisFemale()Getter which checks if the citizen is female.booleanisNoAi()Returns false if the newer Entity AI code should be run.booleanbooleanDisallow pushing from fluids to prevent stuckbooleanvoidMark the equipment as dirty.voidonArmorAdd(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot) On armor equip.voidonArmorRemove(net.minecraft.world.item.ItemStack stack, net.minecraft.world.entity.EquipmentSlot equipmentSlot) On armor removal.voidonPlayerCollide(net.minecraft.world.entity.player.Player player) On player collision actionabstract voidPlay move away sound when running from an entity.voidpush(@NotNull net.minecraft.world.entity.Entity entityIn) Ignores entity collisions are colliding for a while, solves stuck e.g.abstract voidsetCitizenColonyHandler(ICitizenColonyHandler citizenColonyHandler) abstract voidsetCitizenExperienceHandler(ICitizenExperienceHandler citizenExperienceHandler) abstract voidsetCitizenInventoryHandler(ICitizenInventoryHandler citizenInventoryHandler) abstract voidsetCitizenJobHandler(ICitizenJobHandler citizenJobHandler) abstract voidsetCitizenSleepHandler(ICitizenSleepHandler citizenSleepHandler) voidsetFemale(boolean female) Set the gender.abstract voidsetIsChild(boolean isChild) Sets whether this entity is a childvoidsetItemSlot(net.minecraft.world.entity.EquipmentSlot slot, @NotNull net.minecraft.world.item.ItemStack newItem) voidsetModelId(net.minecraft.resources.ResourceLocation model) Set the model id.voidsetOwnRotation(float yaw, float pitch) Set the rotation of the citizen.voidsetRenderMetadata(String renderMetadata) Set the render meta data.voidSets the textures of all citizens and distinguishes between male and female.voidSet the texture dirty.voidsetTextureId(int textureId) Set the texture id.Methods inherited from class com.minecolonies.api.entity.citizen.AbstractCivilianEntity
checkBedExists, getCivilianData, getCivilianID, getStandingEyeHeight, markDirty, queueSound, queueSound, setCitizenId, setCivilianData, startRiding, toStringMethods inherited from class com.minecolonies.api.entity.other.AbstractFastMinecoloniesEntity
canBeLeashed, canBeStuck, canChangeDimensions, canSpawnSoulSpeedParticle, canSpawnSprintParticle, changeDimension, decreaseAirSupply, getTeamId, hadHorizontalCollission, handleNetherPortal, hurt, increaseAirSupply, isHorizontalCollisionMinor, isInWall, isInWaterRainOrBubble, isShiftKeyDown, knockback, onChangedBlock, onInsideBubbleColumn, pushEntities, removeFrost, removeSoulSpeed, sendDebugPackets, setCanBeStuck, setSharedFlagOnFire, setShiftKeyDown, setTicksFrozen, tryAddFrost, tryAddSoulSpeed, updateFallFlying, updateFluidOnEyes, updateInWaterStateAndDoFluidPushing, updateSwimAmount, updateSwimmingMethods inherited from class net.minecraft.world.entity.PathfinderMob
checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, shouldStayCloseToLeashHolder, tickLeashMethods inherited from class net.minecraft.world.entity.Mob
addAdditionalSaveData, ate, baseTick, canAttackType, canFireProjectileWeapon, canHoldItem, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkAndHandleImportantInteractions, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clearRestriction, convertTo, createBodyControl, createMobAttributes, createNavigation, customServerAiStep, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getControllingPassenger, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMeleeAttackRangeSqr, getMoveControl, getPathfindingMalus, getPerceivedTargetDistanceSquareForMeleeAttack, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, handleEntityEvent, hasRestriction, interact, isAggressive, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isPersistenceRequired, isSpawnCancelled, isSunBurnTick, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, lookAt, mobInteract, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, readAdditionalSaveData, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, removeWhenFarAway, requiresCustomPersistence, restrictTo, serverAiStep, setAggressive, setBaby, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, tick, tickHeadTurn, updateControlFlags, wantsToPickUpMethods inherited from class net.minecraft.world.entity.LivingEntity
actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, die, doAutoAttackOnTouch, doesEmitEquipEvent, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributeBaseValue, getAttributes, getAttributeValue, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCapability, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDeathSound, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getEyeHeight, getFallFlyingTicks, getFallSounds, getFluidFallingAdjustedMovement, getFlyingSpeed, getHealth, getHurtDir, getHurtSound, getItemInHand, getJumpBoostPower, getJumpPower, getKillCredit, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMeleeAttackReferencePosition, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, indicateDamage, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBaby, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isPickable, isSensitiveToWater, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, lerpHeadTo, lerpTo, lookAt, makeBrain, maxUpStep, onBelowWorld, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onItemPickup, onLeaveCombat, onSoulSpeedBlock, onSyncedDataUpdated, playBlockFallSound, randomTeleport, recreateFromPacket, releaseUsingItem, remove, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, resetForwardDirectionOfRelativePortalPosition, reviveCaps, rideTick, sendEffectToPassengers, setAbsorptionAmount, setArrowCount, setDiscardFriction, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDiscardFriction, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, skipDropExperience, spawnSoulSpeedParticle, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, tickRidden, travel, triggerItemUseEffects, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumedMethods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canEnterPose, canRide, canSprint, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkBelowWorld, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, collide, collideBoundingBox, copyPosition, couldAcceptPassenger, createCommandSourceStack, createHoverEvent, damageSources, dampensVibrations, discard, dismountsUnderwater, dismountTo, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, extinguishFire, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, fixupDimensions, gameEvent, gameEvent, getAddEntityPacket, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBlockStateOnLegacy, getBlockX, getBlockY, getBlockZ, getBoundingBox, getBoundingBoxForPose, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyeInFluidType, getEyePosition, getEyePosition, getEyeY, getFeetBlockState, getFireImmuneTicks, getFirstPassenger, getFluidHeight, getFluidJumpThreshold, getFluidTypeHeight, getForward, getHandHoldingItemAngle, getId, getIndirectPassengers, getLeashOffset, getLeashOffset, getLightLevelDependentMagicValue, getLightProbePosition, getLookAngle, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getMyRidingOffset, getName, getNameTagOffsetY, getOnPos, getOnPos, getOnPosLegacy, getPassengers, getPassengersAndSelf, getPassengersRidingOffset, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPortalWaitTime, 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, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isRemoved, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onGround, onInsideBlock, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, onSyncedDataUpdated, pick, playCombinationStepSounds, playEntityOnFireExtinguishedSound, playerTouch, playMuffledStepSound, playSound, playSound, playStepSound, playSwimSound, position, positionRider, positionRider, processFlappingMovement, processPortalCooldown, push, reapplyPosition, refreshDimensions, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetFallDistance, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendSystemMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setInvulnerable, setIsInPowderSnow, setLevel, setLevelCallback, setMaxUpStep, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, 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, teleportToWithTicket, thunderHit, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, waterSwimSoundMethods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCapsMethods 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.minecraftforge.common.capabilities.ICapabilityProvider
getCapabilityMethods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, deserializeNBT, getClassification, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, serializeNBT, shouldRiderSitMethods inherited from interface net.minecraftforge.common.extensions.IForgeLivingEntity
canDrownInFluidType, canSwimInFluidType, moveInFluid, self, sinkInFluidMethods inherited from interface net.minecraft.world.inventory.MenuConstructor
createMenu
-
Field Details
-
ENTITY_AI_TICKRATE
public static final int ENTITY_AI_TICKRATE- See Also:
-
DATA_LEVEL
-
DATA_TEXTURE
-
DATA_IS_FEMALE
-
DATA_COLONY_ID
-
DATA_CITIZEN_ID
-
DATA_MODEL
-
DATA_RENDER_METADATA
-
DATA_IS_ASLEEP
-
DATA_IS_CHILD
-
DATA_BED_POS
public static final net.minecraft.network.syncher.EntityDataAccessor<net.minecraft.core.BlockPos> DATA_BED_POS -
DATA_STYLE
-
DATA_TEXTURE_SUFFIX
-
DATA_JOB
-
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:
canPickUpLootin classnet.minecraft.world.entity.Mob
-
isControlledByLocalInstance
public boolean isControlledByLocalInstance()Disable vanilla steering logic for villagers- Overrides:
isControlledByLocalInstancein classnet.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:
interactAtin classnet.minecraft.world.entity.Entity
-
isNoAi
public boolean isNoAi()Returns false if the newer Entity AI code should be run.- Overrides:
isNoAiin classnet.minecraft.world.entity.Mob
-
setTexture
public void setTexture()Sets the textures of all citizens and distinguishes between male and female. -
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()- Overrides:
defineSynchedDatain classnet.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.
-
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:
pushin classAbstractCivilianEntity- Parameters:
entityIn- entity to collide with
-
onPlayerCollide
public void onPlayerCollide(net.minecraft.world.entity.player.Player player) Description copied from class:AbstractCivilianEntityOn player collision action- Overrides:
onPlayerCollidein classAbstractCivilianEntity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classnet.minecraft.world.entity.LivingEntity
-
aiStep
public void aiStep()- Overrides:
aiStepin classnet.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
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
Getter for the render metadata.- Returns:
- the meta data.
-
getRandom
public net.minecraft.util.RandomSource getRandom()Getter of the citizens random object.- Overrides:
getRandomin classnet.minecraft.world.entity.LivingEntity- Returns:
- random object.
-
getOffsetTicks
public int getOffsetTicks() -
isBlocking
public boolean isBlocking()- Overrides:
isBlockingin classnet.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
Get the ILocation of the citizen.- 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.- Returns:
- the data.
-
getInventoryCitizen
Return this citizens inventory.- Returns:
- the inventory this citizen has.
-
getItemHandlerCitizen
@NotNull public abstract @NotNull net.minecraftforge.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
The Handler for all experience related methods.- Returns:
- the instance of the handler.
-
getCitizenInventoryHandler
The Handler for all inventory related methods.- Returns:
- the instance of the handler.
-
setCitizenInventoryHandler
-
getCitizenColonyHandler
The Handler for all colony related methods.- Returns:
- the instance of the handler.
-
setCitizenColonyHandler
-
getCitizenJobHandler
The Handler for all job related methods.- Returns:
- the instance of the handler.
-
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
-
setCitizenJobHandler
-
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 entityguardHelpRange- the squaredistance in which we search for nearby guards
-
detectEquipmentUpdates
public void detectEquipmentUpdates()- Overrides:
detectEquipmentUpdatesin classnet.minecraft.world.entity.LivingEntity
-
setItemSlot
public void setItemSlot(net.minecraft.world.entity.EquipmentSlot slot, @NotNull @NotNull net.minecraft.world.item.ItemStack newItem) - Overrides:
setItemSlotin classnet.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:
isPushedByFluidin classnet.minecraft.world.entity.Entity- Returns:
-
getEntityStateController
Get the entities state controller- Returns:
-
isSleeping
public boolean isSleeping()- Overrides:
isSleepingin classnet.minecraft.world.entity.LivingEntity
-
getTeamColor
public int getTeamColor()- Overrides:
getTeamColorin classnet.minecraft.world.entity.Entity
-
getDisplayName
@NotNull public @NotNull net.minecraft.network.chat.Component getDisplayName()- Specified by:
getDisplayNamein interfacenet.minecraft.world.MenuProvider- Specified by:
getDisplayNamein interfacenet.minecraft.world.Nameable- Overrides:
getDisplayNamein classnet.minecraft.world.entity.Entity
-