Skip to content

Class "LootList"⚓︎

Constructors⚓︎

LootList ()⚓︎

LootList LootList ( )⚓︎

Functions⚓︎

GetEntries ()⚓︎

LootListEntry[] GetEntries ( )⚓︎

Returns a table of LootListEntries contained in the LootList.


PushEntry ()⚓︎

void PushEntry ( EntityType Type, int Variant, int SubType, int Seed = Random(), RNG RNG = nil )⚓︎

Creates and pushes a LootListEntry into the LootList.

While usually reserved for chests and sacks that give pickups like hearts, bombs, etc, every EntityPickup has a LootList and you can push any type, variant, and subtype as a LootListEntry.

Example Code

This code makes all regular chests contain the best boss in the entire game. As a bonus, use Guppy's Eye for a horrifying image.

1
2
3
4
5
6
7
8
9
    local mod = RegisterMod("Delirium Unboxing", 1)

    function mod:onPrePickupGetLootList(pickup, shouldAdvance)
        if pickup.Variant ~= PickupVariant.PICKUP_CHEST then return end
        local lootList = LootList()
        lootList:PushEntry(EntityType.ENTITY_DELIRIUM, 0, 0)
        return lootList
    end
    mod:AddCallback(ModCallbacks.MC_PRE_PICKUP_GET_LOOT_LIST, mod.onPrePickupGetLootList)