Skip to content

FireworksHelper ​

com.jsmacrosce.jsmacros.client.api.helper.inventory.FireworksHelper

Since2.3.0

Reads a rocket's flight duration and the explosions it carries.

js
const rocket = Player.getPlayer()?.getMainHand().getComponents().getFireworks();  
if (rocket != null) {
 Chat.log(`Flight duration ${rocket.getFlightDuration()}; ${rocket.getExplosions().size()} explosions`);  
}

Methods ​

getExplosions ​

getExplosions(): List<FireworkExplosionHelper>#
Returns: the explosions in the order stored on the rocket

getFlightDuration ​

getFlightDuration(): int#
Returns: the flight duration shown in the rocket tooltip, rather than its lifetime in ticks