Package noppes.npcs.api
Interface ITelegraphInstance
-
public interface ITelegraphInstanceA runtime instance of an active telegraph in the world. Represents a spawned telegraph with position, timing, and control methods.Instances are created when you call spawn() on an ITelegraph:
var telegraph = API.getTelegraphs().createCircle(5.0); var instance = telegraph.spawn(world, x, y, z); // Later... instance.remove(); // Remove the telegraph early
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfollowEntity(IEntity entity)Make this telegraph follow an entity.StringgetInstanceId()Get the unique instance ID.floatgetProgress()Get the progress from 0.0 (just started) to 1.0 (finished).intgetRemainingTicks()Get the remaining ticks before the telegraph expires.intgetTotalTicks()Get the total duration ticks.doublegetX()Get the current X position.doublegetY()Get the current Y position.floatgetYaw()Get the rotation yaw.doublegetZ()Get the current Z position.booleanisFollowing()Check if this telegraph is following an entity.booleanisWarning()Check if the telegraph is in the warning phase.voidlockPosition()Lock the telegraph at its current position.voidremove()Remove this telegraph immediately.voidsetPosition(double x, double y, double z)Set the position.voidstopFollowing()Stop following any entity and fix the current position.
-
-
-
Method Detail
-
getInstanceId
String getInstanceId()
Get the unique instance ID.- Returns:
- the unique instance identifier
-
getX
double getX()
Get the current X position.- Returns:
- the current X coordinate
-
getY
double getY()
Get the current Y position.- Returns:
- the current Y coordinate
-
getZ
double getZ()
Get the current Z position.- Returns:
- the current Z coordinate
-
getYaw
float getYaw()
Get the rotation yaw.- Returns:
- the rotation yaw in degrees
-
setPosition
void setPosition(double x, double y, double z)Set the position. Note: Only works for static telegraphs (not following an entity).- Parameters:
x- X coordinatey- Y coordinatez- Z coordinate
-
followEntity
void followEntity(IEntity entity)
Make this telegraph follow an entity. The telegraph position will update each tick to match the entity.- Parameters:
entity- the entity to follow
-
stopFollowing
void stopFollowing()
Stop following any entity and fix the current position.
-
isFollowing
boolean isFollowing()
Check if this telegraph is following an entity.- Returns:
- true if currently following an entity
-
getRemainingTicks
int getRemainingTicks()
Get the remaining ticks before the telegraph expires.- Returns:
- remaining ticks before expiration
-
getTotalTicks
int getTotalTicks()
Get the total duration ticks.- Returns:
- the total duration in ticks
-
getProgress
float getProgress()
Get the progress from 0.0 (just started) to 1.0 (finished).- Returns:
- progress from 0.0 (just started) to 1.0 (finished)
-
isWarning
boolean isWarning()
Check if the telegraph is in the warning phase.- Returns:
- true if in the warning phase
-
remove
void remove()
Remove this telegraph immediately. Sends a removal packet to all clients tracking it.
-
lockPosition
void lockPosition()
Lock the telegraph at its current position. Equivalent to calling stopFollowing().
-
-