Guide on creating extremely advanced custom enchantments
Overview
Using Placeholders from PAPI, your able to make extremely complex enchantments that have 1 thing happen when a condition is met and a different thing happen when another condition is met all within one enchant level
Some examples of what you can make:
Enchant that teleports you in the direction your facing
Enchant that "marks" a player and deals extra damage to them
Deal more damage the higher the grade of the opponents armor
First step is to have an idea of what you want to make, in this example we will be making an enchant that increases how much damage you do depending on the type of armor the enemy is wearing.
Create your basic enchant with the correct information:
rampage:
display: "%group-color%Rampage"
description: "Deal more damage the higher the grade of enemy armor"
applies-to: "Weapons"
type: "ATTACK"
group: "LEGENDARY"
applies:
- ALL_SWORD
- ALL_AXE
levels:
1:
effects:
- "INCREASE_DAMAGE:100 %attacker%"
Figure out how to make it
You need to have an idea on how to make it, as in which placeholders to use, how to use it, and where to put it. In this enchant the damage increases depending on the enemy armor, so we'll need to check for the armor of the enemy. To do that we'll use the CheckItem placeholder. We use the ChangeOutput placeholder so if the enemy is wearing Diamond Armor, we get an output, such as increase damage by 100%, otherwise 0%.
Placeholders
Most Complex Enchants will need the ChangeOutput placeholder, so it's recommended to learn how it works.
Adding a victim before the checkitem placeholder checks the victim's helmet slot, and we can put that result in the ChangeOutput placeholder and compare it to see if it equals DIAMOND_HELMET, and if it does, have the ouput as 100%, and if it doesn't, have the ouput as 0% increased damage.
rampage:
display: "%group-color%Rampage"
description: "Deal more damage the higher the grade of enemy armor"
applies-to: "Weapons"
type: "ATTACK"
group: "LEGENDARY"
applies:
- ALL_SWORD
- ALL_AXE
levels:
1:
effects:
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_DIAMOND\_HELMET_100_0% %attacker%"
The DIAMOND_HELMET has an underscore, which would interfere with the changeoutput placeholder, so we add an \ to escape that
Adding each possibility
Now you have to add each armor piece that the enemy could be wearing and how much increased damage you want to have for those pieces. Also be sure to change anything else such as the slot of the inventory that your checking
Teleport can be further advanced by checking the players Yaw and Pitch, and teleporting the player upwards
Have your own enchantment you want to be showcased here? Let us know on our discord and we'll take a look at it.
If your interested in having someone make custom enchants for you, contact DuneSciFye on the discord support server