Class EnchantmentLevelEntry

java.lang.Object
net.minecraft.util.collection.WeightedPicker.Entry
net.minecraft.enchantment.EnchantmentLevelEntry

public class EnchantmentLevelEntry
extends WeightedPicker.Entry
Represents an entry in an enchantments array, i.e. a pair between enchantment and level. This is also a weighted entry and is available for the weighted picker to pick from a list.

This is usually used where multiple enchantment to level mappings can exist, such as in enchanting logic. In other cases, vanilla prefers Map<Enchantment, Integer> over List<EnchantmentLevelEntry>.

This class is immutable. It does not override hashCode or equals.

  • Field Details

    • enchantment

      public final Enchantment enchantment
    • level

      public final int level
  • Constructor Details

    • EnchantmentLevelEntry

      public EnchantmentLevelEntry​(Enchantment enchantment, int level)