LootFunction

loottweaker.vanilla.loot.LootFunction

Represents a loot function. Either created using a method of the Functions class, or automatically converted from a JSON format map by LootTweaker.

Methods

LootFunction addConditions(LootCondition[] conditions)

Adds conditions to this loot function

Parameters:

Returns:

the loot function this method was called on

import loottweaker.vanilla.loot.Conditions;

// someLootFunction is a LootFunction created elsewhere
someLootFunction.addConditions([
  {"condition": "killed_by_player"},
  Conditions.randomChance(0.5)
]);