Coder Social home page Coder Social logo

inxomnyaa / fireworks Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 5.0 171 KB

Adds Fireworks to Pocketmine

Home Page: https://poggit.pmmp.io/ci/thebigsmileXD/fireworks/~

License: MIT License

PHP 100.00%
firework fireworks rocket rockets explosions pocketmine pocketmine-plugins

fireworks's Introduction

Deprecated

Check out https://github.com/BlockHorizons/Fireworks/ for an up to date firework plugin, including a simple API!

plugin icon

fireworks

Adds Fireworks to Pocketmine

Its simply adding firework items and entities into PocketMine-MP servers.

You can launch any firework from the creative inventory AND custom ones - just like in vanilla MCPE.

How to get a firework

Either, give a firework via gamemode 1, or /give command. For generating the /give command i suggest using: https://mcstacker.bimbimma.com/mcstacker1.10.php and modifying the command to work with PocketMine-MP. This is not easy. No need to explain further.

The easier way is to use the code to create custom fireworks. See Create a custom firework for that.

Create a custom firework

This is sample code to explain the "API"-alike part of the plugin, giving 2 custom fireworks:

Without special explosions:

		$data = new FireworksData();
		$data->flight = 2;//flight time. default is 1
		$firework = new Fireworks();
		$nbt = Fireworks::ToNbt($data);//create the compound tag
		$firework->setNamedTag($nbt);//modify the item's compound tag
		$event->getPlayer()->getInventory()->addItem($firework);//give the item to a player (this case: PlayerJoinEvent $event)

With special explosions

		$explosion = new FireworksExplosion();//init an explosion
		$explosion->fireworkColor = [4, 4, 4];//set the color to custom colors
		$explosion->fireworkFade = [5, 5, 5];//set the fade color to custom colors
		$explosion->fireworkFlicker = true;//enable the flickering
		$explosion->fireworkTrail = false;//enable the trail
		$explosion->fireworkType = 4;//set the shape/type of the firework
		$data = new FireworksData();//create the generic data
		$data->flight = 2;
		$data->explosions[] = $explosion;//add the explosion
		$firework = new Fireworks();
		$nbt = Fireworks::ToNbt($data);
		$firework->setNamedTag($nbt);
		$event->getPlayer()->getInventory()->addItem($firework);

fireworks's People

Contributors

inxomnyaa avatar poggit-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fireworks's Issues

Error

DataPropertyManager -> setItem is not a function

Update

Please update to ALPHA12.

update

pleace update the plugin!!!

Update

image
Can you update to the new PMMP API ?

Console crashes with the crashdump while using fireworks

Latest version of pmmp

Error: Declaration of xenialdan\fireworks\FakeDataPacket::putEntityMetadata(array $metadata) must be compatible with pocketmine\network\mcpe\NetworkBinaryStream::putEntityMetadata(array $metadata): void
File: fireworks-master/src/xenialdan/fireworks/FakeDataPacket
Line: 152
Type: E_COMPILE_ERROR

Another error while starting a server in console

Latest version PocketMine-MP 1.7dev-656 ใ€Œ[REDACTED]ใ€ implementing API version 3.0.0-ALPHA10 for Minecraft: PE v1.2.7 (protocol version 160)

[Server thread/CRITICAL]: ErrorException: "Declaration of xenialdan\fireworks\item\Fireworks::onActivate(pocketmine\level\Level $level, pocketmine\Player $player, pocketmine\block\Block $blockReplace, pocketmine\block\Block $blockClicked, int $face, pocketmine\math\Vector3 $clickVector): bool should be compatible with pocketmine\item\Item::onActivate(pocketmine\Player $player, pocketmine\block\Block $blockReplace, pocketmine\block\Block $blockClicked, int $face, pocketmine\math\Vector3 $clickVector): bool" (EXCEPTION) in "fireworks-master/src/xenialdan/fireworks/item/Fireworks" at line 77

Error using last PMMP relase for 1.12

[Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\entity\DataPropertyManager::setItem()" (EXCEPTION) in "plugins/fireworks-master/src/xenialdan/fireworks/entity/FireworksRocket" at line 42

Its not working

Theres no error in console, i try in game, its not working

Color

how i can give me red custom fireworks?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.