Adds new item by given string namespace and identifier to the loot table.
item count, can be fixed integer or object with minimum and maximum possible values
chance for this item to be dropped, value between 0.0 (0%) and 1.0 (100%)
number of rolls, defaults to 1 This method is actually a shortcut, which looks like this:
LootPool pool = this.createNewPool(rolls)
.addEntry()
.describeItem(namespace, identifier)
.setCount(count)
.setData(data)
.endEntry();
if(chance < 1.0f)
{
pool.beginConditions()
.addRandomChanceCondition(chance)
.endConditions();
}
return this;
reference to itself to be used in sequential calls
Adds new item by given numeric ID to the loot table.
item count, can be fixed integer or object with minimum and maximum possible values
chance for this item to be dropped, value between 0.0 (0%) and 1.0 (100%)
number of rolls, defaults to 1
This method is actually a shortcut, which looks like this:
LootPool pool = this.createNewPool(rolls)
.addEntry()
.describeItem(id)
.setCount(count)
.setData(data)
.endEntry();
if(chance < 1.0f)
{
pool.beginConditions()
.addRandomChanceCondition(chance)
.endConditions();
}
return this;
reference to itself to be used in sequential calls
Adds a callback called right after common modifications which you can use to modify the resulting loot table JSON object one more time, having access to all of its content.
function that provides you with loot table JSON object represented as a JS object, which you can modify how you wish
callback priority, the more it is, the earlier than other callbacks your callback will be called, default is 0
reference to itself to be used in sequential calls
Adds a callback called right after common modifications which you can use to modify the resulting loot table JSON object one more time, having access to all of its content.
function that provides you with loot table JSON object represented as an org.json.JSONObject instance, which you can modify how you wish
callback priority, the more it is, the earlier than other callbacks your callback will be called, default is 0
reference to itself to be used in sequential calls
Adds a callback called after common modifications and modify callbacks which you can use to read the resulting loot table JSON object after all modifications, in order to, for example, save some data from it for your personal needs
function that provides you with loot table JSON object represented as an org.json.JSONObject instance. Modifying it doesn't make any effect, because every callback is called using a copy of the loot table JSON object.
reference to itself to be used in sequential calls
Adds a callback called after common modifications and modify callbacks which you can use to read the resulting loot table JSON object after all modifications, in order to, for example, save some data from it for your personal needs
function that provides you with loot table JSON object represented as a JS object. Modifying it doesn't make any effect, because every callback is called using a copy of the loot table JSON object.
reference to itself to be used in sequential calls
Adds new loot pool to the loot table with 1 roll
LootPool object to describe the created pool
Adds new loot pool to the loot table with given number of rolls
LootPool object to describe the created pool
Adds new loot pool to the loot table with the number of rolls that is chosen randomly every time between given minimum and maximum value.
LootPool object to describe the created pool
whether the following LootModifier had the lock method called on it at least once
After calling this method, all the further modifications applied to the following LootModifier (basically all of its methods) will be ignored. Worth noticing that the LootModifier on which the lock method was called, cannot be unlocked.
reference to itself to be used in sequential calls
You can store loot table modification data as a JSON file of Minecraft loot table format, somewhere in your mod's directory. Here you specify the absolute path to this JSON file and all its contents will be added to the following LootModifier.
reference to itself to be used in sequential calls
Here you can specify loot table modification data represented as a JS object of Minecraft loot table format, and all its contents will be added to the following LootModifier.
reference to itself to be used in sequential calls
Generated using TypeDoc
Object returned by LootModule.createLootTableModifier method, used to modify a specific loot table in different ways, like adding your custom JSON, adding exactly items or registering a callback called after the modifications listed above, to modify the resulting JSON object one more time, having access to all of its content.
The most weighty feature of LootModifier is a class system, that repeats Minecraft loot tables JSON format (a
loot table
consists ofpools
, eachpool
has itsconditions
,tiers
andentries
, etc.)Here is an example of using this system - repeating vanilla zombie loot table with it:
1.0