Class NPC
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.pixelmonmod.pixelmon.entities.npcs.NPC
- All Implemented Interfaces:
BoneTransformSupplier,RenderableEntity,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.Targeting,net.minecraft.world.level.entity.EntityAccess,net.minecraft.world.Nameable,net.minecraft.world.scores.ScoreHolder,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IEntityExtension,net.neoforged.neoforge.common.extensions.ILivingEntityExtension,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Entity class for all Pixelmon NPCs
-
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
FieldsModifier and TypeFieldDescriptionprotected Map<ModelData, AnimationVariables> protected NPCPresetprotected UUIDprotected EntityDataSyncManagerstatic final DataSync<NPC, EntityProperties> protected Goalsprotected ResourceWithFallbackprotected InteractionSetprotected net.minecraft.resources.ResourceLocationprotected PartyStorageprotected EntityPropertiesstatic final DataSync<NPC, RenderingHandler> protected RenderingHandlerprotected booleanFields inherited from class net.minecraft.world.entity.PathfinderMob
DEFAULT_WALK_TARGET_VALUEFields inherited from class net.minecraft.world.entity.Mob
ambientSoundTime, armorDropChances, bodyArmorDropChance, DEFAULT_EQUIPMENT_DROP_CHANCE, goalSelector, handDropChances, jumpControl, lookControl, MAX_ENCHANTED_ARMOR_CHANCE, MAX_ENCHANTED_WEAPON_CHANCE, MAX_PICKUP_LOOT_CHANCE, MAX_WEARING_ARMOR_CHANCE, moveControl, navigation, PICKUP_REACH, PRESERVE_ITEM_DROP_CHANCE, PRESERVE_ITEM_DROP_CHANCE_THRESHOLD, RANDOM_SPAWN_BONUS_ID, targetSelector, UPDATE_GOAL_SELECTOR_EVERY_N_TICKS, 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_HEALTH_ID, 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, noJumpDelay, 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, eyeHeight, fallDistance, firstTick, FLAG_FALL_FLYING, FLAG_GLOWING, FLAG_ONFIRE, fluidHeight, flyDist, forgeFluidTypeHeight, FREEZE_HURT_FREQUENCY, hasImpulse, horizontalCollision, hurtMarked, ID_TAG, invulnerableTime, isInPowderSnow, level, mainSupportingBlockPos, MAX_ENTITY_TAG_COUNT, minorHorizontalCollision, moveDist, noCulling, noPhysics, onGround, PASSENGERS_TAG, portalProcess, random, stringUUID, stuckSpeedMultiplier, tickCount, TOTAL_AIR_SUPPLY, uuid, UUID_TAG, verticalCollision, verticalCollisionBelow, walkDist, walkDistO, wasEyeInWater, wasInPowderSnow, wasOnFire, wasTouchingWater, xo, xOld, xRot, xRotO, yo, yOld, yRot, 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
ConstructorsConstructorDescriptionNPC(net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.PathfinderMob> entityType, net.minecraft.world.level.Level level) NPC(net.minecraft.world.level.Level level, NPCBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag tag) voidapplyPreset(NPCPreset preset) Applies the given preset to this NPCvoidbattle(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<BattleRuleSet> battleRules) voidbattle(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<BattleRuleSet> battleRules, BattleAIMode aiMode, boolean canMega, boolean canDynamax) Starts a battle with the given playerprotected net.minecraft.world.entity.ai.Brain.Provider<?> static NPCBuilderbuilder()Creates a new NPC builderbooleancanOpenEditor(net.minecraft.server.level.ServerPlayer player) Checks if the given player can open the NPC editorprotected booleancanRide(@NotNull net.minecraft.world.entity.Entity entity) static NPCBuilderCreates a new NPC builder with the values set to the values from the given NPCstatic net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builderprotected voidprotected <A> voiddefine(net.minecraft.network.syncher.SynchedEntityData.Builder builder, DataSync<?, A> sync, A value) protected voiddefineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) voiddisplayIcon(ResourceWithFallback icon, net.minecraft.server.level.ServerPlayer... players) Sets the icon to display for the given playersgetAnimationVariables(ModelData modelData) net.minecraft.world.entity.ai.Brain<NPC> getBrain()Optional<net.minecraft.server.level.ServerPlayer> Gets the player entity that is currently editing this NPC
This will returnOptional.empty()if no player is editing this NPC or if the last editing user is offlinegetIcon()net.minecraft.resources.ResourceLocationgetModel()getParty()Gets the party storage for this NPCnet.minecraft.world.phys.Vec3getPassengerRidingPosition(net.minecraft.world.entity.Entity p_299288_) net.minecraft.network.chat.ComponentgetTitle()booleanhandleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> interactionEvent, StoredContext context) Checks that the event should be handled by this NPC, then checks against the relevant conditions and then passes the context to the results if the conditions passed.booleanhasEditPermission(net.minecraft.server.level.ServerPlayer player) Checks if the given player has permission to edit NPCs@NotNull net.minecraft.world.InteractionResultinteractAt(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.Vec3 p_19981_, @NotNull net.minecraft.world.InteractionHand hand) booleanisBaby()booleanisCurrentlyEditing(net.minecraft.server.level.ServerPlayer player) Checks if the given player is currently editing this NPCbooleanbooleanbooleanisInvulnerableTo(net.minecraft.world.damagesource.DamageSource damageSource) booleanChecks if this NPC is linked to a presetbooleanvoidlinkToPreset(NPCPreset preset) Links the NPC to the given presetvoidprotected net.minecraft.world.entity.ai.Brain<?> makeBrain(com.mojang.serialization.Dynamic<?> dynamic) voidvoidvoidvoidmove(@NotNull net.minecraft.world.entity.MoverType moverType, @NotNull net.minecraft.world.phys.Vec3 direction) voidSafely moves the NPC to the new position by temporarily making the NPC movablevoidonSyncedDataUpdated(@NotNull net.minecraft.network.syncher.EntityDataAccessor<?> key) voidopenEditor(net.minecraft.server.level.ServerPlayer player) Opens the NPC editor for the given playervoidreadAdditionalSaveData(@NotNull net.minecraft.nbt.CompoundTag tag) voidremove(net.minecraft.world.entity.Entity.RemovalReason removalReason) voidsetChild(boolean child) voidvoidsetCurrentlyEditing(net.minecraft.server.level.ServerPlayer currentlyEditing) Sets the player entity that is currently editing this NPCvoidsetCustomName(@Nullable net.minecraft.network.chat.Component name) voidsetEntityProperties(EntityProperties entityProperties) voidvoidsetImmovable(boolean immovable) voidsetInteractions(InteractionSet interactions) voidsetInvulnerable(boolean invulnerable) voidsetParty(@NotNull PartyStorage party) voidsetRenderingHandler(RenderingHandler renderingHandler) voidtick()voidvoidtrack()Sets the NPC to be trackedvoidUnlinks the NPC from the presetvoiduntrack()Removes the NPC from being trackedMethods 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
aiStep, ate, baseTick, canAttackType, canBeLeashed, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, canUseSlot, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clampHeadRotationToBody, clearRestriction, convertTo, createBodyControl, createMobAttributes, createNavigation, 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, getItemBySlot, getJumpControl, getLeashData, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getNavigation, getPathfindingMalus, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, getTargetFromBrain, handleEntityEvent, hasRestriction, interact, isAggressive, isBodyArmorItem, isEffectiveAi, isLeftHanded, isMaxGroupSizeReached, isNoAi, isPersistenceRequired, isSpawnCancelled, isSunBurnTick, isWearingBodyArmor, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, leashTooFarBehaviour, lookAt, mobInteract, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playAttackSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, removeWhenFarAway, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBaby, setBodyArmorItem, setCanPickUpLoot, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashData, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, stopInPlace, tickHeadTurn, updateControlFlags, wantsToPickUpMethods inherited from class net.minecraft.world.entity.LivingEntity
activeLocationDependentEnchantments, actuallyHurt, addEffect, addEffect, animateHurt, areAllEffectsAmbient, attackable, blockedByShield, blockUsingShield, calculateEntityAnimation, calculateFallDamage, canAttack, canAttack, canBeAffected, canBeSeenAsEnemy, canBeSeenByAnyone, canBreatheUnderwater, canDisableShield, canFreeze, canStandOnFluid, canUsePortal, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, decreaseAirSupply, die, doAutoAttackOnTouch, doesEmitEquipEvent, doHurtEquipment, doPush, dropAllDeathLoot, dropEquipment, dropExperience, eat, eat, equipmentHasChanged, forceAddEffect, getAbsorptionAmount, getActiveEffects, getActiveEffectsMap, getAgeScale, getAllSlots, getArmorCoverPercentage, getArmorValue, getArrowCount, getAttackAnim, getAttribute, getAttributeBaseValue, getAttributes, getAttributeValue, getBedOrientation, getBlockSpeedFactor, getBoundingBoxForCulling, getCombatTracker, getComfortableFallDistance, getCurrentSwingDuration, getDamageAfterArmorAbsorb, getDamageAfterMagicAbsorb, getDeathSound, getDefaultDimensions, getDefaultGravity, getDimensions, getDismountPoses, getDrinkingSound, getEatingSound, getEffect, getEquipmentSlotForItem, getExperienceReward, getFallDamageSound, 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, getPreciseBodyRotation, getProjectile, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSlotForHand, getSoundVolume, getSpeed, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getWeaponItem, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasInfiniteMaterials, hasItemInSlot, hasLandedInLiquid, hasLineOfSight, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, igniteForTicks, increaseAirSupply, indicateDamage, internalSetAbsorptionAmount, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeSound, maxUpStep, onBelowWorld, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onEquippedItemBroken, onItemPickup, onLeaveCombat, playBlockFallSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeEffectsCuredBy, removeFrost, 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, travelRidden, triggerItemUseEffects, triggerOnDeathMobEffects, tryAddFrost, updateEffectVisibility, updateFallFlying, 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, canSpawnSprintParticle, canSprint, canTrample, captureDrops, captureDrops, changeDimension, 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, equals, 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, getDisplayName, 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, getMaxAirSupply, getMaxHeightFluidType, getMotionDirection, getMovementEmission, getName, getNearestViewDirection, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, getPercentFrozen, getPermissionLevel, getPersistentData, getPickRadius, getPistonPushReaction, getPortalCooldown, getPose, getPosition, getPositionCodec, getPrimaryStepSoundBlockPos, getRandom, getRandomX, getRandomY, getRandomZ, getRemainingFireTicks, getRemovalReason, getRootVehicle, getRopeHoldPosition, getRotationVector, getScoreboardName, getSelfAndPassengers, getServer, getSharedFlag, getSoundSource, getStringUUID, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTags, getTeam, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getVehicleAttachmentPoint, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handlePortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, igniteForSeconds, ignoreExplosion, is, isAddedToLevel, isAlliedTo, isAlliedTo, isAlwaysTicking, isAttackable, isColliding, isControlledByLocalInstance, isCrouching, isCustomNameVisible, isDescending, isDiscrete, isEyeInFluid, isFlapping, isFree, isFreezing, isFullyFrozen, isHorizontalCollisionMinor, isIgnoringBlockTriggers, isInFluidType, isInFluidType, isInLava, isInLiquid, isInvisible, isInvisibleTo, isInWater, isInWaterOrBubble, isInWaterOrRain, isInWaterRainOrBubble, isNoGravity, isOnFire, isOnPortalCooldown, isOnRails, isPassenger, isPassengerOfSameVehicle, isPushedByFluid, isRemoved, isShiftKeyDown, isSilent, isSpectator, isSprinting, isSteppingCarefully, isSupportedBy, isSuppressingBounce, isSwimming, isUnderWater, isVehicle, isVisuallyCrawling, killedEntity, lavaHurt, lerpMotion, lerpPositionAndRotationStep, level, limitPistonMovement, load, makeBoundingBox, makeStuckInBlock, markHurt, maybeBackOffFromEdge, mayInteract, mirror, moveRelative, moveTo, moveTo, moveTo, moveTo, moveTo, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToLevel, onClientRemoval, onExplosionHit, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, 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, setIsInPowderSnow, setLevel, setLevelCallback, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSharedFlag, setSharedFlagOnFire, setShiftKeyDown, setSilent, setSwimming, setTicksFrozen, setUUID, setViewScale, setXRot, setYRot, shouldBeSaved, shouldBlockExplode, shouldInformAdmins, shouldRender, shouldRenderAtSqrDistance, showVehicleHealth, skipAttackInteraction, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnAtLocation, spawnSprintParticle, startRiding, startSeenByPlayer, stopSeenByPlayer, syncPacketPositionCodec, teleportRelative, teleportTo, teleportTo, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSoundMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, 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, getExistingData, getExistingDataOrNull, 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 net.neoforged.neoforge.common.extensions.ILivingEntityExtension
canDrownInFluidType, canSwimInFluidType, moveInFluid, onDamageTaken, self, sinkInFluidMethods inherited from interface net.minecraft.world.entity.Leashable
canHaveALeashAttachedToIt, elasticRangeLeashBehaviour, getLeashHolder, isLeashed, mayBeLeashed, readLeashData, setDelayedLeashHolderId, setLeashedTo, writeLeashDataMethods inherited from interface com.pixelmonmod.pixelmon.client.render.entity.renderers.entity.RenderableEntity
animationTime, boneTransforms, getAnimation, isDisableTexture, isFullbright, isOverlay, isWireFrameMethods inherited from interface net.minecraft.world.scores.ScoreHolder
getFeedbackDisplayName
-
Field Details
-
RENDERING_HANDLER_SYNC
-
ENTITY_PROPERTIES_SYNC
-
LINKED_PRESET_SYNC
-
renderingHandler
-
interactions
-
properties
-
dataSyncManager
-
animationVariables
-
currentlyEditing
-
tracked
protected boolean tracked -
linkedPreset
protected net.minecraft.resources.ResourceLocation linkedPreset -
cachedLinkedPreset
-
icon
-
party
-
goals
-
-
Constructor Details
-
NPC
public NPC(net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.PathfinderMob> entityType, net.minecraft.world.level.Level level) -
NPC
-
-
Method Details
-
defineSynchedData
protected void defineSynchedData(net.minecraft.network.syncher.SynchedEntityData.Builder builder) - Overrides:
defineSynchedDatain classnet.minecraft.world.entity.Mob
-
brainProvider
protected net.minecraft.world.entity.ai.Brain.Provider<?> brainProvider()- Overrides:
brainProviderin classnet.minecraft.world.entity.LivingEntity
-
makeBrain
protected net.minecraft.world.entity.ai.Brain<?> makeBrain(com.mojang.serialization.Dynamic<?> dynamic) - Overrides:
makeBrainin classnet.minecraft.world.entity.LivingEntity
-
define
protected <A> void define(net.minecraft.network.syncher.SynchedEntityData.Builder builder, DataSync<?, A> sync, A value) -
tick
public void tick()- Overrides:
tickin classnet.minecraft.world.entity.Mob
-
customServerAiStep
protected void customServerAiStep()- Overrides:
customServerAiStepin classnet.minecraft.world.entity.Mob
-
getBrain
- Overrides:
getBrainin classnet.minecraft.world.entity.LivingEntity
-
canRide
protected boolean canRide(@NotNull @NotNull net.minecraft.world.entity.Entity entity) - Overrides:
canRidein classnet.minecraft.world.entity.Entity
-
isPushable
public boolean isPushable()- Overrides:
isPushablein classnet.minecraft.world.entity.LivingEntity
-
readAdditionalSaveData
public void readAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Overrides:
readAdditionalSaveDatain classnet.minecraft.world.entity.Mob
-
addAdditionalSaveData
public void addAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Overrides:
addAdditionalSaveDatain classnet.minecraft.world.entity.Mob
-
setCustomName
public void setCustomName(@Nullable @Nullable net.minecraft.network.chat.Component name) - Overrides:
setCustomNamein classnet.minecraft.world.entity.Entity
-
interactAt
@NotNull public @NotNull net.minecraft.world.InteractionResult interactAt(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.Vec3 p_19981_, @NotNull @NotNull net.minecraft.world.InteractionHand hand) - Overrides:
interactAtin classnet.minecraft.world.entity.Entity
-
canOpenEditor
public boolean canOpenEditor(net.minecraft.server.level.ServerPlayer player) Checks if the given player can open the NPC editor- Parameters:
player- The player to check- Returns:
- True if the player can open the editor
-
hasEditPermission
public boolean hasEditPermission(net.minecraft.server.level.ServerPlayer player) Checks if the given player has permission to edit NPCs- Parameters:
player- The player to check- Returns:
- True if the player has permission to edit NPCs
-
openEditor
public void openEditor(net.minecraft.server.level.ServerPlayer player) Opens the NPC editor for the given player- Parameters:
player- The player to open the editor for
-
getCurrentlyEditing
Gets the player entity that is currently editing this NPC
This will returnOptional.empty()if no player is editing this NPC or if the last editing user is offline- Returns:
- The player editing this NPC
-
setCurrentlyEditing
public void setCurrentlyEditing(net.minecraft.server.level.ServerPlayer currentlyEditing) Sets the player entity that is currently editing this NPC- Parameters:
currentlyEditing- The player currently editing this NPC
-
isCurrentlyEditing
public boolean isCurrentlyEditing(net.minecraft.server.level.ServerPlayer player) Checks if the given player is currently editing this NPC- Parameters:
player- The player to check- Returns:
- True if the player is currently editing this NPC
-
handleInteractionEvent
public boolean handleInteractionEvent(net.minecraft.core.Holder<InteractionEvent> interactionEvent, StoredContext context) Checks that the event should be handled by this NPC, then checks against the relevant conditions and then passes the context to the results if the conditions passed.- Parameters:
interactionEvent- The event that triggered this callcontext- The context for the event- Returns:
- True if the event was a success, the conditions passed, and the results were fired
-
getParty
Gets the party storage for this NPC- Returns:
- The party storage
-
battle
public void battle(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<BattleRuleSet> battleRules) -
battle
public void battle(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.Holder<BattleRuleSet> battleRules, BattleAIMode aiMode, boolean canMega, boolean canDynamax) Starts a battle with the given player- Parameters:
player- The player to battle
-
getRenderingHandler
-
isBaby
public boolean isBaby()- Overrides:
isBabyin classnet.minecraft.world.entity.LivingEntity
-
isInvulnerableTo
public boolean isInvulnerableTo(net.minecraft.world.damagesource.DamageSource damageSource) - Overrides:
isInvulnerableToin classnet.minecraft.world.entity.LivingEntity
-
isInvulnerable
public boolean isInvulnerable()- Overrides:
isInvulnerablein classnet.minecraft.world.entity.Entity
-
getInteractions
-
setInteractions
-
isImmovable
public boolean isImmovable() -
applyPreset
Applies the given preset to this NPC- Parameters:
preset- The preset to apply
-
move
public void move(@NotNull @NotNull net.minecraft.world.entity.MoverType moverType, @NotNull @NotNull net.minecraft.world.phys.Vec3 direction) - Overrides:
movein classnet.minecraft.world.entity.Entity
-
setInvulnerable
public void setInvulnerable(boolean invulnerable) - Overrides:
setInvulnerablein classnet.minecraft.world.entity.Entity
-
onSyncedDataUpdated
public void onSyncedDataUpdated(@NotNull @NotNull net.minecraft.network.syncher.EntityDataAccessor<?> key) - Specified by:
onSyncedDataUpdatedin interfacenet.minecraft.network.syncher.SyncedDataHolder- Overrides:
onSyncedDataUpdatedin classnet.minecraft.world.entity.LivingEntity
-
getPassengerRidingPosition
public net.minecraft.world.phys.Vec3 getPassengerRidingPosition(net.minecraft.world.entity.Entity p_299288_) - Overrides:
getPassengerRidingPositionin classnet.minecraft.world.entity.LivingEntity
-
getLinkedPresetKey
public net.minecraft.resources.ResourceLocation getLinkedPresetKey() -
isLinkedToPreset
public boolean isLinkedToPreset()Checks if this NPC is linked to a preset- Returns:
- True if this NPC is linked to a preset
-
linkToPreset
Links the NPC to the given preset- Parameters:
preset- The preset to link to
-
unlinkFromPreset
public void unlinkFromPreset()Unlinks the NPC from the preset -
setChild
public void setChild(boolean child) -
makeChild
public void makeChild() -
makeAdult
public void makeAdult() -
track
public void track()Sets the NPC to be tracked -
untrack
public void untrack()Removes the NPC from being tracked -
moveNPC
Safely moves the NPC to the new position by temporarily making the NPC movable- Parameters:
runnable- The move code to execute
-
setImmovable
public void setImmovable(boolean immovable) -
makeMovable
public void makeMovable() -
makeImmovable
public void makeImmovable() -
setRenderingHandler
-
setEntityProperties
-
setParty
-
setGoals
-
getIcon
-
getTitle
public net.minecraft.network.chat.Component getTitle() -
displayIcon
public void displayIcon(ResourceWithFallback icon, net.minecraft.server.level.ServerPlayer... players) Sets the icon to display for the given players- Parameters:
icon- The icon to displayplayers- The players to display the icon to
-
setClientIcon
-
getAnimationVariables
- Specified by:
getAnimationVariablesin interfaceRenderableEntity
-
getModel
- Specified by:
getModelin interfaceRenderableEntity
-
tickAnimation
public void tickAnimation()- Specified by:
tickAnimationin interfaceRenderableEntity
-
getProperties
-
remove
public void remove(@NotNull net.minecraft.world.entity.Entity.RemovalReason removalReason) - Overrides:
removein classnet.minecraft.world.entity.LivingEntity
-
createAttributes
public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder createAttributes() -
copy
Creates a new NPC builder with the values set to the values from the given NPC- Parameters:
npc- The NPC to copy- Returns:
- The new NPC builder
-
builder
Creates a new NPC builder- Returns:
- The new NPC builder
-