Options
All
  • Public
  • Public/Protected
  • All
Menu

Object representing the list of conditions of a loot pool. They are used when generating a list of randomly chosen items: the items will be chosen only if all the conditions pass. Returned by LootPool.beginConditions.

since

1.0

Hierarchy

  • LootConditions

Index

Methods

  • Adds a condition checking if the killed entity was on fire (or not if onFire parameter is set to false).

    since

    1.0

    Parameters

    • onFire: boolean

    Returns LootConditions

    reference to itself to be used in sequential calls

  • Adds a condition checking if the killed entity was on ground (or not if onGround parameter is set to false).

    since

    1.0

    Parameters

    • onGround: boolean

    Returns LootConditions

    reference to itself to be used in sequential calls

  • addEntityPropertiesCondition(onFire: boolean, onGround: boolean): LootConditions
  • Adds a condition checking the killed entity being on fire and on ground at the moment of its death.

    since

    1.0

    Parameters

    • onFire: boolean
    • onGround: boolean

    Returns LootConditions

    reference to itself to be used in sequential calls

  • Adds a condition checking if the entity was killed by a player.

    since

    1.0

    Returns LootConditions

    reference to itself to be used in sequential calls

  • Adds a condition checking if the entity was killed by a player or one of their pets.

    since

    1.0

    Returns LootConditions

    reference to itself to be used in sequential calls

  • Adds a condition checking the killed entity for a specific mark variant.

    Mark variant is a value used to be bound to some entity's visual properties or addon-defined component groups. In vanilla it's used, for example, in villagers' clothes depending on their biome, type of flower that was given to mooshroom, tropical fish skin pattern etc.

    since

    1.0

    Parameters

    • markVariant: number

    Returns LootConditions

    reference to itself to be used in sequential calls

  • Adds "not" condition, the condition that is met only if its sub-condition is not met

    since

    4.0

    Parameters

    • clause: LootConditions

      the sub-condition. Use LootModule.createConditionsList to create this object. If you specify more than one condition to this list, the "not(conditions[0])" structure will be automatically replaced with "not(and(...conditions))"

    Returns LootConditions

    reference to itself to be used in sequential calls

  • addRandomChanceCondition(chance: number, maxChance?: number): LootConditions
  • Adds a condition that passes only with the given chance. The chance can be specified with one fixed or two minimum and maximum values. Values must be between 0.0 (0%) and 1.0 (100%).

    since

    1.0

    Parameters

    • chance: number
    • Optional maxChance: number

    Returns LootConditions

    reference to itself to be used in sequential calls

  • addRandomChanceWithLootingCondition(chance: number, lootingMultiplier: number): LootConditions
  • Adds a condition that passes only with the given chance plus additional chance got from looting enchantment. Values must be between 0.0 (0%) and 1.0 (100%).

    since

    1.0

    Parameters

    • chance: number

      base chance of condition passing

    • lootingMultiplier: number

      value that will be added to the chance for each looting level

    Returns LootConditions

    reference to itself to be used in sequential calls

  • addRandomDifficultyChanceCondition(defaultChance: number, easy?: number, normal?: number, hard?: number, peaceful?: number): LootConditions
  • Adds a condition that passes only with one of given chances depending on the game difficulty. Values must be between 0.0 (0%) and 1.0 (100%).

    since

    1.0

    Parameters

    • defaultChance: number

      mandatory value that is used when some of the chance values for specific difficulty is not specified

    • Optional easy: number

      chance of condition passing on easy game difficulty

    • Optional normal: number

      chance of condition passing on normal game difficulty

    • Optional hard: number

      chance of condition passing on hard game difficulty

    • Optional peaceful: number

      chance of condition passing on peaceful game difficulty

    Returns LootConditions

    reference to itself to be used in sequential calls

  • addRandomRegionalDifficultyChanceCondition(maxChance: number): LootConditions
  • Adds a condition that passes only with the given chance multiplied by level's current special modifier, which formula is not known at the moment. The chance's value must be between 0.0 (0%) and 1.0 (100%).

    since

    1.0

    Parameters

    • maxChance: number

    Returns LootConditions

    reference to itself to be used in sequential calls

Generated using TypeDoc