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

PlaceholderDescription

Gives you an output depending on another placeholder

Various statistics about a player

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:

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

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:}_LEATHER\_HELMET_10_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_LEATHER\_CHESTPLATE_30_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_LEATHER\_LEGGINGS_20_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_LEATHER\_BOOTS_10_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_IRON\_HELMET_20_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_IRON\_CHESTPLATE_50_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_IRON\_LEGGINGS_30_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_IRON\_BOOTS_20_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_DIAMOND\_HELMET_30_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_DIAMOND\_CHESTPLATE_70_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_DIAMOND\_LEGGINGS_50_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_DIAMOND\_BOOTS_30_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:39_mat:}_NETHERITE\_HELMET_40_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:38_mat:}_NETHERITE\_CHESTPLATE_100_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:37_mat:}_NETHERITE\_LEGGINGS_80_0% %attacker%"
        - "INCREASE_DAMAGE:%changeoutput_equals_{victim checkitem_getinfo:36_mat:}_NETHERITE\_BOOTS_40_0% %attacker%"

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:

teleport:
  display: '%group-color%Teleport'
  description: 'Teleport 8 blocks into the direction you''re facing'
  applies-to: 'Swords'
  group: 'ULTRA'
  type: 'RIGHT_CLICK'
  applies:
    - ALL_SWORD
  levels:
    1:
      chance: 100
      cooldown: 0
      effects:
        - '%changeoutput_equals_{player_direction}_N_TELEPORT location=~0|0|-8_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_NE_TELEPORT location=~6|0|-6_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_E_TELEPORT location=~8|0|0_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_SE_TELEPORT location=~6|0|6_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_S_TELEPORT location=~0|0|8_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_SW_TELEPORT location=~-6|0|6_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_W_TELEPORT location=~-8|0|0_WAIT:0%'
        - '%changeoutput_equals_{player_direction}_NW_TELEPORT location=~-6|0|-6_WAIT:0%'

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

Last updated