Minecraft Plugins 5: CustomEnchantments

Planning
Step 1
In this lesson we will make a sword enchanted with "Life Steal"
Planning
Step 2
Let's take a look at the "Life Steal" enchantment in action:

When you hit an enemy with the enchanted sword you gain health!

Step 3
Let's begin by importing all of the packages we are going to use in this plugin.
Step 4
Next we will create the custom crafting recipe for our enchanted sword.

This code will allow us to add the "Life Steal" enchantment to any type of sword by combining it with two blaze rods!

Step 5
Now we need to make something special happen if the player attacks something with their enchanted sword.

This code will restore health to the player if they damage an entity with the sword enchanted with "Life Steal"

Step 6
Save your code! Then, set up your "plugin.yml" file.
Check Your Work
Step 7
Save, compile, deploy, and test!
Challenge
Step 8
CHALLENGE: Make the "Life Steal" recipe work on any type of axe!
Planning
Step 9
In the next lesson we will learn how to make a plugin that adds a trail of particle effects behind the player!

Try one of these lessons next:

Minecraft Plugins 5: CustomEnchantments 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