Complex Enchantments
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
  • The possibilities are endless

Placeholders

The main placeholders you'll be using are
Placeholder
Description
Gives you an output depending on another placeholder
Player
Various statistics about a player
CheckItem
Checks Items in a players inventory

Getting Started

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:
1
rampage:
2
display: "%group-color%Rampage"
3
description: "Deal more damage the higher the grade of enemy armor"
4
applies-to: "Weapons"
5
type: "ATTACK"
6
group: "LEGENDARY"
7
applies:
8
- ALL_SWORD
9
- ALL_AXE
10
levels:
11
1:
12
effects:
13
- "INCREASE_DAMAGE:100 %attacker%"
Copied!

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.
1
rampage:
2
display: "%group-color%Rampage"
3
description: "Deal more damage the higher the grade of enemy armor"
4
applies-to: "Weapons"
5
type: "ATTACK"
6
group: "LEGENDARY"
7
applies:
8
- ALL_SWORD
9
- ALL_AXE
10
levels:
11
1:
12
effects:
13
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_DIAMOND\_HELMET_100_0% %attacker%"
Copied!
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
1
rampage:
2
display: "%group-color%Rampage"
3
description: "Deal more damage the higher the grade of enemy armor"
4
applies-to: "Weapons"
5
type: "ATTACK"
6
group: "LEGENDARY"
7
applies:
8
- ALL_SWORD
9
- ALL_AXE
10
levels:
11
1:
12
effects:
13
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_LEATHER\_HELMET_10_0% %attacker%"
14
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_LEATHER\_CHESTPLATE_30_0% %attacker%"
15
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_LEATHER\_LEGGINGS_20_0% %attacker%"
16
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_LEATHER\_BOOTS_10_0% %attacker%"
17
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_IRON\_HELMET_20_0% %attacker%"
18
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_IRON\_CHESTPLATE_50_0% %attacker%"
19
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_IRON\_LEGGINGS_30_0% %attacker%"
20
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_IRON\_BOOTS_20_0% %attacker%"
21
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_DIAMOND\_HELMET_30_0% %attacker%"
22
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_DIAMOND\_CHESTPLATE_70_0% %attacker%"
23
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_DIAMOND\_LEGGINGS_50_0% %attacker%"
24
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_DIAMOND\_BOOTS_30_0% %attacker%"
25
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_NETHERITE\_HELMET_40_0% %attacker%"
26
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_NETHERITE\_CHESTPLATE_100_0% %attacker%"
27
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_NETHERITE\_LEGGINGS_80_0% %attacker%"
28
- "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_NETHERITE\_BOOTS_40_0% %attacker%"
Copied!
And thats it! Of course, theres a lot more you can do such as adding more checks and other things, but thats the basic structure.

Other Examples

Here are some other examples made by us:
1
teleport:
2
display: '%group-color%Teleport'
3
description: 'Teleport 8 blocks into the direction you''re facing'
4
applies-to: 'Swords'
5
group: 'ULTRA'
6
type: 'RIGHT_CLICK'
7
applies:
8
- ALL_SWORD
9
levels:
10
1:
11
chance: 100
12
cooldown: 0
13
effects:
14
- '%changeoutput_equals_{player_direction}_N_TELEPORT location=~0|0|-8_WAIT:0%'
15
- '%changeoutput_equals_{player_direction}_NE_TELEPORT location=~6|0|-6_WAIT:0%'
16
- '%changeoutput_equals_{player_direction}_E_TELEPORT location=~8|0|0_WAIT:0%'
17
- '%changeoutput_equals_{player_direction}_SE_TELEPORT location=~6|0|6_WAIT:0%'
18
- '%changeoutput_equals_{player_direction}_S_TELEPORT location=~0|0|8_WAIT:0%'
19
- '%changeoutput_equals_{player_direction}_SW_TELEPORT location=~-6|0|6_WAIT:0%'
20
- '%changeoutput_equals_{player_direction}_W_TELEPORT location=~-8|0|0_WAIT:0%'
21
- '%changeoutput_equals_{player_direction}_NW_TELEPORT location=~-6|0|-6_WAIT:0%'
Copied!
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