Add API Files

This commit is contained in:
Kam committed 2026-01-28 14:41:30 -05:00
1 parent 2054012fae
commit 3050910efb
20 files changed
+841

No files matched your search

@@ -75,4 +75,53 @@ public interface IDataAbilities {
* Reset all ability cooldowns.
*/
void resetCooldowns();
/**
* Force start an ability on this NPC.
* If an ability is currently executing, it will be cancelled.
*
* @param abilityId The ID of the ability to start
* @return true if the ability was started successfully
*/
boolean forceStartAbility(String abilityId);
/**
* Force start an ability on this NPC with a specific target.
* If an ability is currently executing, it will be cancelled.
*
* @param abilityId The ID of the ability to start
* @param target The target entity (can be null for self-targeted abilities)
* @return true if the ability was started successfully
*/
boolean forceStartAbility(String abilityId, Object target);
/**
* Execute a preset ability on this NPC by preset name.
* The NPC does NOT need to have this ability assigned.
* If an ability is currently executing, it will be cancelled.
*
* @param presetName The name of the saved ability preset
* @return true if the ability was started successfully
*/
boolean executePresetAbility(String presetName);
/**
* Execute a preset ability on this NPC with a specific target.
* The NPC does NOT need to have this ability assigned.
* If an ability is currently executing, it will be cancelled.
*
* @param presetName The name of the saved ability preset
* @param target The target entity (can be null for self-targeted abilities)
* @return true if the ability was started successfully
*/
boolean executePresetAbility(String presetName, Object target);
/**
* Create a new ability instance by type ID.
* The ability is not assigned to this NPC - use addAbility() to assign it.
*
* @param typeId The type ID (e.g., "cnpc:slam", "cnpc:projectile")
* @return The new ability, or null if the type is unknown
*/
IAbility createAbility(String typeId);
}
@@ -0,0 +1,22 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Charge abilities.
* Rush forward attack.
*/
public interface IAbilityCharge extends IAbility {
float getChargeSpeed();
void setChargeSpeed(float speed);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
float getHitWidth();
void setHitWidth(float width);
}
@@ -0,0 +1,40 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Cutter abilities.
* Sweeping fan attack in an arc.
*/
public interface IAbilityCutter extends IAbility {
float getArcAngle();
void setArcAngle(float angle);
float getRange();
void setRange(float range);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
/**
* Get the sweep mode (0 = SWIPE, 1 = SPIN).
*/
int getSweepMode();
void setSweepMode(int mode);
float getSweepSpeed();
void setSweepSpeed(float speed);
int getSpinDurationTicks();
void setSpinDurationTicks(int ticks);
boolean isPiercing();
void setPiercing(boolean piercing);
float getInnerRadius();
void setInnerRadius(float radius);
}
@@ -0,0 +1,22 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Dash abilities.
* Quick evasive sidestep movement.
*/
public interface IAbilityDash extends IAbility {
/**
* Get the dash mode (0 = AGGRESSIVE, 1 = DEFENSIVE).
*/
int getDashMode();
void setDashMode(int mode);
float getDashDistance();
void setDashDistance(float distance);
float getDashSpeed();
void setDashSpeed(float speed);
}
@@ -0,0 +1,85 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Disc abilities.
* Flat spinning disc projectile with optional boomerang.
*/
public interface IAbilityDisc extends IAbility {
float getSpeed();
void setSpeed(float speed);
float getDiscRadius();
void setDiscRadius(float radius);
float getDiscThickness();
void setDiscThickness(float thickness);
float getMaxDistance();
void setMaxDistance(float distance);
int getMaxLifetime();
void setMaxLifetime(int ticks);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
float getKnockbackUp();
void setKnockbackUp(float knockback);
boolean isHoming();
void setHoming(boolean homing);
float getHomingStrength();
void setHomingStrength(float strength);
float getHomingRange();
void setHomingRange(float range);
boolean isBoomerang();
void setBoomerang(boolean boomerang);
int getBoomerangDelay();
void setBoomerangDelay(int ticks);
boolean isExplosive();
void setExplosive(boolean explosive);
float getExplosionRadius();
void setExplosionRadius(float radius);
int getStunDuration();
void setStunDuration(int duration);
int getSlowDuration();
void setSlowDuration(int duration);
int getSlowLevel();
void setSlowLevel(int level);
int getInnerColor();
void setInnerColor(int color);
int getOuterColor();
void setOuterColor(int color);
boolean isOuterColorEnabled();
void setOuterColorEnabled(boolean enabled);
float getRotationSpeed();
void setRotationSpeed(float speed);
boolean hasLightningEffect();
void setLightningEffect(boolean enabled);
/**
* Get the anchor point for charging (0-7, see AnchorPoint enum).
*/
int getAnchorPoint();
void setAnchorPoint(int point);
}
@@ -0,0 +1,79 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Energy Beam abilities.
* Homing beam head with trailing path attached to origin.
*/
public interface IAbilityEnergyBeam extends IAbility {
float getSpeed();
void setSpeed(float speed);
float getMaxDistance();
void setMaxDistance(float distance);
int getMaxLifetime();
void setMaxLifetime(int ticks);
float getBeamWidth();
void setBeamWidth(float width);
float getHeadSize();
void setHeadSize(float size);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
float getKnockbackUp();
void setKnockbackUp(float knockback);
boolean isHoming();
void setHoming(boolean homing);
float getHomingStrength();
void setHomingStrength(float strength);
float getHomingRange();
void setHomingRange(float range);
boolean isExplosive();
void setExplosive(boolean explosive);
float getExplosionRadius();
void setExplosionRadius(float radius);
int getStunDuration();
void setStunDuration(int duration);
int getSlowDuration();
void setSlowDuration(int duration);
int getSlowLevel();
void setSlowLevel(int level);
int getInnerColor();
void setInnerColor(int color);
int getOuterColor();
void setOuterColor(int color);
boolean isOuterColorEnabled();
void setOuterColorEnabled(boolean enabled);
float getRotationSpeed();
void setRotationSpeed(float speed);
boolean hasLightningEffect();
void setLightningEffect(boolean enabled);
/**
* Get the anchor point for charging (0-7, see AnchorPoint enum).
*/
int getAnchorPoint();
void setAnchorPoint(int point);
}
@@ -0,0 +1,34 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Guard abilities.
* Defensive stance with optional counter-attack.
*/
public interface IAbilityGuard extends IAbility {
int getDurationTicks();
void setDurationTicks(int ticks);
float getDamageReduction();
void setDamageReduction(float reduction);
boolean canCounter();
void setCanCounter(boolean canCounter);
int getCounterType();
void setCounterType(int type);
float getCounterValue();
void setCounterValue(float value);
float getCounterChance();
void setCounterChance(float chance);
String getCounterSound();
void setCounterSound(String sound);
int getCounterAnimationId();
void setCounterAnimationId(int animationId);
}
@@ -0,0 +1,64 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Hazard abilities.
* Persistent ground effect zones.
*/
public interface IAbilityHazard extends IAbility {
int getDurationTicks();
void setDurationTicks(int ticks);
float getRadius();
void setRadius(float radius);
float getInnerRadius();
void setInnerRadius(float radius);
float getConeAngle();
void setConeAngle(float angle);
/**
* Get the hazard shape (0 = CIRCLE, 1 = RING, 2 = CONE).
*/
int getShape();
void setShape(int shape);
/**
* Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = FOLLOW_CASTER, 3 = FOLLOW_TARGET).
*/
int getPlacement();
void setPlacement(int placement);
float getDamagePerSecond();
void setDamagePerSecond(float damage);
int getDamageInterval();
void setDamageInterval(int interval);
boolean isIgnoreInvulnFrames();
void setIgnoreInvulnFrames(boolean ignore);
int getSlownessLevel();
void setSlownessLevel(int level);
int getWeaknessLevel();
void setWeaknessLevel(int level);
int getPoisonLevel();
void setPoisonLevel(int level);
int getWitherLevel();
void setWitherLevel(int level);
int getBlindnessLevel();
void setBlindnessLevel(int level);
int getDebuffDuration();
void setDebuffDuration(int duration);
boolean isAffectsCaster();
void setAffectsCaster(boolean affects);
}
@@ -0,0 +1,31 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Heal abilities.
* Healing self and/or allies.
*/
public interface IAbilityHeal extends IAbility {
int getDurationTicks();
void setDurationTicks(int ticks);
float getHealAmount();
void setHealAmount(float amount);
float getHealPercent();
void setHealPercent(float percent);
boolean isHealSelf();
void setHealSelf(boolean healSelf);
boolean isHealAllies();
void setHealAllies(boolean healAllies);
float getHealRadius();
void setHealRadius(float radius);
boolean isInstantHeal();
void setInstantHeal(boolean instant);
}
@@ -0,0 +1,16 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Heavy Hit abilities.
* Single-target high damage melee attack.
*/
public interface IAbilityHeavyHit extends IAbility {
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
}
@@ -0,0 +1,61 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Laser Shot abilities.
* Fast expanding thin line that pierces through targets.
*/
public interface IAbilityLaserShot extends IAbility {
float getLaserWidth();
void setLaserWidth(float width);
float getExpansionSpeed();
void setExpansionSpeed(float speed);
int getLingerTicks();
void setLingerTicks(int ticks);
float getMaxDistance();
void setMaxDistance(float distance);
int getMaxLifetime();
void setMaxLifetime(int ticks);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
float getKnockbackUp();
void setKnockbackUp(float knockback);
boolean isExplosive();
void setExplosive(boolean explosive);
float getExplosionRadius();
void setExplosionRadius(float radius);
int getStunDuration();
void setStunDuration(int duration);
int getSlowDuration();
void setSlowDuration(int duration);
int getSlowLevel();
void setSlowLevel(int level);
int getInnerColor();
void setInnerColor(int color);
int getOuterColor();
void setOuterColor(int color);
boolean isOuterColorEnabled();
void setOuterColorEnabled(boolean enabled);
boolean hasLightningEffect();
void setLightningEffect(boolean enabled);
}
@@ -0,0 +1,76 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Orb abilities.
* Homing projectile sphere.
*/
public interface IAbilityOrb extends IAbility {
float getOrbSpeed();
void setOrbSpeed(float speed);
float getOrbSize();
void setOrbSize(float size);
float getMaxDistance();
void setMaxDistance(float distance);
int getMaxLifetime();
void setMaxLifetime(int ticks);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
float getKnockbackUp();
void setKnockbackUp(float knockback);
boolean isHoming();
void setHoming(boolean homing);
float getHomingStrength();
void setHomingStrength(float strength);
float getHomingRange();
void setHomingRange(float range);
boolean isExplosive();
void setExplosive(boolean explosive);
float getExplosionRadius();
void setExplosionRadius(float radius);
int getStunDuration();
void setStunDuration(int duration);
int getSlowDuration();
void setSlowDuration(int duration);
int getSlowLevel();
void setSlowLevel(int level);
int getInnerColor();
void setInnerColor(int color);
int getOuterColor();
void setOuterColor(int color);
boolean isOuterColorEnabled();
void setOuterColorEnabled(boolean enabled);
float getRotationSpeed();
void setRotationSpeed(float speed);
boolean hasLightningEffect();
void setLightningEffect(boolean enabled);
/**
* Get the anchor point for charging (0-7, see AnchorPoint enum).
*/
int getAnchorPoint();
void setAnchorPoint(int point);
}
@@ -0,0 +1,34 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Projectile abilities.
* Ranged projectile attacks.
*/
public interface IAbilityProjectile extends IAbility {
float getDamage();
void setDamage(float damage);
float getSpeed();
void setSpeed(float speed);
float getKnockback();
void setKnockback(float knockback);
String getProjectileType();
void setProjectileType(String type);
boolean isExplosive();
void setExplosive(boolean explosive);
float getExplosionRadius();
void setExplosionRadius(float radius);
boolean isHoming();
void setHoming(boolean homing);
float getHomingStrength();
void setHomingStrength(float strength);
}
@@ -0,0 +1,22 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Shockwave abilities.
* Pushes targets away from the caster.
*/
public interface IAbilityShockwave extends IAbility {
float getPushRadius();
void setPushRadius(float radius);
float getPushStrength();
void setPushStrength(float strength);
float getDamage();
void setDamage(float damage);
int getMaxTargets();
void setMaxTargets(int max);
}
@@ -0,0 +1,25 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Slam abilities.
* Ground-pound AOE attack with leap.
*/
public interface IAbilitySlam extends IAbility {
float getDamage();
void setDamage(float damage);
float getRadius();
void setRadius(float radius);
float getKnockbackStrength();
void setKnockbackStrength(float knockback);
float getLeapSpeed();
void setLeapSpeed(float speed);
float getLeapHeight();
void setLeapHeight(float height);
}
@@ -0,0 +1,49 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Sweeper abilities.
* Low sweeping beam that rotates around the NPC.
*/
public interface IAbilitySweeper extends IAbility {
float getBeamLength();
void setBeamLength(float length);
float getBeamWidth();
void setBeamWidth(float width);
float getBeamHeight();
void setBeamHeight(float height);
float getDamage();
void setDamage(float damage);
int getDamageInterval();
void setDamageInterval(int interval);
boolean isPiercing();
void setPiercing(boolean piercing);
float getSweepSpeed();
void setSweepSpeed(float speed);
int getNumberOfRotations();
void setNumberOfRotations(int rotations);
boolean isLockOnTarget();
void setLockOnTarget(boolean lock);
int getInnerColor();
void setInnerColor(int color);
int getOuterColor();
void setOuterColor(int color);
float getOuterColorWidth();
void setOuterColorWidth(float width);
boolean isOuterColorEnabled();
void setOuterColorEnabled(boolean enabled);
}
@@ -0,0 +1,43 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Teleport abilities.
* Instant repositioning with various modes.
*/
public interface IAbilityTeleport extends IAbility {
/**
* Get the teleport mode (0 = BLINK, 1 = BEHIND, 2 = SINGLE).
*/
int getMode();
void setMode(int mode);
int getBlinkCount();
void setBlinkCount(int count);
int getBlinkDelayTicks();
void setBlinkDelayTicks(int ticks);
float getBlinkRadius();
void setBlinkRadius(float radius);
float getBehindDistance();
void setBehindDistance(float distance);
boolean isRequireLineOfSight();
void setRequireLineOfSight(boolean require);
boolean isDamageAtStart();
void setDamageAtStart(boolean damage);
boolean isDamageAtEnd();
void setDamageAtEnd(boolean damage);
float getDamage();
void setDamage(float damage);
float getDamageRadius();
void setDamageRadius(float radius);
}
@@ -0,0 +1,46 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Trap abilities.
* Proximity-triggered traps.
*/
public interface IAbilityTrap extends IAbility {
int getDurationTicks();
void setDurationTicks(int ticks);
/**
* Get the placement mode (0 = AT_CASTER, 1 = AT_TARGET, 2 = AHEAD_OF_CASTER).
*/
int getPlacement();
void setPlacement(int placement);
float getPlacementDistance();
void setPlacementDistance(float distance);
float getTriggerRadius();
void setTriggerRadius(float radius);
int getArmTime();
void setArmTime(int ticks);
int getMaxTriggers();
void setMaxTriggers(int max);
int getTriggerCooldown();
void setTriggerCooldown(int cooldown);
float getDamage();
void setDamage(float damage);
float getDamageRadius();
void setDamageRadius(float radius);
float getKnockback();
void setKnockback(float knockback);
boolean isVisible();
void setVisible(boolean visible);
}
@@ -0,0 +1,34 @@
package noppes.npcs.api.ability.type;
import noppes.npcs.api.ability.IAbility;
/**
* API interface for Vortex abilities.
* Pulls targets toward the caster.
*/
public interface IAbilityVortex extends IAbility {
float getPullRadius();
void setPullRadius(float radius);
float getPullStrength();
void setPullStrength(float strength);
float getDamage();
void setDamage(float damage);
float getKnockback();
void setKnockback(float knockback);
boolean isAoe();
void setAoe(boolean aoe);
int getMaxTargets();
void setMaxTargets(int max);
boolean isDamageOnPull();
void setDamageOnPull(boolean damage);
float getPullDamage();
void setPullDamage(float damage);
}
@@ -1505,4 +1505,13 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T>,
* @return Magic data
*/
IMagicData getMagicData();
/**
* Returns the Ability Data of an NPC.
* Allows access to the NPC's abilities system including
* force-starting abilities and executing preset abilities.
*
* @return Ability data
*/
noppes.npcs.api.ability.IDataAbilities getAbilityData();
}