Class AbstractVillagerEntity
java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<Entity>
net.minecraft.entity.Entity
net.minecraft.entity.LivingEntity
net.minecraft.entity.MobEntity
net.minecraft.entity.CreatureEntity
net.minecraft.entity.AgeableEntity
net.minecraft.entity.merchant.villager.AbstractVillagerEntity
- All Implemented Interfaces:
ICommandSource
,INPC
,IMerchant
,INameable
,ICapabilityProvider
,ICapabilitySerializable<CompoundNBT>
,IForgeEntity
,INBTSerializable<CompoundNBT>
- Direct Known Subclasses:
VillagerEntity
,WanderingTraderEntity
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.AgeableEntity
AgeableEntity.AgeableData
Nested classes/interfaces inherited from class net.minecraft.entity.Entity
Entity.IMoveCallback
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final DataParameter<Integer>
private final Inventory
protected MerchantOffers
private PlayerEntity
Fields inherited from class net.minecraft.entity.AgeableEntity
age, forcedAge, forcedAgeTimer
Fields inherited from class net.minecraft.entity.MobEntity
ambientSoundTime, armorDropChances, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector, xpReward
Fields inherited from class net.minecraft.entity.LivingEntity
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_LIVING_ENTITY_FLAGS, dead, deathScore, deathTime, fallFlyTicks, flyingSpeed, hurtDir, hurtDuration, hurtTime, invulnerableDuration, jumping, lastHurt, lastHurtByPlayer, lastHurtByPlayerTime, lerpHeadSteps, lerpSteps, lerpX, lerpXRot, lerpY, lerpYRot, lerpZ, lyHeadRot, noActionTime, oAttackAnim, oRun, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, timeOffs, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
Fields inherited from class net.minecraft.entity.Entity
blocksBuilding, boardingCooldown, DATA_POSE, DATA_SHARED_FLAGS_ID, ENTITY_COUNTER, entityData, fallDistance, firstTick, fluidHeight, fluidOnEyes, forcedLoading, glowing, hasImpulse, horizontalCollision, hurtMarked, inChunk, invulnerableTime, isInsidePortal, level, LOGGER, maxUpStep, moveDist, noCulling, noPhysics, onGround, portalEntrancePos, portalTime, pushthrough, random, removed, stringUUID, stuckSpeedMultiplier, tickCount, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
Fields inherited from interface net.minecraft.command.ICommandSource
NULL
-
Constructor Summary
ConstructorDescriptionAbstractVillagerEntity
(EntityType<? extends AbstractVillagerEntity> p_i50185_1_, World p_i50185_2_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalSaveData
(CompoundNBT p_213281_1_) protected void
addOffersFromItemListings
(MerchantOffers p_213717_1_, VillagerTrades.ITrade[] p_213717_2_, int p_213717_3_) protected void
addParticlesAroundSelf
(IParticleData p_213718_1_) boolean
canBeLeashed
(PlayerEntity p_184652_1_) changeDimension
(ServerWorld p_241206_1_, ITeleporter teleporter) protected void
void
die
(DamageSource p_70645_1_) finalizeSpawn
(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, ILivingEntityData p_213386_4_, CompoundNBT p_213386_5_) getLevel()
getRopeHoldPosition
(float p_241843_1_) protected float
getStandingEyeHeight
(Pose p_213348_1_, EntitySize p_213348_2_) protected SoundEvent
getTradeUpdatedSound
(boolean p_213721_1_) int
int
boolean
void
notifyTrade
(MerchantOffer p_213704_1_) void
notifyTradeUpdated
(ItemStack p_110297_1_) void
overrideOffers
(MerchantOffers p_213703_1_) void
overrideXp
(int p_213702_1_) void
void
readAdditionalSaveData
(CompoundNBT p_70037_1_) protected abstract void
rewardTradeXp
(MerchantOffer p_213713_1_) boolean
void
setTradingPlayer
(PlayerEntity p_70932_1_) void
setUnhappyCounter
(int p_213720_1_) boolean
protected void
protected abstract void
Methods inherited from class net.minecraft.entity.AgeableEntity
ageBoundaryReached, ageUp, ageUp, aiStep, canBreed, getAge, getBreedOffspring, isBaby, onSyncedDataUpdated, setAge, setBaby
Methods inherited from class net.minecraft.entity.CreatureEntity
checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
Methods inherited from class net.minecraft.entity.MobEntity
ate, baseTick, canAttack, canAttackType, canBeControlledByRider, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, customServerAiStep, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getEquipmentSlotForItem, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getNavigation, getPathfindingMalus, getRestrictCenter, getRestrictRadius, getSensing, getTarget, handleEntityEvent, hasRestriction, interact, isAggressive, isControlledByLocalInstance, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSunBurnTick, isValidSlotForItem, isWithinRestriction, isWithinRestriction, jumpInLiquid, lookAt, mobInteract, onOffspringSpawnedFromEgg, pickUpItem, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeWhenFarAway, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tick, tickHeadTurn, updateControlFlags, wantsToPickUp
Methods inherited from class net.minecraft.entity.LivingEntity
actuallyHurt, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, brainProvider, broadcastBreakEvent, broadcastBreakEvent, calculateEntityAnimation, calculateFallDamage, canAttack, canBeAffected, canBreatheUnderwater, canSee, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, decreaseAirSupply, doAutoAttackOnTouch, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAddEntityPacket, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getBrain, getCapability, getCombatTracker, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDeathSound, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEyeHeight, getFallDamageSound, getFallFlyingTicks, getFeetBlockState, getFluidFallingAdjustedMovement, getHealth, getHurtSound, getItemInHand, getJumpPower, getKillCredit, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxHealth, getMobType, getNoActionTime, getOffhandItem, getProjectile, getRandom, getRelativePortalPosition, getScale, getSleepingPos, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, increaseAirSupply, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadTo, lerpTo, lookAt, makeBrain, markHurt, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onItemPickup, onLeaveCombat, onSoulSpeedBlock, outOfWorld, playBlockFallSound, playEquipSound, push, pushEntities, randomTeleport, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeSoulSpeed, resetForwardDirectionOfRelativePortalPosition, rideableUnderWater, rideTick, setAbsorptionAmount, setArrowCount, setHealth, setItemInHand, setJumping, setLastHurtByMob, setLastHurtByPlayer, setLastHurtMob, setLivingEntityFlag, setNoActionTime, setOnGround, setRecordPlayingNearby, setSleepingPos, setSprinting, setStingerCount, setYBodyRot, setYHeadRot, shouldDropExperience, shouldDropLoot, shouldRemoveSoulSpeed, shouldRiderFaceForward, shouldShowName, spawnSoulSpeedParticle, startAutoSpinAttack, startSleeping, startUsingItem, stopRiding, stopSleeping, stopUsingItem, swing, swing, take, tickDeath, tickEffects, travel, triggerItemUseEffects, tryAddSoulSpeed, updateEffectVisibility, updateInvisibilityStatus, updateSwingTime
Methods inherited from class net.minecraft.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canChangeDimensions, canCollideWith, canEnterPose, canRide, canSpawnSprintParticle, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, checkAndResetForcedChunkAdditionFlag, checkAndResetUpdateChunkPos, checkInsideBlocks, clearFire, closerThan, collideBoundingBox, collideBoundingBoxHeuristically, collideBoundingBoxLegacy, copyPosition, createCommandSourceStack, createHoverEvent, displayFireAnimation, distanceTo, distanceToSqr, distanceToSqr, distanceToSqr, doEnchantDamageEffects, doWaterSplashEffect, ejectPassengers, equals, fillCrashReportCategory, findDimensionEntryPoint, fireImmune, getAirSupply, getAllSlots, getBbHeight, getBbWidth, getBlockExplosionResistance, getBlockJumpFactor, getBlockPosBelowThatAffectsMyMovement, getBlockStateOn, getBoundingBox, getBoundingBoxForPose, getBrightness, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControllingPassenger, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDirection, getDismountLocationForPassenger, getDisplayName, getEncodeId, getEntityData, getExitPortal, getEyeHeight, getEyeHeight, getEyeHeightAccess, getEyePosition, getEyeY, getFireImmuneTicks, getFluidHeight, getFluidJumpThreshold, getForward, getHorizontalDistanceSqr, getId, getIndirectPassengers, getLeashOffset, getLightProbePosition, getLookAngle, getMaxAirSupply, getMotionDirection, getMyRidingOffset, getName, getOnPos, getPacketCoordinates, getPassengers, getPassengersRidingOffset, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getY, getY, getZ, getZ, handleInsidePortal, handleNetherPortal, hasCustomName, hashCode, hasIndirectPassenger, hasOnePlayerPassenger, hasPassenger, hasPassenger, hasPermissions, ignoreExplosion, interactAt, is, isAddedToWorld, isAlliedTo, isAlliedTo, isAttackable, isColliding, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFree, isGlowing, isIgnoringBlockTriggers, isInLava, isInvisible, isInvisibleTo, isInvulnerable, isInvulnerableTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isMovementNoisy, isNoGravity, isOnFire, isOnGround, isOnPortalCooldown, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killed, lavaHurt, lerpMotion, limitPistonMovement, load, makeFlySound, makeStuckInBlock, maybeBackOffFromEdge, mirror, move, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onInsideBlock, onInsideBubbleColumn, onlyOpCanSetNbt, onPassengerTurned, onRemovedFromWorld, pick, playerTouch, playFlySound, playSound, playStepSound, playSwimSound, position, positionRider, processPortalCooldown, push, reapplyPosition, refreshDimensions, remove, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rotate, save, saveAsPassenger, saveWithoutId, sendMessage, setAirSupply, setBoundingBox, setCustomName, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setGlowing, setId, setInvisible, setInvulnerable, setLevel, setLocationFromBoundingbox, setNoGravity, setPacketCoordinates, setPacketCoordinates, setPortalCooldown, setPos, setPosAndOldPos, setPose, setPosRaw, setRemainingFireTicks, setRot, setSecondsOnFire, setSharedFlag, setShiftKeyDown, setSilent, setSwimming, setUUID, setViewScale, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, teleportTo, teleportToWithTicket, thunderHit, toString, turn, unRide, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenInWater, canRiderInteract, deserializeNBT, getClassification, getDimensionsForge, getEntity, getEyeHeightForge, getParts, getPickedResult, isMultipartEntity, serializeNBT, shouldRiderSit
Methods inherited from interface net.minecraft.entity.merchant.IMerchant
canRestock, openTradingScreen
-
Field Details
-
DATA_UNHAPPY_COUNTER
-
tradingPlayer
-
offers
-
inventory
-
-
Constructor Details
-
AbstractVillagerEntity
public AbstractVillagerEntity(EntityType<? extends AbstractVillagerEntity> p_i50185_1_, World p_i50185_2_)
-
-
Method Details
-
finalizeSpawn
public ILivingEntityData finalizeSpawn(IServerWorld p_213386_1_, DifficultyInstance p_213386_2_, SpawnReason p_213386_3_, @Nullable ILivingEntityData p_213386_4_, @Nullable CompoundNBT p_213386_5_) - Overrides:
finalizeSpawn
in classAgeableEntity
-
getUnhappyCounter
public int getUnhappyCounter() -
setUnhappyCounter
public void setUnhappyCounter(int p_213720_1_) -
getVillagerXp
public int getVillagerXp()- Specified by:
getVillagerXp
in interfaceIMerchant
-
getStandingEyeHeight
- Overrides:
getStandingEyeHeight
in classLivingEntity
-
defineSynchedData
protected void defineSynchedData()- Overrides:
defineSynchedData
in classAgeableEntity
-
setTradingPlayer
- Specified by:
setTradingPlayer
in interfaceIMerchant
-
getTradingPlayer
- Specified by:
getTradingPlayer
in interfaceIMerchant
-
isTrading
public boolean isTrading() -
getOffers
-
overrideOffers
- Specified by:
overrideOffers
in interfaceIMerchant
-
overrideXp
public void overrideXp(int p_213702_1_) - Specified by:
overrideXp
in interfaceIMerchant
-
notifyTrade
- Specified by:
notifyTrade
in interfaceIMerchant
-
rewardTradeXp
-
showProgressBar
public boolean showProgressBar()- Specified by:
showProgressBar
in interfaceIMerchant
-
notifyTradeUpdated
- Specified by:
notifyTradeUpdated
in interfaceIMerchant
-
getNotifyTradeSound
- Specified by:
getNotifyTradeSound
in interfaceIMerchant
-
getTradeUpdatedSound
-
playCelebrateSound
public void playCelebrateSound() -
addAdditionalSaveData
- Overrides:
addAdditionalSaveData
in classAgeableEntity
-
readAdditionalSaveData
- Overrides:
readAdditionalSaveData
in classAgeableEntity
-
changeDimension
- Overrides:
changeDimension
in classEntity
-
stopTrading
protected void stopTrading() -
die
- Overrides:
die
in classLivingEntity
-
addParticlesAroundSelf
-
canBeLeashed
- Overrides:
canBeLeashed
in classMobEntity
-
getInventory
-
setSlot
-
getLevel
-
updateTrades
protected abstract void updateTrades() -
addOffersFromItemListings
protected void addOffersFromItemListings(MerchantOffers p_213717_1_, VillagerTrades.ITrade[] p_213717_2_, int p_213717_3_) -
getRopeHoldPosition
- Overrides:
getRopeHoldPosition
in classEntity
-