Apollo
Developers
Modules
TNT Countdown

TNT Countdown Module

Overview

The TNT Countdown module allows you to interact with and set custom TNT timers for the TNT Countdown mod on Lunar Client.

  • Adds the ability to set per TNT timers to be displayed for players using the TNT Countdown mod.

This module will change the actual TNT fuse time on the server, not just the countdown displayed on the client.

Integration

public void setTntCountdownExample(Player viewer, ApolloEntity tntEntity, int ticks) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.tntCountdownModule.setTntCountdown(apolloPlayer, tntEntity, ticks));
}

setTntCountdown Parameters

  1. ApolloPlayer
    • The player or viewer you want to display the countdown to.
  2. ApolloEntity
    • The TNT entity you want the custom countdown to be displayed above.
  3. ticks
    • The amount of ticks the TNT entity has before exploding.

Applying your custom setTntCountdown to a TNT.

public void overrideTntCountdownExample(Player viewer) {
    Location location = viewer.getLocation();
    World world = viewer.getWorld();
    TNTPrimed entity = world.spawn(location, TNTPrimed.class);
 
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
 
    apolloPlayerOpt.ifPresent(apolloPlayer -> {
        ApolloEntity apolloEntity = new ApolloEntity(entity.getEntityId(), entity.getUniqueId());
        this.tntCountdownModule.setTntCountdown(apolloEntity, 200);
    });
}

Available options

  • TNT_TICKS

    • Set the amount of ticks before the TNT explodes.
    • Values
      • Type: Integer
      • Default: 80
      • Minimum: 1
  • OVERRIDE_CUSTOM_TICKS

    • Whether to override custom TNT explosion ticks.
    • Values
      • Type: Boolean
      • Default: false