Skip to content

PLUGIN Goals

Eisi05 edited this page Jun 2, 2026 · 2 revisions

Plugin Goals System

The NpcPlugin provides a comprehensive AI goal system with GUI configuration support. This document covers the built-in goals available in the plugin and their configuration options.

Available Goals

The plugin includes the following built-in goals, each with a dedicated GUI configuration interface:

Walk to Location Goal

Makes the NPC walk to a specific location using advanced pathfinding.

Configuration Options:

  • Target Location: The destination coordinates
  • Speed: Movement speed (0.1-1.0)
  • Max Iterations: Maximum pathfinding calculations (default: 5000)
  • Allow Diagonal: Whether diagonal movement is allowed
  • With Rotation: Whether to include head rotation packets

Walk Path Goal

Makes the NPC walk along a specified path.

Configuration Options:

  • Path: The path to follow
  • Speed: Movement speed (0.1-1.0)
  • With Rotation: Whether to include head rotation packets

Follow Entity Goal

Makes the NPC follow a target entity while maintaining a specified distance.

Configuration Options:

  • Target Entity: UUID of the entity to follow
  • Follow Distance: Distance to maintain from target (default: 10.0 blocks)
  • Stop Distance: Distance at which to stop following (default: 1.5 blocks)
  • Speed: Movement speed (default: 0.5)

Attack Entity Goal

Makes the NPC attack nearby entities that match specific criteria.

Behavior varies by held item:

  • Bow/Crossbow/Trident: Long range attacks (15 blocks)
  • Sword/Axe/Other: Short range attacks (3 blocks)

Configuration Options:

  • Target Predicate: Entity selection criteria using expressions
    • $distance < 5 - Only entities within 5 blocks
    • $entity.health < 10 - Attack low health entities
    • [if entity @s[type=zombie]] - Only attack zombies
    • $distance < 10 && $entity.health > 5 - Combined conditions
  • Attack Range: Custom attack distance override

Predicate Variables

The following variables are available for entity selection predicates:

Distance & Position:

  • $distance - Distance between entity and NPC
  • $entity.x, $entity.y, $entity.z - Entity's coordinates
  • $npc.x, $npc.y, $npc.z - NPC's coordinates

Entity Properties:

  • $entity.health - Entity's current health
  • $entity.type - Entity type (player, zombie, skeleton, etc.)

Command Checks:

  • [if entity @s[type=<type>]] - Check entity type
  • [if entity @s[distance=..5]] - Check distance via command
  • Examples: [if entity @s[type=player]], [if entity @s[type=zombie]]

Example Predicates:

$distance < 3                    // Very close entities
$entity.health < 5               // Nearly dead entities
$distance < 10 && $entity.type == "player"  // Players within 10 blocks
[if entity @s[type=skeleton]]      // Only skeletons

Look Around Goal

Makes the NPC look around randomly, serving as an idle/wait behavior.

Configuration Options:

  • Min Duration: Minimum looking duration in ticks (default: 20 ticks)
  • Max Duration: Maximum looking duration in ticks (default: 80 ticks)

Wait Goal

Makes the NPC wait/idle for a specified duration.

Configuration Options:

  • Duration: Wait time in ticks (20 ticks = 1 second)

Wander Goal

Makes the NPC wander randomly within a specified radius.

Configuration Options:

  • Radius: Maximum wandering distance (default: 10 blocks)
  • Min Duration: Minimum pause between movements
  • Max Duration: Maximum pause between movements
  • Speed: Movement speed

Clone this wiki locally