Mojira Archive
MC-271641

"post_attack" not applying min and max amplifier for data driven enchantments

Description:
The post effect module for Data Driven enchantments, specifically the `min_amplifier` and `max_amplifier` property, is not being applied. This issue was observed with the "Bane of Arthropods" enchantment and also custom enchantments.

Steps to Reproduce:
1. Give a player a sword enchanted with "Bane of Arthropods":

give @s minecraft:diamond_sword[minecraft:enchantments={"minecraft:bane_of_arthropods":1}]

2. Inflict damage to a monster.
3. Check the active potion effects on the monster:

data get entity <Selector> active_effects

4. Notice that the potion effect amplification is not being applied.

Current code :

{
  "anvil_cost": 2,
  "description": {
    "translate": "enchantment.minecraft.bane_of_arthropods"
  },
  "effects": {
    "minecraft:damage": [
      {
        "effect": {
          "type": "minecraft:add",
          "value": {
            "type": "minecraft:linear",
            "base": 2.5,
            "per_level_above_first": 2.5
          }
        },
        "requirements": {
          "condition": "minecraft:entity_properties",
          "entity": "this",
          "predicate": {
            "type": "#minecraft:sensitive_to_bane_of_arthropods"
          }
        }
      }
    ],
    "minecraft:post_attack": [
      {
        "affected": "victim",
        "effect": {
          "type": "minecraft:apply_mob_effect",
          "max_amplifier": 3.0,
          "max_duration": {
            "type": "minecraft:linear",
            "base": 1.5,
            "per_level_above_first": 0.5
          },
          "min_amplifier": 3.0,
          "min_duration": 1.5,
          "to_apply": "minecraft:slowness"
        },
        "enchanted": "attacker",
        "requirements": {
          "condition": "minecraft:entity_properties",
          "entity": "this",
          "predicate": {
            "type": "#minecraft:sensitive_to_bane_of_arthropods"
          }
        }
      }
    ]
  },
  "exclusive_set": "#minecraft:exclusive_set/damage",
  "max_cost": {
    "base": 25,
    "per_level_above_first": 8
  },
  "max_level": 5,
  "min_cost": {
    "base": 5,
    "per_level_above_first": 8
  },
  "primary_items": "#minecraft:enchantable/sword",
  "slots": [
    "mainhand"
  ],
  "supported_items": "#minecraft:enchantable/weapon",
  "weight": 5
}

Duplicate

Hardel

2024-05-05, 08:36 PM

2024-05-31, 12:41 PM

2024-05-31, 12:36 PM

3

3

Unconfirmed

(Unassigned)

24w18a

-