Options
All
  • Public
  • Public/Protected
  • All
Menu

Object representing the list of function that are applied to a specific item generated in loot table. Returned by LootEntry.beginFunctions.

These functions are described like JSON objects, there are 22 of them pre-defined in vanilla, however, since Kernel Extension 3.0, you can create your functions with a behavior without any limits, defined in JS or Java code, using KEX.LootModule.registerCustomLootFunction or KEX.LootModule.registerCustomLootFunctionJS.

since

1.0

Hierarchy

  • LootEntryFunctions

Index

Methods

  • addEnchantBookForTradingFunction(baseCost: number, baseRandomCost: number, perLevelCost: number, perLevelRandomCost: number): LootEntryFunctions
  • since

    1.0

    Parameters

    • baseCost: number
    • baseRandomCost: number
    • perLevelCost: number
    • perLevelRandomCost: number

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • Adds function that enchants the item with random enchantments that are legal for the current item, with given chance (between 0.0 and 1.0).

    since

    1.0

    Parameters

    • Optional chance: number

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • Adds function that applies random enchantments to the item.

    since

    1.0

    Parameters

    • Optional treasure: boolean

      if true, the item is enchanted only with enchantments that are considered as treasures, like frost walking, mending, soul speed etc.

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • addEnchantWithLevelsFunction(levels: number, treasure?: boolean): LootEntryFunctions
  • addEnchantWithLevelsFunction(minLevels: number, maxLevels: number, treasure?: boolean): LootEntryFunctions
  • Adds function that enchants the item using given amount of experience levels, similar to how it works in enchantment table.

    since

    1.0

    Parameters

    • levels: number
    • Optional treasure: boolean

      if true, the item is enchanted only with enchantments that are considered as treasures, like frost walking, mending, soul speed etc.

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • Adds function that enchants the item using amount of experience levels, chosen randomly between given minimum and maximum values, similar to how it works in enchantment table.

    since

    1.0

    Parameters

    • minLevels: number
    • maxLevels: number
    • Optional treasure: boolean

      if true, the item is enchanted only with enchantments that are considered as treasures, like frost walking, mending, soul speed etc.

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • Adds function that turns empty map item into exploration map pointing to the nearest generated structure of given type.

    since

    1.0

    Parameters

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • addSpecificEnchantsFunction(enchants: { aqua_affinity: number; bane_of_arthropods: number; binding_curse: number; blast_protection: number; channeling: number; depth_strider: number; efficiency: number; feather_falling: number; fire_aspect: number; fire_protection: number; flame: number; fortune: number; frost_walker: number; impaling: number; infinity: number; knockback: number; looting: number; loyalty: number; luck_of_the_sea: number; lure: number; mending: number; power: number; projectile_protection: number; protection: number; punch: number; respiration: number; riptide: number; sharpness: number; silk_touch: number; smite: number; thorns: number; unbreaking: number; vanishing_curse: number }): LootEntryFunctions
  • addSpecificEnchantsFunction(enchants: Map<String, number>): LootEntryFunctions
  • Adds function that applies the specified enchantments to the item.

    since

    3.0

    Parameters

    • enchants: { aqua_affinity: number; bane_of_arthropods: number; binding_curse: number; blast_protection: number; channeling: number; depth_strider: number; efficiency: number; feather_falling: number; fire_aspect: number; fire_protection: number; flame: number; fortune: number; frost_walker: number; impaling: number; infinity: number; knockback: number; looting: number; loyalty: number; luck_of_the_sea: number; lure: number; mending: number; power: number; projectile_protection: number; protection: number; punch: number; respiration: number; riptide: number; sharpness: number; silk_touch: number; smite: number; thorns: number; unbreaking: number; vanishing_curse: number }

      specific enchantments to apply to the item, represented as a JS object with keys - enchantment string names and values - their levels.

      • aqua_affinity: number
      • bane_of_arthropods: number
      • binding_curse: number
      • blast_protection: number
      • channeling: number
      • depth_strider: number
      • efficiency: number
      • feather_falling: number
      • fire_aspect: number
      • fire_protection: number
      • flame: number
      • fortune: number
      • frost_walker: number
      • impaling: number
      • infinity: number
      • knockback: number
      • looting: number
      • loyalty: number
      • luck_of_the_sea: number
      • lure: number
      • mending: number
      • power: number
      • projectile_protection: number
      • protection: number
      • punch: number
      • respiration: number
      • riptide: number
      • sharpness: number
      • silk_touch: number
      • smite: number
      • thorns: number
      • unbreaking: number
      • vanishing_curse: number

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

  • Adds function that applies the specified enchantments to the item.

    since

    1.0

    Parameters

    • enchants: Map<String, number>

      specific enchantments to apply to the item, represented as a java.util.Map with keys - enchantment string names and values - their levels.

    Returns LootEntryFunctions

    reference to itself to be used in sequential calls

Generated using TypeDoc