mojira.dev
MC-313516

The `enchant_randomly` and `enchant_with_levels` loot functions remove the custom names of books

The Bug:

The enchant_randomly and enchant_with_levels loot functions remove the custom names of books.

Enchanting a named book in an enchanting table or with the set_enchantments loot function keeps its custom name. However, the enchant_randomly and enchant_with_levels loot functions replace books with new enchanted books that have no custom name, therefore introducing an inconsistency.

Steps to Reproduce:

  1. Obtain a book and rename it in an anvil.

  2. Hold the book in your main hand and enchant it by using the command provided below.

    /item modify entity @s weapon.mainhand {type:"minecraft:enchant_randomly",options:"minecraft:unbreaking"}
  3. Observe if the enchanted book still has its custom name.

Observed Behavior:

The enchant_randomly and enchant_with_levels loot functions remove the custom names of books.

Expected Behavior:

The enchant_randomly and enchant_with_levels loot functions would keep the custom names of books.

Attachments

Comments 1

Avoma

(Unassigned)

Unconfirmed

Commands, Data Packs, Loot tables

26.3, 26.4 Snapshot 10

Retrieved