Skip to content

← Previous | Next →


goToEntityOffset

Description

Makes the NPC move to a position offset from a specified entity by a given X and Y distance.

Basic information

Name Type Possibilities
goToEntityOffset behaviour 2

Parameters

# Name Type Mandatory Description Multiple
1 entity Entity Yes The entity relative to which the NPC will move. No
2 x number Yes The X offset from the entity's position. No
3 y number Yes The Y offset from the entity's position. No
4 relative boolean No Whether the offset is relative to the entity's heading. Defaults to false if not specified. No

Outputs

# Description
1 The NPC is already within the specified offset distance from the entity.
2 The NPC is moving to the specified offset position relative to the entity.

Example


  NPC 

  name Guard 
  model s_m_y_cop_01 
  position -1020.72 4839.78 258.30 0.0 

  interaction 
    nothing 

  behaviour 
    getClosestPlayer player 
      goToEntityOffset $player 5.0 0.0 true