Interface IEnergyProjectile<T extends net.minecraft.entity.Entity>
-
- All Superinterfaces:
IEnergyAbility<T>,IEntity<T>
- All Known Subinterfaces:
IEnergyBeam<T>,IEnergyDisc<T>,IEnergyLaser<T>,IEnergyOrb<T>,IEnergySlicer<T>
public interface IEnergyProjectile<T extends net.minecraft.entity.Entity> extends IEnergyAbility<T>
Base interface for all energy projectile entities (Orb, Beam, Disc, Laser, Slicer).Extends
IEnergyAbilityfor shared display, lightning, owner, and charging methods.Fire methods — launch from current position (no repositioning):
fireAt(IEntity)— toward an entityfireAt(double, double, double)— toward world coordinatesfireDirection(float, float)— in a yaw/pitch direction
fireFrom(IEntityLivingBase)— fire along caster's look directionfireFrom(IEntityLivingBase, IEntity)— fire toward a target entity
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfireAt(double x, double y, double z)Spawns the projectile and launches it toward the specified world coordinates.voidfireAt(IEntity target)Spawns the projectile and launches it from its current position toward the target entity.voidfireDirection(float yaw, float pitch)Spawns the projectile and launches it in the specified yaw/pitch direction.voidfireFrom(IEntityLivingBase caster)Sets the owner, positions the projectile at the caster's eye level, and launches it using the entity's full launch sequence (startMoving/startFiring).voidfireFrom(IEntityLivingBase caster, IEntity target)Sets the owner, positions the projectile at the caster's eye level, and launches it toward the target entity using the entity's full launch sequence.intgetAnchor()floatgetAnchorOffsetX()floatgetAnchorOffsetY()floatgetAnchorOffsetZ()floatgetDamage()intgetEnergyType()Returns the energy projectile sub-type.floatgetExplosionDamageFalloff()floatgetExplosionRadius()intgetHitType()floatgetHomingRange()floatgetHomingStrength()floatgetInterpolatedRotationX(float partialTicks)floatgetInterpolatedRotationY(float partialTicks)floatgetInterpolatedRotationZ(float partialTicks)floatgetInterpolatedSize(float partialTicks)floatgetKnockback()floatgetKnockbackUp()floatgetMaxDistance()intgetMaxHits()intgetMaxLifetime()intgetMultiHitDelayTicks()floatgetRotationSpeed()floatgetSize()floatgetSpeed()doublegetStartX()doublegetStartY()doublegetStartZ()IEntitygetTarget()intgetTargetEntityId()booleanhasHit()booleanisExplosive()booleanisHoming()voidsetDamage(float damage)voidsetExplosionDamageFalloff(float falloff)voidsetExplosionRadius(float radius)voidsetExplosive(boolean explosive)voidsetHitType(int hitType)voidsetHoming(boolean homing)voidsetHomingRange(float range)voidsetHomingStrength(float strength)voidsetKnockback(float knockback)voidsetKnockbackUp(float knockbackUp)voidsetMaxDistance(float distance)voidsetMaxHits(int maxHits)voidsetMaxLifetime(int ticks)voidsetMultiHitDelayTicks(int delayTicks)voidsetOwner(IEntity owner)Sets the owner entity (used for homing return, damage attribution, etc.).voidsetRotationSpeed(float speed)voidsetSize(float size)Sets the projectile's visual and collision size.voidsetSpeed(float speed)voidsetTarget(IEntity target)Sets the homing/tracking target entity.voidsyncClient()Sends all current visual, movement, and position data to tracking clients.-
Methods inherited from interface noppes.npcs.api.entity.IEnergyAbility
getChargeProgress, getDamageData, getInnerAlpha, getInnerColor, getLightningDensity, getLightningFadeTime, getLightningRadius, getMagicData, getOuterColor, getOuterColorAlpha, getOuterColorWidth, getOwner, getOwnerEntityId, hasLightningEffect, isCharging, isIgnoreIFrames, isOuterColorEnabled, setDamageData, setIgnoreIFrames, setInnerAlpha, setInnerColor, setLightningDensity, setLightningEffect, setLightningFadeTime, setLightningRadius, setMagicData, setOuterColor, setOuterColorAlpha, setOuterColorEnabled, setOuterColorWidth
-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAge, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getCollidingEntities, getDimension, getEntityId, getHeight, getMCEntity, getMotion, getMotionX, getMotionY, getMotionZ, getMount, getNbt, getNbtOptional, getPitch, getPosition, getRider, getRotation, getStoredData, getStoredDataKeys, getSurroundingEntities, getSurroundingEntities, getTempData, getTempDataKeys, getType, getTypeName, getUniqueID, getWidth, getWorld, getX, getY, getYOffset, getZ, hasCollided, hasCollidedHorizontally, hasCollidedVertically, hasStoredData, hasTempData, inFire, inLava, inWater, isAirborne, isAlive, isBurning, isSneaking, isSprinting, knockback, knockback, knockback, removeStoredData, removeTempData, setBurning, setCapturedDrops, setCapturesDrops, setDimension, setImmune, setInvisible, setMotion, setMotion, setMotionX, setMotionY, setMotionZ, setMount, setNbt, setPitch, setPosition, setPosition, setRider, setRotation, setRotation, setSneaking, setSprinting, setStoredData, setTempData, setX, setY, setZ, spawnParticle, storeAsClone, typeOf, updateEntity
-
-
-
-
Method Detail
-
setOwner
void setOwner(IEntity owner)
Sets the owner entity (used for homing return, damage attribution, etc.).- Parameters:
owner- the entity that owns this projectile
-
getTargetEntityId
int getTargetEntityId()
- Returns:
- the entity ID of the current homing/tracking target, or -1 if none
-
getTarget
IEntity getTarget()
- Returns:
- the current homing/tracking target entity, or null if none
-
setTarget
void setTarget(IEntity target)
Sets the homing/tracking target entity. Pass null to clear.- Parameters:
target- the entity to home towards
-
getSize
float getSize()
- Returns:
- the projectile's visual and collision size
-
setSize
void setSize(float size)
Sets the projectile's visual and collision size.- Parameters:
size- the projectile size
-
getRotationSpeed
float getRotationSpeed()
- Returns:
- the visual rotation speed (degrees per tick)
-
setRotationSpeed
void setRotationSpeed(float speed)
-
getInterpolatedRotationX
float getInterpolatedRotationX(float partialTicks)
-
getInterpolatedRotationY
float getInterpolatedRotationY(float partialTicks)
-
getInterpolatedRotationZ
float getInterpolatedRotationZ(float partialTicks)
-
getInterpolatedSize
float getInterpolatedSize(float partialTicks)
-
getMaxDistance
float getMaxDistance()
- Returns:
- maximum travel distance before the projectile despawns (0 = unlimited)
-
setMaxDistance
void setMaxDistance(float distance)
-
getMaxLifetime
int getMaxLifetime()
- Returns:
- maximum lifetime in ticks before the projectile despawns (0 = unlimited)
-
setMaxLifetime
void setMaxLifetime(int ticks)
-
getDamage
float getDamage()
- Returns:
- base damage dealt on hit
-
setDamage
void setDamage(float damage)
-
getKnockback
float getKnockback()
- Returns:
- horizontal knockback strength
-
setKnockback
void setKnockback(float knockback)
-
getKnockbackUp
float getKnockbackUp()
- Returns:
- upward knockback strength
-
setKnockbackUp
void setKnockbackUp(float knockbackUp)
-
isExplosive
boolean isExplosive()
- Returns:
- true if the projectile explodes on impact
-
setExplosive
void setExplosive(boolean explosive)
-
getExplosionRadius
float getExplosionRadius()
- Returns:
- explosion radius (only used if
isExplosive()is true)
-
setExplosionRadius
void setExplosionRadius(float radius)
-
getExplosionDamageFalloff
float getExplosionDamageFalloff()
- Returns:
- damage falloff multiplier over explosion radius (0 = no falloff, 1 = full falloff)
-
setExplosionDamageFalloff
void setExplosionDamageFalloff(float falloff)
-
getHitType
int getHitType()
- Returns:
- hit behavior type (0 = single hit, 1 = pierce, 2 = multi-hit with delay)
-
setHitType
void setHitType(int hitType)
-
getMultiHitDelayTicks
int getMultiHitDelayTicks()
- Returns:
- ticks between multi-hit damage ticks on the same entity
-
setMultiHitDelayTicks
void setMultiHitDelayTicks(int delayTicks)
-
getMaxHits
int getMaxHits()
- Returns:
- maximum number of entities this projectile can hit (0 = unlimited)
-
setMaxHits
void setMaxHits(int maxHits)
-
getSpeed
float getSpeed()
- Returns:
- travel speed (blocks per tick)
-
setSpeed
void setSpeed(float speed)
-
isHoming
boolean isHoming()
- Returns:
- true if the projectile homes toward its target
-
setHoming
void setHoming(boolean homing)
-
getHomingStrength
float getHomingStrength()
- Returns:
- how aggressively the projectile turns toward its target (higher = tighter turns)
-
setHomingStrength
void setHomingStrength(float strength)
-
getHomingRange
float getHomingRange()
- Returns:
- maximum range at which homing will acquire/track a target
-
setHomingRange
void setHomingRange(float range)
-
getAnchor
int getAnchor()
- Returns:
- anchor point type used during the charge/windup phase
-
getAnchorOffsetX
float getAnchorOffsetX()
-
getAnchorOffsetY
float getAnchorOffsetY()
-
getAnchorOffsetZ
float getAnchorOffsetZ()
-
getStartX
double getStartX()
- Returns:
- X coordinate where the projectile was launched from
-
getStartY
double getStartY()
- Returns:
- Y coordinate where the projectile was launched from
-
getStartZ
double getStartZ()
- Returns:
- Z coordinate where the projectile was launched from
-
hasHit
boolean hasHit()
- Returns:
- true if the projectile has hit something
-
getEnergyType
int getEnergyType()
Returns the energy projectile sub-type.- Returns:
- 0=Orb, 1=Beam, 2=Disc, 3=Laser, 4=Slicer
-
syncClient
void syncClient()
Sends all current visual, movement, and position data to tracking clients.Call this after making batch changes to properties like size, speed, homing, colors, or type-specific fields (beam width, disc radius, etc.). This avoids sending a separate packet for every setter call.
Note:
fireAt(),fireDirection(), andfireFrom()automatically sync motion when called on an already-spawned projectile, so you do not need to callsyncClient()after firing. Use this method when changing properties that affect rendering or movement behavior without re-firing.Example:
orb.setSize(2.0); orb.setSpeed(0.5); orb.setInnerColor(0xFF0000); orb.syncClient(); // one packet for all changes
-
fireAt
void fireAt(IEntity target)
Spawns the projectile and launches it from its current position toward the target entity.No look-vector repositioning occurs — the projectile fires from exactly where it was placed by
createOrb/createBeam/etc. If the target is a living entity, it is also set as the homing target for projectiles with homing enabled.To launch from the owner's eye position with look-vector snapping, use
fireFrom(IEntityLivingBase, IEntity)instead.- Parameters:
target- the entity to fire toward (can be null for untargeted launch)
-
fireAt
void fireAt(double x, double y, double z)Spawns the projectile and launches it toward the specified world coordinates.The projectile fires from its current position — no look-vector repositioning occurs. Motion is calculated as a normalized direction vector scaled by the projectile's speed.
- Parameters:
x- target X coordinatey- target Y coordinatez- target Z coordinate
-
fireDirection
void fireDirection(float yaw, float pitch)Spawns the projectile and launches it in the specified yaw/pitch direction.The projectile fires from its current position — no look-vector repositioning occurs.
- Parameters:
yaw- horizontal angle in degrees (0 = south, 90 = west, like Minecraft yaw)pitch- vertical angle in degrees (negative = up, positive = down)
-
fireFrom
void fireFrom(IEntityLivingBase caster)
Sets the owner, positions the projectile at the caster's eye level, and launches it using the entity's full launch sequence (startMoving/startFiring).For player-owned projectiles, this snaps the projectile to the owner's look-vector position and fires in the caster's look direction. This is the intended method for "cast from self" behavior. The projectile's position set by
createOrb/etc. is overridden.Use
fireAt(IEntity)orfireAt(double, double, double)instead if you want to launch from a specific custom position.- Parameters:
caster- the entity to fire from
-
fireFrom
void fireFrom(IEntityLivingBase caster, IEntity target)
Sets the owner, positions the projectile at the caster's eye level, and launches it toward the target entity using the entity's full launch sequence.For player-owned projectiles, this snaps the projectile to the owner's look-vector position before firing toward the target. The projectile's position set by
createOrb/etc. is overridden.Use
fireAt(IEntity)instead if you want to launch from a specific custom position.- Parameters:
caster- the entity to fire fromtarget- the entity to fire toward
-
-