Skip to content

FireworkRocket ​

class · pocketmine\item\FireworkRocket · source

Extends Item

Constants ​

TAG_EXPLOSIONS ​

php
public const TAG_EXPLOSIONS = "Explosions"

TAG_FIREWORK_DATA ​

php
public const TAG_FIREWORK_DATA = "Fireworks"

TAG_FLIGHT_TIME_MULTIPLIER protected ​

php
protected const TAG_FLIGHT_TIME_MULTIPLIER = "Flight"

Properties ​

$explosions protected ​

php
protected array $explosions

$flightTimeMultiplier protected ​

php
protected int $flightTimeMultiplier

Methods ​

deserializeCompoundTag() protected ​

php
protected function deserializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

getExplosions() ​

php
public function getExplosions() : array

getFlightTimeMultiplier() ​

php
public function getFlightTimeMultiplier() : int

Returns the value that will be used to calculate a randomized flight duration for the firework (equals the amount of gunpowder used in crafting the rocket).

The higher this value, the longer the flight duration.

getRandomFlightDuration() 5.46.0 protected ​

php
protected function getRandomFlightDuration() : int

Returns a random flight duration in ticks: (flight + 1) * 10 + 0..12, as vanilla (https://minecraft.wiki/w/Firework_Rocket: (flight + 1) * 10 + rand(0..5) + rand(0..6)).

onClickAir() 5.46.0 ​

php
public function onClickAir(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $directionVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

Using a firework in the air while gliding with an elytra boosts the player for the firework's flight duration.

onInteractBlock() ​

php
public function onInteractBlock(\pocketmine\player\Player $player, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

serializeCompoundTag() protected ​

php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

setExplosions() ​

php
public function setExplosions(array $explosions) : self

setFlightTimeMultiplier() ​

php
public function setFlightTimeMultiplier(int $multiplier) : self

Sets the value that will be used to calculate a randomized flight duration for the firework.

The higher this value, the longer the flight duration.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.