Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- takeLegacyAlarmStore()
- getRole()
- invalidateCachedHorizontalSpeedMultiplier()
- storeTickStartPosition(Vector3d)
- tickDespawnAnimationRemainingSeconds(float)
- setDespawnAnimationRemainingSeconds(float)
- tickDespawnRemainingSeconds(float)
- setDespawnRemainingSeconds(float)
- setDespawning(boolean)
- setPlayingDespawnAnim(boolean)
- tickDespawnCheckRemainingSeconds(float)
- setDespawnCheckRemainingSeconds(float)
- setInitialModelScale(float)
- getOldPosition()
- playAnimation(Ref, AnimationSlot, String, ComponentAccessor)
- playAnimation(Ref, AnimationSlot, String, boolean, ComponentAccessor)
- clearDamageData()
- setToDespawn()
- setDespawnTime(float)
- getDespawnTime()
- getDamageData()
- getCanCauseDamage(Ref, ComponentAccessor)
- onFlockSetState(Ref, String, String, ComponentAccessor)
- onFlockSetTarget(String, Ref)
- saveLeashInformation(Vector3dc, Rotation3fc)
- saveLeashBlockType()
- requiresLeashPosition()
- getLeashPoint()
- setLeashPoint(Vector3d)
- getLeashHeading()
- setLeashHeading(float)
- getLeashPitch()
- setLeashPitch(float)
- getHoverPhase()
- setHoverPhase(float)
- getHoverHeight()
- setHoverHeight(double)
- getRoleName()
- setRoleName(String)
- getRoleIndex()
- setRoleIndex(int)
- shouldCollectSensorStats()
- setCollectSensorStats(boolean)
- setRole(Role)
- getSpawnRoleIndex()
- setSpawnRoleIndex(int)
- getActiveMotionControllerName()
- setActiveMotionControllerName(String)
- setEnvironment(int)
- getEnvironment()
- getSpawnConfiguration()
- setSpawnConfiguration(int)
- updateSpawnTrackingState(boolean)
- isDespawning()
- isPlayingDespawnAnim()
- getRoleDebugFlags()
- setRoleDebugFlags(EnumSet)
- setSpawnInstant(Instant)
- getSpawnInstant()
- getLegacyWorldgenId()
- getPathManager()
- setAppearance(Ref, String, ComponentAccessor)
- setAppearance(Ref, ModelAsset, ComponentAccessor)
- getCurrentHorizontalSpeedMultiplier(Ref, ComponentAccessor)
- toString()
- getNPCTypeId()
- getNPCTypeIndex()
- addReservation(UUID)
- removeReservation(UUID)
- isReserved()
- isReservedBy(UUID)
Class NPCEntity
java.lang.Object
com.hypixel.hytale.server.core.entity.Entity
com.hypixel.hytale.server.core.entity.LivingEntity
com.hypixel.hytale.server.npc.entities.NPCEntity
- All Implemented Interfaces:
Component<EntityStore>, INonPlayerCharacter, Cloneable
-
Nested Class Summary
Nested classes/interfaces inherited from class Entity
Entity.DefaultAnimations -
Field Summary
FieldsFields inherited from class LivingEntity
DEFAULT_ITEM_THROW_SPEEDFields inherited from class Entity
DISPLAY_NAME, LOGGER, UNASSIGNED_ID, UUID, VERSIONFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReservation(UUID playerUUID) Called to add the given player UUID as a reservation for this NPCvoidbooleangetCanCauseDamage(Ref<EntityStore> attackerRef, ComponentAccessor<EntityStore> componentAccessor) static ComponentType<EntityStore, NPCEntity> floatgetCurrentHorizontalSpeedMultiplier(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) doubleintdoublefloatfloatfloatorg.joml.Vector3dintDeprecated, for removal: This API element is subject to removal in a future version.Used to fetch for legacy migrationintorg.joml.Vector3dgetRole()intintintvoidbooleanbooleanbooleanbooleanisReservedBy(UUID playerUUID) Determines whether this NPC is reserved for the given playervoidonFlockSetState(Ref<EntityStore> ref, String state, String subState, ComponentAccessor<EntityStore> componentAccessor) voidonFlockSetTarget(String targetSlot, Ref<EntityStore> target) voidplayAnimation(Ref<EntityStore> ref, AnimationSlot animationSlot, String animationId, boolean force, ComponentAccessor<EntityStore> componentAccessor) Called to play an animation on this NPC entity.voidplayAnimation(Ref<EntityStore> ref, AnimationSlot animationSlot, String animationId, ComponentAccessor<EntityStore> componentAccessor) Called to play an animation on this NPC entity.voidremoveReservation(UUID playerUUID) Called to remove the given player UUID as a reservation for this NPCbooleanvoidvoidsaveLeashInformation(org.joml.Vector3dc position, Rotation3fc rotation) voidsetActiveMotionControllerName(String activeMotionControllerName) voidsetAppearance(Ref<EntityStore> ref, ModelAsset modelAsset, ComponentAccessor<EntityStore> componentAccessor) static booleansetAppearance(Ref<EntityStore> ref, String name, ComponentAccessor<EntityStore> componentAccessor) voidsetCollectSensorStats(boolean collectSensorStats) voidsetDespawnAnimationRemainingSeconds(float seconds) voidsetDespawnCheckRemainingSeconds(float seconds) voidsetDespawning(boolean despawning) voidsetDespawnRemainingSeconds(float seconds) voidsetDespawnTime(float time) voidsetEnvironment(int env) voidsetHoverHeight(double hoverHeight) voidsetHoverPhase(float hoverPhase) voidsetInitialModelScale(float scale) voidsetLeashHeading(float leashHeading) voidsetLeashPitch(float leashPitch) voidsetLeashPoint(org.joml.Vector3d leashPoint) voidsetPlayingDespawnAnim(boolean playingDespawnAnim) voidvoidsetRoleDebugFlags(EnumSet<RoleDebugFlags> flags) voidsetRoleIndex(int roleIndex) voidsetRoleName(String roleName) voidsetSpawnConfiguration(int spawnConfigurationIndex) voidsetSpawnInstant(Instant spawned) voidsetSpawnRoleIndex(int spawnRoleIndex) voidbooleanvoidstoreTickStartPosition(org.joml.Vector3d position) Deprecated, for removal: This API element is subject to removal in a future version.booleantickDespawnAnimationRemainingSeconds(float dt) booleantickDespawnCheckRemainingSeconds(float dt) booleantickDespawnRemainingSeconds(float dt) toString()booleanupdateSpawnTrackingState(boolean newState) Methods inherited from class LivingEntity
getCurrentFallDistance, getInventory, getPackedMaterialAndFluidAtBreathingHeight, moveTo, setCurrentFallDistance, updateItemStackDurabilityMethods inherited from class Entity
clearReference, clone, equals, getLegacyDisplayName, getNetworkId, getReference, getUuid, getWorld, hashCode, isCollidable, isHiddenFromLivingEntity, loadIntoWorld, markNeedsSave, remove, setLegacyUUID, setReference, toHolder, unloadFromWorld, wasRemovedMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
-
-
Constructor Details
-
NPCEntity
public NPCEntity()Default Constructor for aNPCEntityinstance -
NPCEntity
-
-
Method Details
-
getComponentType
-
takeLegacyAlarmStore
Deprecated, for removal: This API element is subject to removal in a future version. -
getRole
-
invalidateCachedHorizontalSpeedMultiplier
public void invalidateCachedHorizontalSpeedMultiplier() -
storeTickStartPosition
public void storeTickStartPosition(@Nonnull org.joml.Vector3d position) -
tickDespawnAnimationRemainingSeconds
public boolean tickDespawnAnimationRemainingSeconds(float dt) -
setDespawnAnimationRemainingSeconds
public void setDespawnAnimationRemainingSeconds(float seconds) -
tickDespawnRemainingSeconds
public boolean tickDespawnRemainingSeconds(float dt) -
setDespawnRemainingSeconds
public void setDespawnRemainingSeconds(float seconds) -
setDespawning
public void setDespawning(boolean despawning) -
setPlayingDespawnAnim
public void setPlayingDespawnAnim(boolean playingDespawnAnim) -
tickDespawnCheckRemainingSeconds
public boolean tickDespawnCheckRemainingSeconds(float dt) -
setDespawnCheckRemainingSeconds
public void setDespawnCheckRemainingSeconds(float seconds) -
setInitialModelScale
public void setInitialModelScale(float scale) -
getOldPosition
public org.joml.Vector3d getOldPosition() -
playAnimation
public void playAnimation(@Nonnull Ref<EntityStore> ref, @Nonnull AnimationSlot animationSlot, @Nullable String animationId, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play an animation on this NPC entity.- Parameters:
ref- The entity reference of the NPC entity.animationSlot- The animation slot to play the animation on.animationId- The animation ID to play.componentAccessor- The component accessor for entity components.
-
playAnimation
public void playAnimation(@Nonnull Ref<EntityStore> ref, @Nonnull AnimationSlot animationSlot, @Nullable String animationId, boolean force, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play an animation on this NPC entity.- Parameters:
ref- The entity reference of the NPC entity.animationSlot- The animation slot to play the animation on.animationId- The animation ID to play.force- Resend even if the slot already shows this animation, restarting it on clients (e.g. trigger volume replays of a finished animation).componentAccessor- The component accessor for entity components.
-
clearDamageData
public void clearDamageData() -
setToDespawn
public void setToDespawn() -
setDespawnTime
public void setDespawnTime(float time) -
getDespawnTime
public double getDespawnTime() -
getDamageData
-
getCanCauseDamage
public boolean getCanCauseDamage(@Nonnull Ref<EntityStore> attackerRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
onFlockSetState
public void onFlockSetState(@Nonnull Ref<EntityStore> ref, @Nonnull String state, @Nullable String subState, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
onFlockSetTarget
-
saveLeashInformation
public void saveLeashInformation(@Nonnull org.joml.Vector3dc position, @Nonnull Rotation3fc rotation) -
saveLeashBlockType
public void saveLeashBlockType() -
requiresLeashPosition
public boolean requiresLeashPosition() -
getLeashPoint
public org.joml.Vector3d getLeashPoint() -
setLeashPoint
public void setLeashPoint(@Nonnull org.joml.Vector3d leashPoint) -
getLeashHeading
public float getLeashHeading() -
setLeashHeading
public void setLeashHeading(float leashHeading) -
getLeashPitch
public float getLeashPitch() -
setLeashPitch
public void setLeashPitch(float leashPitch) -
getHoverPhase
public float getHoverPhase() -
setHoverPhase
public void setHoverPhase(float hoverPhase) -
getHoverHeight
public double getHoverHeight() -
setHoverHeight
public void setHoverHeight(double hoverHeight) -
getRoleName
-
setRoleName
-
getRoleIndex
public int getRoleIndex() -
setRoleIndex
public void setRoleIndex(int roleIndex) -
shouldCollectSensorStats
public boolean shouldCollectSensorStats() -
setCollectSensorStats
public void setCollectSensorStats(boolean collectSensorStats) -
setRole
-
getSpawnRoleIndex
public int getSpawnRoleIndex() -
setSpawnRoleIndex
public void setSpawnRoleIndex(int spawnRoleIndex) -
getActiveMotionControllerName
-
setActiveMotionControllerName
-
setEnvironment
public void setEnvironment(int env) -
getEnvironment
public int getEnvironment() -
getSpawnConfiguration
public int getSpawnConfiguration() -
setSpawnConfiguration
public void setSpawnConfiguration(int spawnConfigurationIndex) -
updateSpawnTrackingState
public boolean updateSpawnTrackingState(boolean newState) -
isDespawning
public boolean isDespawning() -
isPlayingDespawnAnim
public boolean isPlayingDespawnAnim() -
getRoleDebugFlags
-
setRoleDebugFlags
-
setSpawnInstant
-
getSpawnInstant
-
getLegacyWorldgenId
Deprecated, for removal: This API element is subject to removal in a future version.Used to fetch for legacy migration -
getPathManager
- Returns:
- the
PathManagerfor this NPC entity.
-
setAppearance
public static boolean setAppearance(@Nonnull Ref<EntityStore> ref, @Nonnull String name, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
setAppearance
public void setAppearance(@Nonnull Ref<EntityStore> ref, @Nonnull ModelAsset modelAsset, @Nonnull ComponentAccessor<EntityStore> componentAccessor) -
getCurrentHorizontalSpeedMultiplier
public float getCurrentHorizontalSpeedMultiplier(@Nullable Ref<EntityStore> ref, @Nullable ComponentAccessor<EntityStore> componentAccessor) -
toString
- Overrides:
toStringin classLivingEntity
-
getNPCTypeId
- Specified by:
getNPCTypeIdin interfaceINonPlayerCharacter
-
getNPCTypeIndex
public int getNPCTypeIndex()- Specified by:
getNPCTypeIndexin interfaceINonPlayerCharacter
-
addReservation
-
removeReservation
-
isReserved
public boolean isReserved()- Returns:
trueif this NPC is reserved,falseotherwise
-
isReservedBy
-