Class NPC
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.pixelmonmod.pixelmon.entities.npcs.NPC
- All Implemented Interfaces:
RenderableEntity
,net.minecraft.commands.CommandSource
,net.minecraft.world.entity.Attackable
,net.minecraft.world.entity.Targeting
,net.minecraft.world.level.entity.EntityAccess
,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>
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.Fallsounds
Nested 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.RemovalReason
Nested 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
Modifier and TypeFieldDescriptionprotected Map<ModelData,
AnimationVariables> protected NPCPreset
protected UUID
protected EntityDataSyncManager
static final DataSync<NPC,
EntityProperties> protected ResourceWithFallback
protected InteractionSet
protected net.minecraft.resources.ResourceLocation
protected PartyStorage
protected EntityProperties
static final DataSync<NPC,
RenderingHandler> protected RenderingHandler
protected boolean
Fields inherited from class net.minecraft.world.entity.PathfinderMob
DEFAULT_WALK_TARGET_VALUE
Fields 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, xpReward
Fields inherited from class net.minecraft.world.entity.LivingEntity
animStep, animStepO, ARMOR_SLOT_OFFSET, ARMOR_SLOTS, attackAnim, attackStrengthTicker, autoSpinAttackTicks, brain, DATA_HEALTH_ID, 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, 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, zza
Fields 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, onGround, PASSENGERS_TAG, portalEntrancePos, portalTime, 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, zOld
Fields inherited from interface net.minecraft.commands.CommandSource
NULL
-
Constructor Summary
ConstructorDescriptionNPC
(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 TypeMethodDescriptionvoid
addAdditionalSaveData
(@NotNull net.minecraft.nbt.CompoundTag tag) void
applyPreset
(NPCPreset preset) Applies the given preset to this NPCvoid
battle
(net.minecraft.server.level.ServerPlayer player) Starts a battle with the given playerstatic NPCBuilder
builder()
Creates a new NPC builderboolean
canOpenEditor
(net.minecraft.server.level.ServerPlayer player) Checks if the given player can open the NPC editorprotected boolean
canRide
(@NotNull net.minecraft.world.entity.Entity entity) @NotNull net.minecraft.world.InteractionResult
checkAndHandleImportantInteractions
(net.minecraft.world.entity.player.Player player, @NotNull net.minecraft.world.InteractionHand hand) static NPCBuilder
Creates a new NPC builder with the values set to the values from the given NPCstatic net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder
protected <A> void
protected void
void
displayIcon
(ResourceWithFallback icon, net.minecraft.server.level.ServerPlayer... players) Sets the icon to display for the given playersgetAnimationVariables
(ModelData modelData) 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.ResourceLocation
getParty()
Gets the party storage for this NPCboolean
handleInteractionEvent
(InteractionEvent interactionEvent, InteractionContext 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.boolean
hasEditPermission
(net.minecraft.server.level.ServerPlayer player) Checks if the given player has permission to edit NPCsboolean
isBaby()
boolean
isCurrentlyEditing
(net.minecraft.server.level.ServerPlayer player) Checks if the given player is currently editing this NPCboolean
boolean
boolean
isInvulnerableTo
(net.minecraft.world.damagesource.DamageSource damageSource) boolean
Checks if this NPC is linked to a presetboolean
void
linkToPreset
(NPCPreset preset) Links the NPC to the given presetvoid
void
void
void
void
move
(@NotNull net.minecraft.world.entity.MoverType moverType, @NotNull net.minecraft.world.phys.Vec3 direction) void
Safely moves the NPC to the new position by temporarily making the NPC movablevoid
onSyncedDataUpdated
(@NotNull net.minecraft.network.syncher.EntityDataAccessor<?> key) void
openEditor
(net.minecraft.server.level.ServerPlayer player) Opens the NPC editor for the given playervoid
readAdditionalSaveData
(@NotNull net.minecraft.nbt.CompoundTag tag) void
remove
(net.minecraft.world.entity.Entity.RemovalReason removalReason) protected float
ridingOffset
(@NotNull net.minecraft.world.entity.Entity rider) void
setChild
(boolean child) void
void
setCurrentlyEditing
(net.minecraft.server.level.ServerPlayer currentlyEditing) Sets the player entity that is currently editing this NPCvoid
setCustomName
(@Nullable net.minecraft.network.chat.Component name) void
setEntityProperties
(EntityProperties entityProperties) void
setImmovable
(boolean immovable) void
setInteractions
(InteractionSet interactions) void
setInvulnerable
(boolean invulnerable) void
setParty
(@NotNull PartyStorage party) void
setRenderingHandler
(RenderingHandler renderingHandler) void
tick()
void
track()
Sets the NPC to be trackedvoid
Unlinks the NPC from the presetvoid
untrack()
Removes the NPC from being trackedMethods inherited from class net.minecraft.world.entity.PathfinderMob
checkSpawnRules, followLeashSpeed, getWalkTargetValue, getWalkTargetValue, isPanicking, isPathFinding, onLeashDistance, shouldStayCloseToLeashHolder, tickLeash
Methods inherited from class net.minecraft.world.entity.Mob
aiStep, ate, baseTick, canAttackType, canBeLeashed, canFireProjectileWeapon, canHoldItem, canPickUpLoot, canReplaceCurrentItem, canReplaceEqualItem, canTakeItem, checkDespawn, checkMobSpawnRules, checkSpawnObstruction, clearRestriction, convertTo, createBodyControl, createMobAttributes, createNavigation, customServerAiStep, doHurtTarget, dropCustomDeathLoot, dropFromLootTable, dropLeash, enchantSpawnedArmor, enchantSpawnedWeapon, equipItemIfPossible, finalizeSpawn, getAmbientSound, getAmbientSoundInterval, getArmorSlots, getAttackBoundingBox, getControllingPassenger, getDefaultLootTable, getEquipmentDropChance, getEquipmentForSlot, getExperienceReward, getHandSlots, getHeadRotSpeed, getItemBySlot, getJumpControl, getLeashHolder, getLookControl, getLootTable, getLootTableSeed, getMainArm, getMaxFallDistance, getMaxHeadXRot, getMaxHeadYRot, getMaxSpawnClusterSize, getMoveControl, getNavigation, getPathfindingMalus, getPickResult, getPickupReach, getRestrictCenter, getRestrictRadius, getSensing, getSpawnType, getTarget, handleEntityEvent, hasRestriction, interact, isAggressive, isEffectiveAi, isLeashed, isLeftHanded, isMaxGroupSizeReached, isNoAi, isSpawnCancelled, isSunBurnTick, isWithinMeleeAttackRange, isWithinRestriction, isWithinRestriction, jumpInFluid, jumpInLiquid, lookAt, mobInteract, onOffspringSpawnedFromEgg, onPathfindingDone, onPathfindingStart, pickUpItem, playAmbientSound, playHurtSound, populateDefaultEquipmentEnchantments, populateDefaultEquipmentSlots, registerGoals, removeAfterChangingDimensions, removeAllGoals, removeFreeWill, removeWhenFarAway, requiresCustomPersistence, restrictTo, sendDebugPackets, serverAiStep, setAggressive, setBaby, setCanPickUpLoot, setDelayedLeashHolderId, setDropChance, setGuaranteedDrop, setItemSlot, setItemSlotAndDropWhenKilled, setLeashedTo, setLeftHanded, setNoAi, setPathfindingMalus, setPersistenceRequired, setSpawnCancelled, setSpeed, setTarget, setXxa, setYya, setZza, shouldDespawnInPeaceful, shouldPassengersInheritMalus, spawnAnim, startRiding, tickHeadTurn, updateControlFlags, wantsToPickUp
Methods 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, canChangeDimensions, canDisableShield, canFreeze, canSpawnSoulSpeedParticle, canStandOnFluid, causeFallDamage, checkAutoSpinAttack, checkFallDamage, clearSleepingPos, completeUsingItem, createLivingAttributes, createWitherRose, curePotionEffects, decreaseAirSupply, 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, getFallDamageSound, getFallFlyingTicks, getFallSounds, getFluidFallingAdjustedMovement, getFlyingSpeed, getHealth, getHitbox, getHurtDir, getHurtSound, getItemInHand, getJumpBoostPower, getJumpPower, getKillCredit, getLastAttacker, getLastClimbablePos, getLastDamageSource, getLastHurtByMob, getLastHurtByMobTimestamp, getLastHurtMob, getLastHurtMobTimestamp, getLocalBoundsForPose, getMainHandItem, getMaxAbsorption, getMaxHealth, getMobType, getMyRidingOffset, getNoActionTime, getOffhandItem, getPassengerRidingPosition, getProjectile, getRandom, getRelativePortalPosition, getRiddenInput, getRiddenSpeed, getScale, getSleepingPos, getSlot, getSoundVolume, getSpeed, getStandingEyeHeight, getStingerCount, getSwimAmount, getTicksUsingItem, getUsedItemHand, getUseItem, getUseItemRemainingTicks, getViewYRot, getVisibilityPercent, getVisualRotationYInDegrees, getVoicePitch, getWaterSlowDown, getYHeadRot, goDownInWater, handleDamageEvent, handleRelativeFrictionAndCalculateMovement, hasEffect, hasItemInSlot, hasLineOfSight, heal, hurt, hurtArmor, hurtCurrentlyUsedShield, hurtHelmet, increaseAirSupply, indicateDamage, internalSetAbsorptionAmount, invalidateCaps, isAffectedByFluids, isAffectedByPotions, isAlive, isAlwaysExperienceDropper, isAutoSpinAttack, isBlocking, isCurrentlyGlowing, isDamageSourceBlocked, isDeadOrDying, isFallFlying, isHolding, isHolding, isImmobile, isInvertedHealAndHarm, isInWall, isPickable, isPushable, isSensitiveToWater, isSleeping, isSuppressingSlidingDownLadder, isUsingItem, isVisuallySwimming, jumpFromGround, kill, knockback, lerpHeadRotationStep, lerpHeadTo, lerpTargetX, lerpTargetXRot, lerpTargetY, lerpTargetYRot, lerpTargetZ, lerpTo, lookAt, makeBrain, maxUpStep, onBelowWorld, onChangedBlock, onClimbable, onEffectAdded, onEffectRemoved, onEffectUpdated, onEnterCombat, onEquipItem, onItemPickup, onLeaveCombat, onSoulSpeedBlock, playBlockFallSound, push, pushEntities, randomTeleport, recreateFromPacket, releaseUsingItem, removeAllEffects, removeEffect, removeEffectNoUpdate, removeEffectParticles, removeFrost, removeSoulSpeed, 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, travelRidden, triggerItemUseEffects, tryAddFrost, tryAddSoulSpeed, updateEffectVisibility, updateFallFlying, updateInvisibilityStatus, updateSwingTime, updateUsingItem, updateWalkAnimation, verifyEquippedItem, wasExperienceConsumed, wouldNotSuffocateAtTargetPose
Methods inherited from class net.minecraft.world.entity.Entity
absMoveTo, absMoveTo, acceptsFailure, acceptsSuccess, addDeltaMovement, addPassenger, addTag, awardKillScore, blockPosition, broadcastToPlayer, calculateUpVector, calculateViewVector, canAddPassenger, canBeCollidedWith, canBeHitByProjectile, canCollideWith, canControlVehicle, canSpawnSprintParticle, canSprint, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, changeDimension, changeDimension, checkBelowWorld, checkInsideBlocks, checkSlowFallDistance, checkSupportingBlock, chunkPosition, clearFire, closerThan, closerThan, 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, getCollisionHorizontalEscapeVector, getCommandSenderWorld, getControlledVehicle, getCustomName, getDeltaMovement, getDimensionChangingDelay, getDimensionsForge, getDirection, getDismountLocationForPassenger, getDisplayName, 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, getName, getNameTagOffsetY, getOnPos, getOnPos, getOnPosLegacy, getPassengerAttachmentPoint, getPassengers, getPassengersAndSelf, 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, getTeamColor, getTicksFrozen, getTicksRequiredToFreeze, getType, getTypeName, getUpVector, getUUID, getVehicle, getViewScale, getViewVector, getViewXRot, getX, getX, getXRot, getY, getY, getYRot, getZ, getZ, handleInsidePortal, handleNetherPortal, hasControllingPassenger, hasCustomName, hasExactlyOnePlayerPassenger, hasGlowingTag, hashCode, hasIndirectPassenger, hasPassenger, hasPassenger, hasPermissions, hasPose, ignoreExplosion, interactAt, is, isAddedToWorld, 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, moveTowardsClosestSpace, newDoubleList, newFloatList, nextStep, onAboveBubbleCol, onAddedToWorld, onClientRemoval, onFlap, onGround, onInsideBlock, onInsideBubbleColumn, 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, setCustomNameVisible, setDeltaMovement, setDeltaMovement, setFluidTypeHeight, setGlowingTag, setId, setInvisible, setIsInPowderSnow, setLevel, setLevelCallback, setMaxUpStep, setNoGravity, setOldPosAndRot, setOnGround, setOnGroundWithKnownMovement, setPortalCooldown, setPortalCooldown, setPos, setPos, setPose, setPosRaw, setRemainingFireTicks, setRemoved, setRot, setSecondsOnFire, 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, teleportToWithTicket, thunderHit, toString, touchingUnloadedChunk, trackingPosition, tryCheckInsideBlocks, turn, unRide, unsetRemoved, updateDynamicGameEventListener, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateFluidHeightAndDoFluidPushing, updateInWaterStateAndDoFluidPushing, updateSwimming, waterSwimSound
Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider
areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, serializeCaps
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.commands.CommandSource
alwaysAccepts
Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider
getCapability
Methods inherited from interface net.minecraftforge.common.extensions.IForgeEntity
canBeRiddenUnderFluidType, canFluidExtinguish, canHydrateInFluidType, canRiderInteract, canStartSwimming, canTrample, canUpdate, canUpdate, captureDrops, captureDrops, deserializeNBT, getClassification, getEyeHeightForge, getEyeInFluidType, getFluidFallDistanceModifier, getFluidMotionScale, getFluidTypeHeight, getMaxHeightFluidType, getParts, getPersistentData, getPickedResult, getSoundFromFluidType, getStepHeight, hasCustomOutlineRendering, isAddedToWorld, isEyeInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isInFluidType, isMultipartEntity, isPushedByFluid, onAddedToWorld, onRemovedFromWorld, revive, serializeNBT, shouldRiderSit, shouldUpdateFluidWhileBoating
Methods inherited from interface net.minecraftforge.common.extensions.IForgeLivingEntity
canDrownInFluidType, canSwimInFluidType, moveInFluid, self, sinkInFluid
Methods inherited from interface com.pixelmonmod.pixelmon.client.render.entity.renderers.smd.RenderableEntity
getCurrentAnimation, isDisableTexture, isFullbright, isOverlay, isWireFrame
-
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
-
-
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()- Overrides:
defineSynchedData
in classnet.minecraft.world.entity.Mob
-
define
-
tick
public void tick()- Overrides:
tick
in classnet.minecraft.world.entity.Mob
-
canRide
protected boolean canRide(@NotNull @NotNull net.minecraft.world.entity.Entity entity) - Overrides:
canRide
in classnet.minecraft.world.entity.Entity
-
readAdditionalSaveData
public void readAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Overrides:
readAdditionalSaveData
in classnet.minecraft.world.entity.Mob
-
addAdditionalSaveData
public void addAdditionalSaveData(@NotNull @NotNull net.minecraft.nbt.CompoundTag tag) - Overrides:
addAdditionalSaveData
in classnet.minecraft.world.entity.Mob
-
setCustomName
public void setCustomName(@Nullable @Nullable net.minecraft.network.chat.Component name) - Overrides:
setCustomName
in classnet.minecraft.world.entity.Entity
-
checkAndHandleImportantInteractions
@NotNull public @NotNull net.minecraft.world.InteractionResult checkAndHandleImportantInteractions(net.minecraft.world.entity.player.Player player, @NotNull @NotNull net.minecraft.world.InteractionHand hand) - Overrides:
checkAndHandleImportantInteractions
in classnet.minecraft.world.entity.Mob
-
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(InteractionEvent interactionEvent, InteractionContext 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) Starts a battle with the given player- Parameters:
player
- The player to battle
-
getRenderingHandler
-
isBaby
public boolean isBaby()- Overrides:
isBaby
in classnet.minecraft.world.entity.LivingEntity
-
isInvulnerableTo
public boolean isInvulnerableTo(net.minecraft.world.damagesource.DamageSource damageSource) - Overrides:
isInvulnerableTo
in classnet.minecraft.world.entity.Entity
-
isInvulnerable
public boolean isInvulnerable()- Overrides:
isInvulnerable
in 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:
move
in classnet.minecraft.world.entity.Entity
-
setInvulnerable
public void setInvulnerable(boolean invulnerable) - Overrides:
setInvulnerable
in classnet.minecraft.world.entity.Entity
-
onSyncedDataUpdated
public void onSyncedDataUpdated(@NotNull @NotNull net.minecraft.network.syncher.EntityDataAccessor<?> key) - Overrides:
onSyncedDataUpdated
in classnet.minecraft.world.entity.LivingEntity
-
ridingOffset
protected float ridingOffset(@NotNull @NotNull net.minecraft.world.entity.Entity rider) - Overrides:
ridingOffset
in classnet.minecraft.world.entity.Entity
-
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
-
getIcon
-
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:
getAnimationVariables
in interfaceRenderableEntity
-
getProperties
-
isPersistenceRequired
public boolean isPersistenceRequired()- Overrides:
isPersistenceRequired
in classnet.minecraft.world.entity.Mob
-
remove
public void remove(@NotNull net.minecraft.world.entity.Entity.RemovalReason removalReason) - Overrides:
remove
in 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
-