-
-
Notifications
You must be signed in to change notification settings - Fork 0
Enchantment structure
name: 'Parkour'
trigger: 'PLAYERGOTHURT'
applicable: 'ARMOR_FEET'
forbid-on:
- LEATHER_BOOTS
- CHAINMAIL_BOOTS
conditions:
- CAUSED-BY-FALLING
levels:
'1':
conditions:
- DAMAGE-NON-LETHAL
chance: 15
cooldown: 5
action:
- 'player-set-health %player_health%+%damage% delay:1'
'2':
chance: 15
cooldown: 7
action:
- 'player-set-health %player_health%+%damage%+1 delay:1'
name: 'Parkour'
This is the line that indicates the name of the enchantment and will be used everywhere. This field is mandatory.
trigger: 'PLAYERGOTHURT'
This is the line that indicates the enchantment trigger - in other words, that is what should happen for the enchantment to activate. All of them with their respective actions and conditions are on this Wiki. This field is mandatory.
applicable: 'ARMOR_FEET'
This is what the enchantment can be applied to when using an enchantment table. The list of applicables can be found here. This field is mandatory.
forbid-on:
- LEATHER_BOOTS
- CHAINMAIL_BOOTS
This is the list of materials that will not activate the enchantment. This means that you can still enchant them with this enchantment, but it will never activate. This can be misleading to players that use the enchantment table, so it's not something you should use often and without explanation. The list of materials can be found here. This field is optional.
conditions:
- CAUSED-BY-FALLING
This is the list of conditions that must be met for the enchantment to be activated. The list of global conditions can be found here, but per-trigger conditions can also be used, and they can be found on this Wiki. This field is optional.
levels:
This is a start of a configuration section, containing the enchantment levels. This field is mandatory.
'1':
This is the level number. It's best to keep them in order (1, 2, 3, 4, etc.), because otherwise the plugin behaviour is unpredictable. The first level is mandatory.
conditions:
- DAMAGE-NON-LETHAL
This is the list of conditions for the respective level (here - the first level) that must be met for the enchantment to be activated. The list of global conditions can be found here, but per-trigger conditions can also be used, and they can be found on this Wiki. This field is optional.
chance: 15
This is the chance of the enchantment activating. chance: 15
means that there's a 15% chance for it to be activated. This field is optional, and not using it will just make the enchantment have a 100% chance to activate.
cooldown: 5
This is a cooldown in seconds. More information about it here. This field is optional.
action:
- 'player-set-health %player_health%+%damage% delay:1'
This is the list of actions for a level. Everything here will be done as long as the conditions are met, the cooldown is over and the chance is fulfilled. For every level, this field is mandatory.
'2':
This is the second level, and it is optional - an enchantment can have from 1 to any amount of levels (as long as you have enough storage, memory and the number is in integer limit bounds, of course).
You might have noticed some gimmicks, such as placeholders (%player_health%
), arithmetic expressions (%damage%+1
) and delays (delay:1
). To learn more, check this page out.
- Armor equip: Trigger, conditions
- Player bow hit: Trigger, conditions
- Player break block: Trigger, conditions
- Player break item: Trigger, conditions
- Player eat: Trigger, conditions
- Player got hurt: Trigger, conditions
- PVP (Player hit player): Trigger, conditions
- Player hurt entity: Trigger, conditions
- Player interact: Trigger, conditions
- Player move: Trigger, conditions
- Player RMB entity: Trigger, conditions
- Player shoot bow: Trigger, conditions
- Player toggle sneak: Trigger, conditions