Skip to content

N | Utility: ProjectileUtils

Sartaj Singh edited this page May 29, 2025 · 2 revisions

N | Utility: ProjectileUtils

ProjectileUtils lets you create advanced projectiles with custom behavior, effects, and even custom models (with ModelEngine).


1. initialize(Plugin plugin)

What it does:
Initializes the projectile system. Call once in your plugin's onEnable().

Example:

ProjectileUtils.initialize(this);

2. createCustomProjectile(...)

What it does:
Launches a projectile with fully customizable options—trail, damage, speed, model, knockback, and more.

Signature (as of writing):

ProjectileUtils.createCustomProjectile(
    Plugin plugin,
    Player shooter,
    Particle trailParticle,
    int particleCount,
    boolean gravity,
    boolean glowing,
    int knockbackStrength,
    boolean silent,
    double speed,
    double damage,
    boolean speedBasedDamage,
    EntityType projectileType,
    boolean useModelEngine,
    String modelId,
    int despawnTime,
    int piercingLevel
);

Example:

ProjectileUtils.createCustomProjectile(
    plugin, player, Particle.FLAME, 6, false, false, 1, false,
    2.0, 8.0, false, EntityType.ARROW, false, "", 60, 0
);

Spawns a custom arrow with a flame trail, 8 damage, 2.0 speed, and 1 knockback.


3. isModelEnginePresent(): boolean

What it does:
Returns true if ModelEngine is installed (for custom model projectiles).

Example:

if (ProjectileUtils.isModelEnginePresent()) {
    // Safe to use custom model projectiles
}

Usage Patterns

  • Use for fireballs, magic bolts, or visually unique projectiles.
  • Use custom models for themed servers (RPG, sci-fi, etc.).
  • Always check ModelEngine presence before using custom models.

Clone this wiki locally