EternalTD
Java reference for EternalTD build version 1.7.5. Generated from source commit 54adcbb295d8. This reference describes that checkout, not a separate release.
Integration guide · All Java APIs · Source repository
Documented public and protected declarations include implementation types. Use the integration guide to choose extension points; visibility alone does not promise API stability.
Generated Java reference includes searchable classes, methods and signatures, with the source version and commit recorded for each module.
EternalTD exposes custom Bukkit events under com.magmaguy.eternaltd.api that other plugins can listen to for integration.
Tower Events
These events fire when a player interacts with towers during a level session.
| Event | Cancellable | Exposed data |
|---|---|---|
TowerPlaceEvent | Yes | Tower tower |
TowerSellEvent | Yes | Tower tower |
TowerUpgradeEvent | Yes | Tower tower |
Cancelling a tower event prevents the action from completing.
TowerPlaceEvent runs after the tower's grid square has been assigned, but before its living entity is spawned, its cost is charged or it is added to the session's tower set. Do not assume getLivingEntity() is available in that callback. Upgrade and sell events run before the corresponding currency change and tower mutation.
Wave Phase Events
These events fire during wave lifecycle transitions. None of them are cancellable.
| Event | Exposed data |
|---|---|
WaveConstructionPhaseStartEvent | LevelSession levelSession |
WaveStartingPhaseStartEvent | LevelSession levelSession |
WaveDefensivePhaseEvent | LevelSession levelSession |
WaveEndingPhaseEvent | LevelSession levelSession |
WaveStartingPhaseStartEvent fires when the session enters its initial waiting-for-start state. WaveConstructionPhaseStartEvent fires between waves. WaveDefensivePhaseEvent is dispatched before the session increments to the next wave number, so reading the number during that callback returns the preceding value. Despite its name, WaveEndingPhaseEvent fires when the session ends, not after every completed wave.
During the starting event, the session has not yet been added to LevelSession.getSessions() or marked playable; use the session provided by the event. During the ending event, player-state recovery and current-wave shutdown have run, but the session is still registered and its towers and instance world have not yet been cleaned up.
Wave Entity Events
These events fire when wave entities take damage or die.
| Event | Cancellable | Exposed data |
|---|---|---|
WaveEntityDamageEvent | No | Tower tower, WaveEntity waveEntity, boolean directDamage |
WaveEntityDeathEvent | No | WaveEntity waveEntity |
WaveEntityDamageEvent is a notification, not a damage-editing hook: it has no amount setter. An AOE direct hit emits it to trigger splash processing without applying a separate direct hit. For ordinary damage, nonlethal hits emit the damage event after health changes; lethal hits emit WaveEntityDeathEvent instead, after the entity has been removed. Fully armor-absorbed direct damage emits neither immediately; separately scheduled damage over time can emit later events.
Usage Example
import com.magmaguy.eternaltd.api.TowerPlaceEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
public class MyETDIntegration implements Listener {
@EventHandler
public void onTowerPlace(TowerPlaceEvent event) {
// React to tower placement
}
}Notes
All events are standard synchronous Bukkit events.
TowerandWaveEntityare EternalTD internal types. Use their public getters for data access.LevelSessionexposes the wave number, towers and config through getters. Access its player throughgetMatchPlayer().getPlayer().