Escort Objective
Escort an NPC along a route
Поля
| Поле | Тип | По умолчанию | Описание | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
quest | Ref<QuestEntry> | — | — | ||||||||||||
display | Var<String> | Escort Objective | — | ||||||||||||
maxHealth | Var<Double> | 20.0 | Maximum health of the escort mob | ||||||||||||
regenPerSec | Var<Double> | 0.0 | Health regenerated per second. 0 = no regeneration | ||||||||||||
damageReductionPct | Var<Double> | 0.0 | Percent of incoming damage to negate (0-100) | ||||||||||||
mobHitDamage | Var<Double> | 1.0 | Amount of health lost each time the escort mob is hit by another mob | ||||||||||||
invulnerable | Var<Boolean> | false | If true the escort mob is completely invulnerable | ||||||||||||
hurtSound | Var<Sound> | EMPTY | Custom sound to play when the escort mob takes damage | ||||||||||||
guardRadius | Var<Double> | 10.0 | Radius the player must stay within to keep the escort active | ||||||||||||
loseToleranceSec | Var<Int> | 5 | Seconds the player is allowed to exceed the guard radius before failing | ||||||||||||
globalTimeLimitSec | Var<Int> | 0 | Time limit in seconds for the whole escort. 0 = unlimited | ||||||||||||
nodeReachRadius | Var<Double> | 1.0 | Distance considered as reaching a waypoint | ||||||||||||
spawnRadius | Var<Double> | 40.0 | Radius around the spawn node to spawn the NPC | ||||||||||||
startRadius | Var<Double> | 5.0 | Distance from the NPC required to start the escort | ||||||||||||
npc | Ref<out SimpleEntityInstance> | — | Existing NPC instance used for the escort visual | ||||||||||||
ambushes | List<AmbushSpec> | empty | Optional ambush triggers executed at checkpoints
|
| Поле | Тип | По умолчанию | Описание |
|---|---|---|---|
checkpointIndex | Int | 0 | — |
triggers | List<Ref<TriggerableEntry>> | empty | — |
enableScoreboardVar<Boolean>falseenableBossBarVar<Boolean>falseonEscortStartRef<TriggerableEntry>onCheckpointRef<TriggerableEntry>onEscortLostRef<TriggerableEntry>onEscortRecoveredRef<TriggerableEntry>onEscortResetRef<TriggerableEntry>onEscortCompleteRef<TriggerableEntry>onEscortFailRef<TriggerableEntry>hideObjectiveVar<Boolean>falseОбщие поля TypeWriter (criteria, children, priorityOverride)
| Поле | Тип | По умолчанию | Описание |
|---|---|---|---|
criteria | List<Criteria> | empty | — |
children | List<Ref<AudienceEntry>> | empty | — |
priorityOverride | Optional<Int> | — | — |
How to use it
The objective needs a quest, an npc entity instance whose activity is a Path Escort Activity, and the road network nodes listed by that activity. The first node is where the escort starts and the last one is where it ends.
Starting. A player who is in the objective's audience and within startRadius of the first node starts the escort automatically. The NPC appears when the player is within spawnRadius of the first node, and the escort begins when the player comes within startRadius of the NPC. If the player leaves spawnRadius before that, the pending escort is cancelled. You can also start it with the Escort Start action.
NPC protection. maxHealth, regenPerSec (applied each second), damageReductionPct (0 to 100), mobHitDamage (damage taken from each mob hit, replacing the vanilla damage) and invulnerable. hurtSound plays when the NPC is hurt. Players cannot damage the escort NPC.
Keeping the player close. guardRadius is the distance within which the player must stay. After loseToleranceSec seconds outside it, the escort goes back to its last checkpoint. Reaching a node. nodeReachRadius (default 1.0) is the distance, in blocks, at which the NPC counts a node as reached: as soon as it is within this radius of its target node (the limit included), the node is reached, even if the NPC has not finished walking to it or the node's own radius is smaller. Arrival is still decided by the Path Escort Activity, which receives the radius from the objective. 0 or less turns this check off, and arrival then only comes from the end of the walk.
Limits and display. globalTimeLimitSec (0 means no limit) fails the escort when it runs out. enableScoreboard shows health, checkpoint and time as a sidebar, and enableBossBar shows the NPC's health in a boss bar named by display.
Triggers. onEscortStart, onCheckpoint, onEscortLost, onEscortRecovered, onEscortReset, onEscortComplete and onEscortFail. ambushes runs its triggers once when the matching checkpointIndex is reached.
Hiding. With hideObjective on, the objective is hidden from tracking menus unless the player is tracking its quest.
Only one escort can run per player at a time.