Skip to content

ProjectileTargeting

seelderr edited this page Jan 13, 2025 · 2 revisions

Description

ProjectileTargeting is the core structure for handling all of the effects and targeting logic for projectiles. It contains various ways to target entities, blocks, or a world location, as well as all of the potential effects that could be applied to those entities, blocks, or world location.

Parents

This object is used by the following objects:

  1. Projectile

Dependencies

This object references the following objects:

  1. ProjectileEntityEffect
  2. ProjectileBlockEffect
  3. ProjectileWorldEffect

ConditionalEffect

A combination of a ProjectileEffect and a Predicate.

Schema

{
    "effect": [ProjectileEntityEffect or ProjectileBlockEffect or ProjectileWorldEffect]          // [Mandatory] || The effect to apply.
    "condition": [Predicate]                                                                      // [Optional]  || The conditions under which to apply the effect.
}

Targeting Types

Area

Targets an area around the entity/block/world position.

Schema

{
     "effects": [ConditionEffect]               // [Mandatory] || List of effects to apply.
     "tick_rate": [number]                      // [Optional]  || The frequency that this effect applies, if it is ticking. Defaults to 1.
     "chance": [number]                         // [Optional]  || The chance this effect is applied. Defaults to 1.
     "radius": [LevelBasedValue]                // [Mandatory] || The radius of the area.
     "particle_trail": [ParticleType]           // [Optional]  || The particle to use for drawing a trail between the center of the area and its targets when effects are applied.
}

Point

Targets the center of the entity/block/world position.

Schema

{
     "effects": [ConditionEffect]               // [Mandatory] || List of effects to apply.
     "tick_rate": [number]                      // [Optional]  || The frequency that this effect applies, if it is ticking. Defaults to 1.
     "chance": [number]                         // [Optional]  || The chance this effect is applied. Defaults to 1.
}
Datapack Documentation
Clone this wiki locally