Minecraft Plugins 7: Fireworks

Planning
Step 1
Planning
Step 2
This is what we are going to be building:
Step 3
Begin by adding imports for the packages we are going to need for the plugin.
Step 4
Here is the body of the firework plugin. Make sure you read the red text and understand what each line is doing!
Step 5
Make sure you set up your plugin.yml file properly!

Refer to a previous plugin you've made if you need help remembering what to do.

Check Your Work
Step 6
Save, compile, deploy, reload, and test your fireworks!

You will need to be holding a "Firework Star" to spawn the fireworks.

Challenge
Step 7
CHALLENGE: Make your own firework by changing the attributes of the effect.

Here are links to the documentation for bukkit.FireworkEffect.Type and bukkit.Color.

Planning
Step 8
Spawning a single type of firework is cool, but a firework show with randomized effects is even cooler!

In the next part of the lesson you will learn how to randomize the effects of your fireworks.

Step 9
First add these package imports to the top of your file.
Step 10
Here we generate random integers and use them to set the type and color variables for the firework.
Step 11
Now we need to make sure we use the randomized variables we just created when we actually build the firework's effect.
Check Your Work
Step 12
Save, compile, deploy, reload, and make yourself a little firework show at night!
Planning
Step 13
In the next lesson we will learn how to create custom mobs!

Try one of these lessons next:

Minecraft Plugins 7: Fireworks Info

Account

MVCode

Created By

aaron

Access Level

public

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach