Better API Handling for Scripting Energy Utilitizes / Damage Handling

This commit is contained in:
Kam committed 2026-03-03 02:02:04 -05:00
1 parent e4ddefb257
commit 465075c631
3 files changed
+26

No files matched your search

+2
View File
@@ -276,6 +276,8 @@ public abstract class AbstractNpcAPI {
public abstract IDamageSource getIDamageSource(IEntity<?> entity);
public abstract IEnergyController getEnergyController();
public abstract EventBus events();
public abstract File getGlobalDir();
@@ -1,6 +1,7 @@
package noppes.npcs.api.entity;
import net.minecraft.entity.Entity;
import noppes.npcs.api.INbt;
/**
* Base interface for all energy ability entities (Projectiles, Barriers).
@@ -93,4 +94,20 @@ public interface IEnergyAbility<T extends Entity> extends IEntity<T> {
/** @param ignore Whether this entity should ignore target invulnerability frames when dealing damage. */
void setIgnoreIFrames(boolean ignore);
// ==================== CUSTOM DAMAGE DATA ====================
/**
* Get the custom damage data attached to this energy entity.
* Used by addon handlers (e.g. DBC Addon) to carry damage configuration
* directly on the entity, enabling DBC damage scaling without a sourceAbility.
* @return Custom damage data as INbt, or null if none set.
*/
INbt getDamageData();
/**
* Set custom damage data on this energy entity.
* @param data Custom damage data as INbt. Pass null to clear.
*/
void setDamageData(INbt data);
}
@@ -17,10 +17,17 @@ public interface IEnergyPanel<T extends Entity> extends IEnergyBarrier<T> {
float getPanelYaw();
void setPanelYaw(float yaw);
/**
* Panel mode: 0=PLACED, 1=HELD, 2=LAUNCHED
*/
int getPanelMode();
void setPanelMode(int mode);
boolean isLaunched();
/** Spawn this panel entity into the world. */
void spawn();
}