CustomArmorProtection 1.0

Allows you to change received damage by type based on what player is wearing.

  1. saharNooby
    Native Minecraft Version:
    1.15
    Tested Minecraft Versions:
    • 1.8
    • 1.15
    Source Code:
    https://github.com/saharNooby/custom-armor-protection
    Languages Supported:
    English, Russian
    CustomArmorProtection allows you to modify received damage based on what items player is currently wearing. You can filter items by name, lore, type, armor color and CustomModelData. You can specify different modifiers for different types of damage (FIRE, LAVA, FALL, ATTACK, etc.), these modifiers can be either absolute or relative (percentage, for example '-30%').

    NOTE: This plugin is intended to work with already existing items. It means your armor items must be created by other means — either by other plugins (custom recipes, mob loot) or with Minecraft /give command.

    Examples include:
    • Long Fall Boots: blocks fall damage completely;
    • Better Diamond Armor set: blocks 5% damage per each worn part;
    • Nether Armor set: decreases lava and fire damage, but only when player is wearing full set;
    • Admin's head: blocks any damage.
    All these examples are available below or in the default config.

    Do not confuse modifiers from the plugin with vanilla attribute modifiers, they are completely independent concepts.

    Demonstration



    Commands
    • custom-armor-protection reload: reloads main config and messages file.
    • custom-armor-protection give <item id from plugin config>: creates an item which can be matched by specified item in config. This is intended for debug purposes, for example, to balance damage reduction. Do not use this command to create items for players to wear -- it has no support for complex lore, enchants and other features. See the note above.
    Short alias for custom-armor-protection is cap.

    Permissions
    • customarmorprotection.command.main.reload: Allows player to use /custom-armor-protection reload.
    • customarmorprotection.command.main.give: Allows player to use /custom-armor-protection give <item id>.
    Other features
    • You can disable anvil renaming for some items. This is useful to prevent players "breaking" items which are detected by custom name.
    • You can enable damage modification debug in config to see, what damage is changed by the plugin and why.
    Configuration

    Config is split into 2 parts — items and modifiers. In items section you can define criteria (nameContains, hasColor, etc.) for different armor items, for which modifiers will be applied. Modifiers section contains actual values and criteria for modifying damage (what items player must wear, permission).

    Below you can see examples of different armor items and sets.

    Long Fall Boots

    Long Fall Boots disable fall damage for anyone who is wearing it, given that they have permission some.permission.to.use.boots.
    Code (YAML):
    LongFallBoots:
     # Required item type. Can be string id or numerical id (before 1.13).
      hasType
    : LEATHER_BOOTS
      # Required string in item display name.
      # Color codes can be specified using either § or &.
      nameContains
    : '&dLong Fall Boots'
      # Required string in any line of item lore.
      loreContains
    : '&7Something'
      # Required leather armor color, must be quoted and represent HEX RGB color.
      hasColor
    : 'ffffff'
      # Required custom model data, since 1.14.
      hasCustomModelData
    : 123
    Damage modifier:
    Code (YAML):
    LongFallBoots:
     # Modifier is applied only if player is wearing this item.
      playerWearingAll
    : LongFallBoots
      # Modifier is applied only when player has this permission (permission is not checked for mobs).
      playerHasPermission
    : 'some.permission.to.use.boots'
      # Damage modifiers by damage type.
      modifyDamage
    :
       # Disables fall damage completely.
        FALL
    : -100%
    Better Diamond Armor set

    Better Diamond Armor set blocks 5% damage per each worn part.
    Code (YAML):
    BetterDiamondHelmet:
      hasType
    : DIAMOND_HELMET
      nameContains
    : '&eBetter Diamond Helmet'
    BetterDiamondChestplate
    :
      hasType
    : DIAMOND_CHESTPLATE
      nameContains
    : '&eBetter Diamond Chestplate'
    BetterDiamondLeggings
    :
      hasType
    : DIAMOND_LEGGINGS
      nameContains
    : '&eBetter Diamond Leggings'
    BetterDiamondBoots
    :
      hasType
    : DIAMOND_BOOTS
      nameContains
    : '&eBetter Diamond Boots'
    Damage modifier:
    Code (YAML):
    BetterDiamondArmor:
     # Modifier is applied when any of the specified items is worn.
      # It is applied independently for each matched worn item, so full set will give -20% protection.
      playerWearingAny
    : [BetterDiamondHelmet, BetterDiamondChestplate, BetterDiamondLeggings, BetterDiamondBoots]
      modifyDamage
    :
       # DEFAULT is a shortcut for all damage types which are not ignored by vanilla armor.
        DEFAULT
    : -5%
    Nether Armor set

    Nether Armor set, when worn, blocks fire tick damage (when player is burning, but not in fire or lava block) and significantly decreases direct fire and lava damage.
    Code (YAML):
    NetherHelmet:
      hasType
    : DIAMOND_HELMET
      nameContains
    : '&6Nether Helmet'
    NetherChestplate
    :
      hasType
    : DIAMOND_CHESTPLATE
      nameContains
    : '&6Nether Chestplate'
    NetherLeggings
    :
      hasType
    : DIAMOND_LEGGINGS
      nameContains
    : '&6Nether Leggings'
    NetherBoots
    :
      hasType
    : DIAMOND_BOOTS
      nameContains
    : '&6Nether Boots'
    Damage modifier:
    Code (YAML):
    NetherArmor:
     # Modifier is applied only if player is wearing all of these items.
      playerWearingAll
    : [NetherHelmet, NetherChestplate, NetherLeggings, NetherBoots]
      modifyDamage
    :
       # Disable fire tick damage (it's usually 1, so subtracting 1 gives us 0).
        # This is an example of absolute damage modifier.
        FIRE_TICK
    : -1
        # Decrease in-fire damage by 60%.
        FIRE
    : -60%
        # Decrease in-lava damage by 40%.
        LAVA
    : -40%
    Admin's head
    Code (YAML):
    HeadOfAdmin:
      hasType
    : PLAYER_HEAD
      nameContains
    : "&cAdmin's head"
    Damage modifier:
    Code (YAML):
    HeadOfAdmin:
      playerWearingAll
    : HeadOfAdmin
      modifyDamage
    :
       # ALL is shortcut for any type of damage.
        ALL
    : -100%

Recent Reviews

  1. CaptainFox123
    CaptainFox123
    5/5,
    Version: 1.0
    This plugin deserves more exposure. It's extremely useful if you're trying to make a custom survival/rpg/custom prison server. Thank you so much for this plugin!
    1. saharNooby
      Author's Response
      Thank you!