public class NPCChatting extends IndexedNPCEntity implements net.minecraft.entity.merchant.IMerchant
Modifier and Type | Field and Description |
---|---|
protected EnumNPCType |
npcType |
protected net.minecraft.item.MerchantOffers |
offers |
chatIndex, nameIndex, npcIndex
dataSyncManager, despawnCounter, interactCommands, intMaxTicksToDespawn, intMinTicksToDespawn, npcLocation, ONE, SMALLER, SYNC_CUSTOM_STEVE_TEXTURE, SYNC_MODEL, SYNC_NAME, SYNC_NICKNAME, SYNC_PROFESSION, SYNC_TEXTURE_INDEX, TICKSPERSECOND, trainer
ambientSoundTime, armorDropChances, goalSelector, handDropChances, jumpControl, lookControl, moveControl, navigation, targetSelector, xpReward
animationPosition, animationSpeed, animationSpeedOld, animStep, animStepO, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_HEALTH_ID, 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, noJumpDelay, oAttackAnim, oRun, removeArrowTime, removeStingerTime, rotA, rotOffs, run, SLEEPING_DIMENSIONS, swinging, swingingArm, swingTime, timeOffs, useItem, useItemRemaining, xxa, yBodyRot, yBodyRotO, yHeadRot, yHeadRotO, yya, zza
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, type, uuid, verticalCollision, walkDist, walkDistO, wasEyeInWater, wasTouchingWater, xChunk, xo, xOld, xRot, xRotO, yChunk, yo, yOld, yRot, yRotO, zChunk, zo, zOld
Constructor and Description |
---|
NPCChatting(net.minecraft.entity.EntityType<? extends NPCChatting> type,
net.minecraft.world.World world)
Initializes a chatting NPC.
|
NPCChatting(net.minecraft.world.World world) |
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt) |
protected void |
addOffersFromItemListings(net.minecraft.item.MerchantOffers p_213717_1_,
net.minecraft.entity.merchant.villager.VillagerTrades.ITrade[] p_213717_2_,
int amountOfItemsToAdd) |
protected void |
addParticlesAroundSelf(net.minecraft.particles.IParticleData p_213718_1_) |
net.minecraft.entity.Entity |
changeDimension(net.minecraft.world.server.ServerWorld p_241206_1_,
net.minecraftforge.common.util.ITeleporter teleporter) |
void |
cycleTexture(net.minecraft.entity.player.ServerPlayerEntity p,
ClientNPCData newData)
Changes the chatting NPC's type.
|
void |
die(net.minecraft.util.DamageSource p_70645_1_) |
double |
getAttributeValue(net.minecraft.entity.ai.attributes.Attribute attribute) |
java.util.ArrayList<java.lang.String> |
getChat(java.lang.String langCode)
Gets the translated trainer's chat.
|
java.lang.String |
getDisplayText()
Gets the text that displays above the NPC.
|
net.minecraft.inventory.Inventory |
getInventory() |
net.minecraft.world.World |
getLevel() |
java.lang.String |
getName(java.lang.String langCode)
Gets the translated trainer's name.
|
net.minecraft.util.SoundEvent |
getNotifyTradeSound() |
net.minecraft.item.MerchantOffers |
getOffers() |
java.lang.String |
getTexture()
Gets the NPC's texture.
|
protected net.minecraft.util.SoundEvent |
getTradeUpdatedSound(boolean p_213721_1_) |
net.minecraft.entity.player.PlayerEntity |
getTradingPlayer() |
int |
getVillagerXp() |
void |
init(GeneralNPCData data)
Initializes the chatting NPC from JSON data.
|
void |
init(GymNPCData data) |
void |
init(java.lang.String name)
Initializes the NPC with its name and health.
|
boolean |
interactWithNPC(net.minecraft.entity.player.PlayerEntity player,
net.minecraft.util.Hand hand)
Handles a player interacting with the NPC.
|
boolean |
isPushable() |
boolean |
isTrading() |
void |
notifyTrade(net.minecraft.item.MerchantOffer p_213704_1_) |
void |
notifyTradeUpdated(net.minecraft.item.ItemStack p_110297_1_) |
void |
overrideOffers(net.minecraft.item.MerchantOffers p_213703_1_) |
void |
overrideXp(int p_213702_1_) |
void |
playCelebrateSound() |
void |
push(double par1,
double par3,
double par5) |
void |
readAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt) |
protected void |
rewardTradeXp(net.minecraft.item.MerchantOffer p_213713_1_) |
void |
setChat(java.util.ArrayList<java.lang.String> pages)
Sets the dialogue of the chatting NPC.
|
void |
setName(java.lang.String name)
Sets the NPC's name.
|
boolean |
setSlot(int p_174820_1_,
net.minecraft.item.ItemStack p_174820_2_) |
void |
setTradingPlayer(net.minecraft.entity.player.PlayerEntity p_70932_1_) |
boolean |
showProgressBar() |
boolean |
startTradingWith(net.minecraft.entity.player.PlayerEntity player) |
protected void |
stopTrading() |
protected void |
updateTrades() |
canBeRiddenInWater, canRiderInteract, getCapability, getClassification, getEntity, getParts, getPickedResult, isMultipartEntity, shouldRiderSit
bindTexture, canBeLeashed, checkForRarityDespawn, checkSpawnRules, customServerAiStep, define, defineSynchedData, getAIMode, getBaseTrainer, getBossTier, getCustomSteveTexture, getMaxSpawnClusterSize, getModelScale, getName, getNickName, getNPCID, getNPCInventory, getProfession, getSubTitleText, getTextureIndex, hasItemToPlant, hurt, initAI, initDefaultAI, initVilagerAI, initWanderingAI, interactAt, isFarmItemInInventory, locateNPCClient, locateNPCServer, locateNPCServer, onSyncedDataUpdated, pickUpItem, playersNearby, removeWhenFarAway, save, setAIMode, setBaseTrainer, setCustomSteveTexture, setNickName, setProfession, setTextureIndex, shouldSave, tick, unloadEntity
followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPathFinding, onLeashDistance, tickLeash
aiStep, ate, baseTick, canAttack, canAttackType, canBeControlledByRider, canCutCorner, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkAndHandleImportantInteractions, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, convertTo, createBodyControl, createLootContext, createMobAttributes, createNavigation, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getEquipmentSlotForItem, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, 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, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBaby, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tickHeadTurn, updateControlFlags, wantsToPickUp
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, 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, getStandingEyeHeight, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, heal, hurtArmor, hurtCurrentlyUsedShield, increaseAirSupply, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBaby, isBlocking, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, 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, updateFallFlying, updateInvisibilityStatus, updateSwingTime
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, getOnPos, getPacketCoordinates, getPassengers, getPassengersRidingOffset, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalWaitTime, getPose, getPosition, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRootVehicle, getRopeHoldPosition, 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, 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, reapplyPosition, refreshDimensions, remove, remove, removePassenger, removeTag, removeVehicle, repositionEntityAfterLoad, resetPos, restoreFrom, revive, rotate, 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
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, reviveCaps, serializeCaps
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
protected EnumNPCType npcType
protected net.minecraft.item.MerchantOffers offers
public NPCChatting(net.minecraft.entity.EntityType<? extends NPCChatting> type, net.minecraft.world.World world)
world
- The world to spawn the chatting NPC in.public NPCChatting(net.minecraft.world.World world)
public void init(GeneralNPCData data)
data
- The data to initialize the chatting NPC from.public void init(GymNPCData data)
public void init(java.lang.String name)
NPCEntity
public boolean isPushable()
isPushable
in class NPCEntity
public java.lang.String getTexture()
NPCEntity
getTexture
in class IndexedNPCEntity
public java.lang.String getDisplayText()
NPCEntity
getDisplayText
in class IndexedNPCEntity
public void push(double par1, double par3, double par5)
push
in class IndexedNPCEntity
public void addAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt)
addAdditionalSaveData
in class IndexedNPCEntity
public void readAdditionalSaveData(net.minecraft.nbt.CompoundNBT nbt)
readAdditionalSaveData
in class IndexedNPCEntity
public boolean interactWithNPC(net.minecraft.entity.player.PlayerEntity player, net.minecraft.util.Hand hand)
NPCEntity
interactWithNPC
in class IndexedNPCEntity
player
- The player interacting with the NPC.public java.util.ArrayList<java.lang.String> getChat(java.lang.String langCode)
getChat
in class IndexedNPCEntity
langCode
- The langCode for translation.public java.lang.String getName(java.lang.String langCode)
getName
in class IndexedNPCEntity
langCode
- The langCode for translation.public void setChat(java.util.ArrayList<java.lang.String> pages)
pages
- The updated chatting NPC dialogue.public void setName(java.lang.String name)
NPCEntity
public void cycleTexture(net.minecraft.entity.player.ServerPlayerEntity p, ClientNPCData newData)
p
- The player editing the chatting NPC.public double getAttributeValue(net.minecraft.entity.ai.attributes.Attribute attribute)
getAttributeValue
in class net.minecraft.entity.LivingEntity
public int getVillagerXp()
getVillagerXp
in interface net.minecraft.entity.merchant.IMerchant
public void setTradingPlayer(@Nullable net.minecraft.entity.player.PlayerEntity p_70932_1_)
setTradingPlayer
in interface net.minecraft.entity.merchant.IMerchant
@Nullable public net.minecraft.entity.player.PlayerEntity getTradingPlayer()
getTradingPlayer
in interface net.minecraft.entity.merchant.IMerchant
public boolean isTrading()
public net.minecraft.item.MerchantOffers getOffers()
getOffers
in interface net.minecraft.entity.merchant.IMerchant
public void overrideOffers(@Nullable net.minecraft.item.MerchantOffers p_213703_1_)
overrideOffers
in interface net.minecraft.entity.merchant.IMerchant
public void overrideXp(int p_213702_1_)
overrideXp
in interface net.minecraft.entity.merchant.IMerchant
public void notifyTrade(net.minecraft.item.MerchantOffer p_213704_1_)
notifyTrade
in interface net.minecraft.entity.merchant.IMerchant
protected void rewardTradeXp(net.minecraft.item.MerchantOffer p_213713_1_)
public boolean showProgressBar()
showProgressBar
in interface net.minecraft.entity.merchant.IMerchant
public void notifyTradeUpdated(net.minecraft.item.ItemStack p_110297_1_)
notifyTradeUpdated
in interface net.minecraft.entity.merchant.IMerchant
public net.minecraft.util.SoundEvent getNotifyTradeSound()
getNotifyTradeSound
in interface net.minecraft.entity.merchant.IMerchant
protected net.minecraft.util.SoundEvent getTradeUpdatedSound(boolean p_213721_1_)
public void playCelebrateSound()
@Nullable public net.minecraft.entity.Entity changeDimension(net.minecraft.world.server.ServerWorld p_241206_1_, net.minecraftforge.common.util.ITeleporter teleporter)
changeDimension
in class net.minecraft.entity.Entity
protected void stopTrading()
public void die(net.minecraft.util.DamageSource p_70645_1_)
die
in class net.minecraft.entity.LivingEntity
protected void addParticlesAroundSelf(net.minecraft.particles.IParticleData p_213718_1_)
public net.minecraft.inventory.Inventory getInventory()
public boolean setSlot(int p_174820_1_, net.minecraft.item.ItemStack p_174820_2_)
protected void updateTrades()
protected void addOffersFromItemListings(net.minecraft.item.MerchantOffers p_213717_1_, net.minecraft.entity.merchant.villager.VillagerTrades.ITrade[] p_213717_2_, int amountOfItemsToAdd)
public boolean startTradingWith(net.minecraft.entity.player.PlayerEntity player)
public net.minecraft.world.World getLevel()
getLevel
in interface net.minecraft.entity.merchant.IMerchant