FireworkRocket
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 $flightTimeMultiplierMethods
deserializeCompoundTag() protected
php
protected function deserializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : voidgetExplosions()
php
public function getExplosions() : arraygetFlightTimeMultiplier()
php
public function getFlightTimeMultiplier() : intReturns 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() : intReturns 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\ItemUseResultUsing 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\ItemUseResultserializeCompoundTag() protected
php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : voidsetExplosions()
php
public function setExplosions(array $explosions) : selfsetFlightTimeMultiplier()
php
public function setFlightTimeMultiplier(int $multiplier) : selfSets the value that will be used to calculate a randomized flight duration for the firework.
The higher this value, the longer the flight duration.
