Modding:AI Task seektargetingentity
This does the same thing as seekentity with one exception. Only entities that are targeting the guarded entity (owner of the entity) are seeked.
The potential attack target is considered as targeting the guarded entity if the potential target has an AI task active that inherits from AiTaskBaseTargetable, its TargetEntity is set to the guarded entity, and the task has AggressiveTargeting=true (true for everything that inherits from AiTaskBaseTargetable except fleeentity). For example, let's say there is a wolf near the player. The wolf is approaching the player due to an active seekentity task. A hacked locust is guarding the player. The hacked locust sees that the "seekentity" task on the wolf is targeting the player, so it starts approaching the wolf.
After the guard starts seeking a target, it continues seeking the target until it dies, or 30 seconds elapsed and the target is no longer targeting the guarded entity. Returning to the previous example, let's say that after receiving damage the wolf starts fleeing. Let's say the hacked locust somehow got stuck, which is enough to stop the regular "seekentity" task. The hacked locust will keep periodically trying to seek the target for 30 seconds. At that, it realizes that the wolf is no longer targeting the player, so the "seektargetingentity" task stops running.
Properties
All properties are inherited from seekentity. So see the list of properties there.
Content Modding | |||||||||
---|---|---|---|---|---|---|---|---|---|
Basics | Content Mods • Developing a Content Mod • Packaging & Release | ||||||||
Tutorials |
|
||||||||
Concepts | Modding Concepts • Modinfo • Variants • Domains • Patching • Remapping • World Properties | ||||||||
Moddable Assets |
|
||||||||
Uncategorized |
|
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials • Content Mod Concepts |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Entity Behaviors • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • Collectible Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |