mojira.dev
MC-306996

Function 'enchant_with_levels' fails to acknolwedge stated values

Use of the function enchant_with_levels doesn’t operate as intended. The enchantment, level, and cost are all ignored:

{
  "additional_wants": {
    "id": "minecraft:book"
  },
  "double_trade_price_enchantments": "#minecraft:double_trade_price",
  "given_item_modifiers": [
    {
      "function": "minecraft:enchant_with_levels",
      "levels": 5,
      "include_additional_cost_component": true,
      "options": "minecraft:smite"
    }
  ],
  "gives": {
    "id": "minecraft:enchanted_book"
  },
  "max_uses": 12,
  "reputation_discount": 0.2,
  "wants": {
    "count": 0,
    "id": "minecraft:emerald"
  },
  "xp": 5
}

The result of this will produce a trade of 1 enchanted book (without enchantment) for the rigid cost of 5 emeralds. (Shown in attached file).

While the following example, using `enchant_randomly' produces the desired enchantment, at an appropriate cost:

{
  "additional_wants": {
    "id": "minecraft:book"
  },
  "double_trade_price_enchantments": "#minecraft:double_trade_price",
  "given_item_modifiers": [
    {
      "function": "minecraft:enchant_randomly",
      "include_additional_cost_component": true,
      "only_compatible": false,
      "options": "minecraft:smite"
    }
  ],
  "gives": {
    "id": "minecraft:enchanted_book"
  },
  "max_uses": 12.0,
  "reputation_discount": 0.2,
  "wants": {
    "count": 0.0,
    "id": "minecraft:emerald"
  }
}

The only difference between these two examples are in lines 8-11.

Attached are the datapack of both the non-properly functioning ‘enchant_with_levels’ and the functioning '

Again, it appears the enchant_with_levels is ignoring the required values for`level`,`options`, and include_additional_cost_component.

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media][media]

You mistakenly wrote enchanted_book in the gives section when it should be book.

Dumb Bunny

(Unassigned)

Unconfirmed

(Unassigned)

26.1 Release Candidate 2

Retrieved