Skip to content

Trinket Give

giveTrinketsBack(player, trinketSituation): void

Defined in: packages/isaacscript-common/src/functions/trinketGive.ts:16

Helper function to restore the player’s trinkets back to the way they were before the temporarilyRemoveTrinket function was used. It will re-smelt any smelted trinkets that were removed.

EntityPlayer

TrinketSituation | undefined

void


smeltTrinket(player, trinketType, numTrinkets?): void

Defined in: packages/isaacscript-common/src/functions/trinketGive.ts:62

Helper function to smelt a trinket. Before smelting, this function will automatically remove the trinkets that the player is holding, if any, and then give them back after the new trinket is smelted.

EntityPlayer

The player to smelt the trinkets to.

TrinketType

The trinket type to smelt.

number = 1

Optional. If specified, will smelt the given number of trinkets. Use this to avoid calling this function multiple times. Default is 1.

void


smeltTrinkets(player, …trinketTypes): void

Defined in: packages/isaacscript-common/src/functions/trinketGive.ts:89

Helper function to smelt two or more different trinkets. If you want to smelt one trinket (or multiple copies of one trinket), then use the smeltTrinket helper function instead.

This function is variadic, meaning that you can pass as many trinket types as you want to smelt.

Before smelting, this function will automatically remove the trinkets that the player is holding, if any, and then give them back after the new trinket is smelted.

EntityPlayer

The player to smelt the trinkets to.

…readonly TrinketType[]

The trinket types to smelt.

void


temporarilyRemoveTrinket(player, trinketType): TrinketSituation | undefined

Defined in: packages/isaacscript-common/src/functions/trinketGive.ts:108

Helper function to temporarily remove a specific kind of trinket from the player. Use this in combination with the giveTrinketsBack function to take away and give back a trinket on the same frame. This function correctly handles multiple trinket slots and ensures that all copies of the trinket are removed, including smelted trinkets.

Note that one smelted golden trinket is the same as two smelted normal trinkets.

EntityPlayer

TrinketType

TrinketSituation | undefined

Undefined if the player does not have the trinket, or TrinketSituation if they do.


temporarilyRemoveTrinkets(player): TrinketSituation | undefined

Defined in: packages/isaacscript-common/src/functions/trinketGive.ts:154

Helper function to temporarily removes a player’s held trinkets, if any. This will not remove any smelted trinkets. Use this in combination with the giveTrinketsBack function to take away and give back trinkets on the same frame.

EntityPlayer

TrinketSituation | undefined

Undefined if the player does not have any trinkets, or TrinketSituation if they do.