Skip to main content

ModCallbackCustom

  • The Isaac API offers a lot of callbacks, but a lot of times there isn't one for the specific thing that you are looking to do. So, isaacscript-common adds a bunch of new callbacks that you can use.
  • The extra callbacks are efficient such that no code is executed until there is one or more subscriptions.
  • You must upgrade your mod with the upgradeMod helper function before using a custom callback.

Enumeration Members

ENTITY_TAKE_DMG_FILTER

ENTITY_TAKE_DMG_FILTER = 0

The exact same thing as the vanilla ENTITY_TAKE_DMG callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function entityTakeDmgFilter(
entity: Entity,
amount: float,
damageFlags: BitFlags<DamageFlag>,
source: EntityRef,
countdownFrames: int,
): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:32


ENTITY_TAKE_DMG_PLAYER

ENTITY_TAKE_DMG_PLAYER = 1

The exact same thing as the vanilla ENTITY_TAKE_DMG callback, except this callback automatically filters for EntityType.ENTITY_PLAYER and casts the Entity object to a EntityPlayer.

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function entityTakeDmgPlayer(
player: EntityPlayer,
amount: float,
damageFlags: BitFlags<DamageFlag>,
source: EntityRef,
countdownFrames: int,
): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:54


INPUT_ACTION_FILTER

INPUT_ACTION_FILTER = 2

The exact same thing as the vanilla INPUT_ACTION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the InputHook provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the ButtonAction provided.
function inputActionFilter(
entity: Entity | undefined,
inputHook: InputHook,
buttonAction: ButtonAction,
): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:74


INPUT_ACTION_PLAYER

INPUT_ACTION_PLAYER = 3

The exact same thing as the vanilla INPUT_ACTION callback, except this callback automatically filters for EntityType.ENTITY_PLAYER and casts the Entity object to a EntityPlayer. It also allows you to specify extra arguments for additional filtration.

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the InputHook provided.
  • You can provide an optional sixth argument that will make the callback only fire if it matches the ButtonAction provided.
function inputActionPlayer(
player: EntityPlayer,
inputHook: InputHook,
buttonAction: ButtonAction,
): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:98


POST_AMBUSH_FINISHED

POST_AMBUSH_FINISHED = 4

Fires from the POST_UPDATE callback when a Challenge Room or Boss Rush is started. Specifically, this happens on the first frame that Room.IsAmbushDone is true.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the AmbushType provided.
function postAmbushFinished(ambushType: AmbushType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:112


POST_AMBUSH_STARTED

POST_AMBUSH_STARTED = 5

Fires from the POST_UPDATE callback when a Challenge Room or Boss Rush is completed. Specifically, this happens on the first frame that Room.IsAmbushActive is true.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the AmbushType provided.
function postAmbushStarted(ambushType: AmbushType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:126


POST_BOMB_EXPLODED

POST_BOMB_EXPLODED = 6

Fires on the POST_BOMB_UPDATE callback that it explodes.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postBombDetonated(bomb: EntityBomb): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:141


POST_BOMB_INIT_FILTER

POST_BOMB_INIT_FILTER = 7

The exact same thing as the vanilla POST_BOMB_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postBombInitFilter(bomb: EntityBomb): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:157


POST_BOMB_INIT_LATE

POST_BOMB_INIT_LATE = 8

Fires on the first POST_BOMB_UPDATE frame for each bomb.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_BOMB_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postBombInitLate(bomb: EntityBomb): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:175


POST_BOMB_RENDER_FILTER

POST_BOMB_RENDER_FILTER = 9

The exact same thing as the vanilla POST_BOMB_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postBombRenderFilter(bomb: EntityBomb, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:191


POST_BOMB_UPDATE_FILTER

POST_BOMB_UPDATE_FILTER = 10

The exact same thing as the vanilla POST_BOMB_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postBombUpdateFilter(bomb: EntityBomb): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:207


POST_BONE_SWING

POST_BONE_SWING = 11

Fires from the POST_RENDER callback when one of Forgotten's bone clubs is swung or thrown.

function postBoneSwing(boneClub: EntityKnife): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:216


POST_COLLECTIBLE_EMPTY

POST_COLLECTIBLE_EMPTY = 12

Fires from the POST_PICKUP_UPDATE callback when a collectible goes from a non-zero sub-type to CollectibleType.NULL (i.e. an "empty" pedestal).

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the pedestal changed from the CollectibleType provided.
function postCollectibleEmpty(
collectible: EntityPickupCollectible,
oldCollectibleType: CollectibleType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:233


POST_CURSED_TELEPORT

POST_CURSED_TELEPORT = 13

Fires from the POST_PLAYER_RENDER callback on the first frame that the "TeleportUp" animation begins playing after a player triggers a Cursed Eye teleport or a Cursed Skull teleport. (Both of these have the same effect in causing Isaac to be teleported to a random room.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postCursedTeleport(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:250


POST_CUSTOM_REVIVE

POST_CUSTOM_REVIVE = 14

Fires from the POST_PLAYER_UPDATE callback after the player has finished the death animation, has teleported to the previous room, and is ready to play the animation for the modded revival item. The revivalType will match the value returned from the PRE_CUSTOM_REVIVE callback.

In this callback, you must play an animation with something along the lines of player.AnimateCollectible(CollectibleTypeCustom.COLLECTIBLE_MY_REVIVAL_ITEM);, otherwise the animation for a 1-Up will play.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the revival type matches the one provided.
function postCustomRevive(player: EntityPlayer, revivalType: int): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:269


POST_DICE_ROOM_ACTIVATED

POST_DICE_ROOM_ACTIVATED = 15

Fires from the EFFECT_POST_UPDATE callback after a player has entered the range of a Dice Room floor.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the DiceFloorSubType provided.
function postDiceRoomActivated(
player: EntityPlayer,
diceFloorSubType: DiceFloorSubType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:286


POST_DOOR_RENDER

POST_DOOR_RENDER = 16

Fires from the POST_RENDER callback on every frame that a door exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postDoorRender(door: GridEntityDoor): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:299


POST_DOOR_UPDATE

POST_DOOR_UPDATE = 17

Fires from the POST_UPDATE callback on every frame that a door exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postDoorUpdate(door: GridEntityDoor): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:312


POST_EFFECT_INIT_FILTER

POST_EFFECT_INIT_FILTER = 18

The exact same thing as the vanilla POST_EFFECT_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EffectVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postEffectInitFilter(effect: EntityEffect): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:328


POST_EFFECT_INIT_LATE

POST_EFFECT_INIT_LATE = 19

Fires on the first POST_EFFECT_UPDATE frame for each effect.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_EFFECT_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EffectVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postEffectInitLate(effect: EntityEffect): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:346


POST_EFFECT_RENDER_FILTER

POST_EFFECT_RENDER_FILTER = 20

The exact same thing as the vanilla POST_EFFECT_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EffectVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postEffectRenderFilter(effect: EntityEffect, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:362


POST_EFFECT_STATE_CHANGED

POST_EFFECT_STATE_CHANGED = 21

Fires from the POST_EFFECT_UPDATE callback when an effect's state has changed from what it was on the previous frame. (In this context, "state" refers to the EntityEffect.State field.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EffectVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postEffectStateChanged(
effect: EntityEffect,
previousState: int,
currentState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:382


POST_EFFECT_UPDATE_FILTER

POST_EFFECT_UPDATE_FILTER = 22

The exact same thing as the vanilla POST_EFFECT_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EffectVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postEffectUpdateFilter(effect: EntityEffect): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:398


POST_ENTITY_KILL_FILTER

POST_ENTITY_KILL_FILTER = 23

The exact same thing as the vanilla POST_ENTITY_KILL callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postEntityKillFilter(entity: Entity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:416


POST_ESAU_JR

POST_ESAU_JR = 24

Fires one POST_UPDATE frame after the player has used the Esau Jr. item. (The player is not updated to the new character until a game frame has passed.)

function postEsauJr(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:426


POST_FAMILIAR_INIT_FILTER

POST_FAMILIAR_INIT_FILTER = 25

The exact same thing as the vanilla POST_FAMILIAR_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postFamiliarInitFilter(familiar: EntityFamiliar): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:442


POST_FAMILIAR_INIT_LATE

POST_FAMILIAR_INIT_LATE = 26

Fires on the first FAMILIAR_UPDATE frame for each familiar.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_TEAR_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postFamiliarInitLate(familiar: EntityFamiliar): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:460


POST_FAMILIAR_RENDER_FILTER

POST_FAMILIAR_RENDER_FILTER = 27

The exact same thing as the vanilla POST_FAMILIAR_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postFamiliarRenderFilter(familiar: EntityFamiliar, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:476


POST_FAMILIAR_STATE_CHANGED

POST_FAMILIAR_STATE_CHANGED = 28

Fires from the POST_FAMILIAR_UPDATE callback when a familiar's state has changed from what it was on the previous frame. (In this context, "state" refers to the EntityFamiliar.State field.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postFamiliarStateChanged(
familiar: EntityFamiliar,
previousState: int,
currentState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:497


POST_FAMILIAR_UPDATE_FILTER

POST_FAMILIAR_UPDATE_FILTER = 29

The exact same thing as the vanilla POST_FAMILIAR_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postFamiliarUpdateFilter(familiar: EntityFamiliar): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:513


POST_FIRST_ESAU_JR

POST_FIRST_ESAU_JR = 30

Fires one POST_UPDATE frame after the player has first used the Esau Jr. item. (The player is not updated to the new character until a game frame has passed.)

This callback is useful because there is no way to get access to the Esau Jr. character entity before the player has actually used the Esau Jr. item.

function postFirstEsauJr(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:526


POST_FIRST_FLIP

POST_FIRST_FLIP = 31

Fires after the player has used the Flip item for the first time. Unlike the vanilla USE_ITEM callback, this callback will return the player object for the new Lazarus (not the one who used the Flip item).

This callback is useful because there is no way to get access to the "flipped" character entity before the player has actually used the Flip item.

function postFirstFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:540


POST_FLIP

POST_FLIP = 32

Fires after the player has used the Flip item. Unlike the vanilla USE_ITEM callback, this callback will return the player object for the new Lazarus (not the one who used the Flip item).

This callback is useful because there is no way to get access to the "flipped" character entity before the player has actually used the Flip item.

function postFlip(newLazarus: EntityPlayer, oldLazarus: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:554


POST_GAME_END_FILTER

POST_GAME_END_FILTER = 33

The exact same thing as the vanilla POST_GAME_END callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the isGameOver value provided.
function postGameEndFilter(isGameOver: boolean): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:568


POST_GAME_STARTED_REORDERED

POST_GAME_STARTED_REORDERED = 34

Similar to the vanilla callback of the same name, but fires in the correct order with respect to the POST_NEW_LEVEL and the POST_NEW_ROOM callbacks:

POST_GAME_STARTED_REORDERED --> POST_NEW_LEVEL_REORDERED --> POST_NEW_ROOM_REORDERED

  • You must provide a third argument:
    • Pass true if you want the callback to only fire if the run is continued.
    • Pass false if you want the callback to only fire when the run is not continued.
    • Pass undefined if you want the callback to fire in both situations.

(The third argument for this callback is mandatory in order to prevent users from shooting themselves in the foot with respect to logic unexpectedly being executed on continued runs.)

function postGameStartedReordered(isContinued: boolean): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:588


POST_GAME_STARTED_REORDERED_LAST

POST_GAME_STARTED_REORDERED_LAST = 35

Similar to the POST_GAME_STARTED_REORDERED callback, but fires after all of the subscribed callbacks have finished firing. Thus, you can use this callback to do perform things after a new run has started (or continued), but you can be sure that all new-run-related initialization has been completed.

  • You must provide a third argument:
    • Pass true if you want the callback to only fire if the run is continued.
    • Pass false if you want the callback to only fire when the run is not continued.
    • Pass undefined if you want the callback to fire in both situations.

(The third argument for this callback is mandatory in order to prevent users from shooting themselves in the foot with respect to logic unexpectedly being executed on continued runs.)

function postGameStartedReorderedLast(isContinued: boolean): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:608


POST_GREED_MODE_WAVE

POST_GREED_MODE_WAVE = 36

Fires from the POST_UPDATE callback when the Greed Mode wave increases.

function postGreedModeWave(oldWave: int, newWave: int): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:617


POST_GRID_ENTITY_BROKEN

POST_GRID_ENTITY_BROKEN = 37

Fires from the POST_UPDATE callback when a grid entity changes to a state that corresponds to the broken state for the respective grid entity type. (For example, this will fire for a GridEntityType.ROCK (2) when its state changes to RockState.BROKEN (2).)

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_BROKEN callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityBroken(gridEntity: GridEntity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:637


POST_GRID_ENTITY_COLLISION

POST_GRID_ENTITY_COLLISION = 38

Fires from the POST_UPDATE callback when a new entity collides with a grid entity. (After this, the callback will not continue to fire. It will only fire again once the entity moves out of range and then moves back into range.)

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_COLLISION callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided (for the grid entity).
  • You can provide an optional fifth argument that will make the callback only fire if the colliding entity matches the EntityType provided.
  • You can provide an optional sixth argument that will make the callback only fire if the colliding entity matches the variant provided.
  • You can provide an optional seventh argument that will make the callback only fire if the colliding entity matches the sub-type provided.
function postGridEntityCollision(
gridEntity: GridEntity,
entity: Entity,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:666


POST_GRID_ENTITY_CUSTOM_BROKEN

POST_GRID_ENTITY_CUSTOM_BROKEN = 39

The same as the POST_GRID_ENTITY_BROKEN callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomBroken(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:684


POST_GRID_ENTITY_CUSTOM_COLLISION

POST_GRID_ENTITY_CUSTOM_COLLISION = 40

The same as the POST_GRID_ENTITY_COLLISION callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
  • You can provide an optional fourth argument that will make the callback only fire if the colliding entity matches the EntityType provided.
  • You can provide an optional fifth argument that will make the callback only fire if the colliding entity matches the variant provided.
  • You can provide an optional sixth argument that will make the callback only fire if the colliding entity matches the sub-type provided.
function postGridEntityCustomCollision(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
entity: Entity,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:709


POST_GRID_ENTITY_CUSTOM_INIT

POST_GRID_ENTITY_CUSTOM_INIT = 41

The same as the POST_GRID_ENTITY_INIT callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomInit(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:727


POST_GRID_ENTITY_CUSTOM_REMOVE

POST_GRID_ENTITY_CUSTOM_REMOVE = 42

The same as the POST_GRID_ENTITY_REMOVE callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomRemove(
gridIndex: int,
gridEntityTypeCustom: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:745


POST_GRID_ENTITY_CUSTOM_RENDER

POST_GRID_ENTITY_CUSTOM_RENDER = 43

The same as the POST_GRID_ENTITY_RENDER callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomRender(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:763


POST_GRID_ENTITY_CUSTOM_STATE_CHANGED

POST_GRID_ENTITY_CUSTOM_STATE_CHANGED = 44

The same as the POST_GRID_ENTITY_STATE_CHANGED callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomStateChanged(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
oldState: int,
newState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:783


POST_GRID_ENTITY_CUSTOM_UPDATE

POST_GRID_ENTITY_CUSTOM_UPDATE = 45

The same as the POST_GRID_ENTITY_UPDATE callback, but only fires for grid entities created with the spawnCustomGridEntity helper function.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the custom GridEntityType provided. (Custom grid entities do not have variants, so there is no need for an optional argument to filter by variant.)
function postGridEntityCustomUpdate(
gridEntity: GridEntity,
gridEntityTypeCustom: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:801


POST_GRID_ENTITY_INIT

POST_GRID_ENTITY_INIT = 46

Fires when a new grid entity is initialized. Specifically, this is either:

  • in the POST_NEW_ROOM_REORDERED callback (firing every time a room is entered, even if the entity was previously there on a previous room entry)
  • in the POST_UPDATE callback (if the entity appeared mid-way through the room, like when the trapdoor appears after defeating It Lives)

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_INIT callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityInit(gridEntity: GridEntity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:824


POST_GRID_ENTITY_REMOVE

POST_GRID_ENTITY_REMOVE = 47

Fires from the POST_UPDATE callback when a new grid entity is removed. Specifically, this on the frame after it no longer exists (where it did exist a frame ago).

(Leaving a room with a grid entity does not count as "removing" it.)

This will fire when a Polty/Kineti picks up a grid entity.

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_REMOVE callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityRemove(
gridIndex: int,
gridEntityType: GridEntityType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:850


POST_GRID_ENTITY_RENDER

POST_GRID_ENTITY_RENDER = 48

Fires from the POST_RENDER callback on every frame that a grid entity exists.

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_RENDER callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityRender(gridEntity: GridEntity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:868


POST_GRID_ENTITY_STATE_CHANGED

POST_GRID_ENTITY_STATE_CHANGED = 49

Fires from the POST_UPDATE callback when a grid entity changes its state. (In this context, "state" refers to the GridEntity.State field.)

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_STATE_CHANGED callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityStateChanged(
gridEntity: GridEntity,
oldState: int,
newState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:891


POST_GRID_ENTITY_UPDATE

POST_GRID_ENTITY_UPDATE = 50

Fires from the POST_UPDATE callback on every frame that a grid entity exists.

For grid entities created with spawnCustomGridEntity, use the POST_GRID_ENTITY_CUSTOM_UPDATE callback instead.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postGridEntityUpdate(gridEntity: GridEntity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:909


POST_HOLY_MANTLE_REMOVED

POST_HOLY_MANTLE_REMOVED = 51

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when the player loses a Holy Mantle temporary collectible effect.

This callback is useful because you might want to have code that happens when the player is hit from an enemy. Normally, you would accomplish this via the ENTITY_TAKE_DMG callback, but that callback never fires if the player has a Holy Mantle shield.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerInitReordered(
player: EntityPlayer,
oldNumHolyMantles: int,
newNumHolyMantles: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:933


POST_ITEM_DISCHARGE

POST_ITEM_DISCHARGE = 52

Fires from POST_PEFFECT_UPDATE_REORDERED callback when the player loses charge on their active collectible item, implying that the item was just used.

This callback is useful because the USE_ITEM callback does not fire when The Candle, Red Candle, and Bob's Rotten Brain are discharged.

Note that this callback will not fire if the active item is both discharged and swapped for another item / discharged on the same frame, like in the case of Alabaster Box.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the CollectibleType provided.
function postItemDischarge(
player: EntityPlayer,
collectibleType: CollectibleType,
activeSlot: ActiveSlot,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:957


POST_ITEM_PICKUP

POST_ITEM_PICKUP = 53

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when an item is no longer queued (i.e. when the animation of the player holding the item above their head is finished and the item is actually added to the player's inventory).

Note that this callback will only fire once per Forgotten/Soul pair.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ItemType provided.
  • You can provide an optional fourth argument that will make the callback only fire if the sub-type matches the CollectibleType or the TrinketType provided.
function postItemPickup(
player: EntityPlayer,
pickingUpItem: PickingUpItem,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:979


POST_KEYBOARD_CHANGED

POST_KEYBOARD_CHANGED = 54

Fires on the first POST_RENDER frame after a key on the keyboard has been pressed or released. (In other words, the callback only fires when the "pressed" status is different than what it was on the previous frame.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the Keyboard provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the pressed state provided. (true for pressed, false for released.)
function postKeyboardChanged(keyboard: Keyboard, pressed: boolean): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:996


POST_KNIFE_INIT_FILTER

POST_KNIFE_INIT_FILTER = 55

The exact same thing as the vanilla POST_KNIFE_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the KnifeVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postKnifeInitFilter(knife: EntityKnife): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1012


POST_KNIFE_INIT_LATE

POST_KNIFE_INIT_LATE = 56

Fires on the first POST_KNIFE_UPDATE frame for each knife.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_KNIFE_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the KnifeVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postKnifeInitLate(knife: EntityKnife): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1030


POST_KNIFE_RENDER_FILTER

POST_KNIFE_RENDER_FILTER = 57

The exact same thing as the vanilla POST_KNIFE_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the KnifeVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postKnifeRenderFilter(knife: EntityKnife, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1046


POST_KNIFE_UPDATE_FILTER

POST_KNIFE_UPDATE_FILTER = 58

The exact same thing as the vanilla POST_KNIFE_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the KnifeVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postKnifeUpdateFilter(knife: EntityKnife): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1062


POST_LASER_INIT_FILTER

POST_LASER_INIT_FILTER = 59

The exact same thing as the vanilla POST_LASER_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the LaserVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postLaserInitFilter(laser: EntityLaser): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1078


POST_LASER_INIT_LATE

POST_LASER_INIT_LATE = 60

Fires on the first POST_LASER_UPDATE frame for each laser.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_LASER_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the LaserVariant provided.
  • You can provide an optional forth argument that will make the callback only fire if it matches the sub-type provided.
function postLaserInitLate(laser: EntityLaser): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1096


POST_LASER_RENDER_FILTER

POST_LASER_RENDER_FILTER = 61

The exact same thing as the vanilla POST_LASER_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the LaserVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postLaserRenderFilter(laser: EntityLaser, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1112


POST_LASER_UPDATE_FILTER

POST_LASER_UPDATE_FILTER = 62

The exact same thing as the vanilla POST_LASER_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the LaserVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postLaserUpdateFilter(laser: EntityLaser): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1128


POST_NEW_LEVEL_REORDERED

POST_NEW_LEVEL_REORDERED = 63

The same as the vanilla callback of the same name, but fires in the correct order with respect to the POST_GAME_STARTED and the POST_NEW_ROOM callbacks:

POST_GAME_STARTED_REORDERED --> POST_NEW_LEVEL_REORDERED --> POST_NEW_ROOM_REORDERED

Additionally, this callback will pass the LevelStage as the first callback argument and the StageType as the second callback argument.

Note that similar to the vanilla POST_NEW_LEVEL callback, this callback will not fire when a player resumes a saved run. (In that case, only the POST_GAME_STARTED_REORDERED and the POST_NEW_ROOM_REORDERED callbacks will fire, in that order).

If some specific cases, mods can change the current level during run initialization (on the 0th frame). However, due to how the callback reordering works, the custom POST_NEW_LEVEL_REORDERED callback will never fire on the 0th frame. To get around this, call the forceNewLevelCallback() function before changing levels to temporarily force the callback to fire.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the LevelStage provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the StageType provided.
function postNewLevelReordered(stage: LevelStage, stageType: StageType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1159


POST_NEW_ROOM_EARLY

POST_NEW_ROOM_EARLY = 64

Fires on the first POST_NEW_ROOM or PRE_ENTITY_SPAWN callback where being in a new room is detected. This is useful because the vanilla POST_NEW_ROOM callback fires only after entities in the room have been initialized and updated once, which means that it is possible for entity-related code to run before room-related-initialization has been performed.

Additionally, this callback will pass the RoomType as the first callback argument.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the RoomType provided.
function postNewRoomEarly(roomType: RoomType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1177


POST_NEW_ROOM_REORDERED

POST_NEW_ROOM_REORDERED = 65

The same as the vanilla callback of the same name, but fires in the correct order with respect to the POST_GAME_STARTED and the POST_NEW_LEVEL callbacks:

POST_GAME_STARTED_REORDERED --> POST_NEW_LEVEL_REORDERED --> POST_NEW_ROOM_REORDERED

Additionally, this callback will pass the RoomType as the first callback argument.

If some specific cases, mods can change the current room during run initialization (on the 0th frame). However, due to how the callback reordering works, the custom POST_NEW_ROOM_REORDERED callback will never fire on the 0th frame. To get around this, call the forceNewRoomCallback() function before changing levels to temporarily force the callback to fire.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the RoomType provided.
function postNewRoomReordered(roomType: RoomType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1201


POST_NPC_DEATH_FILTER

POST_NPC_DEATH_FILTER = 66

The exact same thing as the vanilla POST_NPC_DEATH callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCDeathFilter(npc: EntityNPC): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1219


POST_NPC_INIT_FILTER

POST_NPC_INIT_FILTER = 67

The exact same thing as the vanilla POST_NPC_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCInitFilter(npc: EntityNPC): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1237


POST_NPC_INIT_LATE

POST_NPC_INIT_LATE = 68

Fires on the first NPC_UPDATE frame for each NPC.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_NPC_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCInitLate(npc: EntityNPC): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1257


POST_NPC_RENDER_FILTER

POST_NPC_RENDER_FILTER = 69

The exact same thing as the vanilla POST_NPC_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCRenderFilter(npc: EntityNPC, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1275


POST_NPC_STATE_CHANGED

POST_NPC_STATE_CHANGED = 70

Fires from the POST_NPC_UPDATE callback when an NPC's state has changed from what it was on the previous frame. (In this context, "state" refers to the EntityNPC.State field.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCStateChanged(
npc: EntityNPC,
previousState: int,
currentState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1297


POST_NPC_UPDATE_FILTER

POST_NPC_UPDATE_FILTER = 71

The exact same thing as the vanilla POST_NPC_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function postNPCUpdateFilter(npc: EntityNPC): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1315


POST_PEFFECT_UPDATE_REORDERED

POST_PEFFECT_UPDATE_REORDERED = 72

Similar to the vanilla callback of the same name, but fires after the POST_GAME_STARTED_REORDERED callback fires (if the player is being updated on the 0th game frame of the run).

This callback is useful for two reasons:

  1. Normally, POST_PEFFECT_UPDATE fires before POST_GAME_STARTED. Since mod variables are often initialized at the beginning of the POST_GAME_STARTED callback, this can cause problems.
  2. Some functions do not work (or crash the game) when called before the POST_NEW_ROOM callback. For example, since the level is not generated yet, you will not be able to access any rooms.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPEffectUpdateReordered(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1341


POST_PICKUP_CHANGED

POST_PICKUP_CHANGED = 73

Fires from the POST_PICKUP_UPDATE callback when a pickup has a different variant or sub-type than what it was on the previous frame.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the new pickup matches the PickupVariant provided.
  • You can provide an optional third argument that will make the callback only fire if the new pickup matches the sub-type provided.
function postPickupChanged(
pickup: EntityPickup,
oldVariant: PickupVariant,
oldSubType: int,
newVariant: PickupVariant,
newSubType: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1363


POST_PICKUP_COLLECT

POST_PICKUP_COLLECT = 74

Fires on the first POST_RENDER frame that a pickup plays the "Collect" animation.

Use this callback to know when a pickup is added to the player's inventory or health.

Note that this will not fire when the player takes a collectible; use either the POST_PLAYER_COLLECTIBLE_ADDED or the PRE_ITEM_PICKUP callback for that.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupCollect(pickup: EntityPickup, player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1383


POST_PICKUP_INIT_FILTER

POST_PICKUP_INIT_FILTER = 75

The exact same thing as the vanilla POST_PICKUP_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupInitFilter(pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1399


POST_PICKUP_INIT_FIRST

POST_PICKUP_INIT_FIRST = 76

Fires from the POST_PICKUP_INIT callback on the first time that a player has seen the respective pickup on the run.

This callback is useful because pickups will despawn upon leaving the room and respawn upon re-entering the room.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupInitFirst(pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1418


POST_PICKUP_INIT_LATE

POST_PICKUP_INIT_LATE = 77

Fires on the first POST_PICKUP_UPDATE frame for each pickup.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_PICKUP_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupInitLate(pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1436


POST_PICKUP_RENDER_FILTER

POST_PICKUP_RENDER_FILTER = 78

The exact same thing as the vanilla POST_PICKUP_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupRenderFilter(pickup: EntityPickup, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1452


POST_PICKUP_SELECTION_FILTER

POST_PICKUP_SELECTION_FILTER = 79

The exact same thing as the vanilla POST_PICKUP_SELECTION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupSelectionFilter(
pickup: EntityPickup,
variant: PickupVariant,
subType: int,
): [pickupVariant: PickupVariant, subType: int] | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1472


POST_PICKUP_STATE_CHANGED

POST_PICKUP_STATE_CHANGED = 80

Fires from the POST_PICKUP_UPDATE callback when a pickup's state has changed from what it was on the previous frame. (In this context, "state" refers to the EntityPickup.State field.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupStateChanged(
pickup: EntityPickup,
previousState: int,
currentState: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1492


POST_PICKUP_UPDATE_FILTER

POST_PICKUP_UPDATE_FILTER = 81

The exact same thing as the vanilla POST_PICKUP_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPickupUpdateFilter(pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1508


POST_PIT_RENDER

POST_PIT_RENDER = 82

Fires from the POST_RENDER callback on every frame that a pit exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPitRender(pit: GridEntityPit): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1521


POST_PIT_UPDATE

POST_PIT_UPDATE = 83

Fires from the POST_UPDATE callback on every frame that a pit exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPitUpdate(pit: GridEntityPit): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1534


POST_PLAYER_CHANGE_HEALTH

POST_PLAYER_CHANGE_HEALTH = 84

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player's health (i.e. hearts) is different than what it was on the previous frame. For more information, see the PlayerHealth enum.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerChangeHealth(
player: EntityPlayer,
healthType: HealthType,
difference: int,
oldValue: int,
newValue: int,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1557


POST_PLAYER_CHANGE_STAT

POST_PLAYER_CHANGE_STAT = 85

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when one of the player's stats change from what they were on the previous frame.

The type of oldValue and newValue will depend on what kind of stat it is. For example, StatType.FLYING will be a boolean. (You can use the "Types" helper functions to narrow the type.)

For StatType.TEAR_FLAG, StatType.TEAR_COLOR, StatType.FLYING, and StatType.SIZE, the difference argument will always be a value of 0, since the type of these stats are not numbers. (For these cases, you should examine the oldValue and newValue arguments accordingly.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerChangeStat<T extends StatType>(
player: EntityPlayer,
statType: T,
difference: int,
oldValue: StatTypeType[T],
newValue: StatTypeType[T],
) => void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1588


POST_PLAYER_CHANGE_TYPE

POST_PLAYER_CHANGE_TYPE = 86

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player entity changes its player type (i.e. character) from what it was on the previous frame. For example, it will fire after using Clicker, after dying with the Judas' Shadow collectible, etc.

Notably, it does not fire after the player uses the Flip item or the Esau Jr. item, because those items cause separate player entities to be created. Use the POST_FLIP and POST_ESAU_JR callbacks to handle those situations.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
function postPlayerChangeType(
player: EntityPlayer,
oldCharacter: PlayerType,
newCharacter: PlayerType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1612


POST_PLAYER_COLLECTIBLE_ADDED

POST_PLAYER_COLLECTIBLE_ADDED = 87

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player's collectible count is higher than what it was on the previous frame, or when the active items change, or when the build is rerolled.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the collectible matches the CollectibleType provided.
function postPlayerCollectibleAdded(
player: EntityPlayer,
collectibleType: CollectibleType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1630


POST_PLAYER_COLLECTIBLE_REMOVED

POST_PLAYER_COLLECTIBLE_REMOVED = 88

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player's collectible count is lower than what it was on the previous frame, or when the active items change, or when the build is rerolled.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the collectible matches the CollectibleType provided.
function postPlayerCollectibleRemoved(
player: EntityPlayer,
collectibleType: CollectibleType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1648


POST_PLAYER_FATAL_DAMAGE

POST_PLAYER_FATAL_DAMAGE = 89

Fires from the ENTITY_TAKE_DMG callback when a player takes fatal damage. Return false to prevent the fatal damage.

Note that this function does properly take into account Guppy's Collar, Broken Ankh, Spirit Shackles, and Mysterious Paper. It also takes into account using The Bible on Satan.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerFatalDamage(player: EntityPlayer): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1667


POST_PLAYER_INIT_FIRST

POST_PLAYER_INIT_FIRST = 90

Fires on the first POST_PEFFECT_UPDATE_REORDERED frame for each player, similar to the POST_PLAYER_INIT_LATE callback, with two changes:

  • This will not fire for "child" players (e.g. non-real players like the Strawman Keeper).
  • This will fire when the player enters a Genesis room and all of their items are taken away.

You should use this callback for any player-related initialization logic, like giving the character their starting items for the run. (You do not want to use the vanilla POST_PLAYER_INIT callback for this because it fires when a run is continued.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerInitFirst(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1690


POST_PLAYER_INIT_LATE

POST_PLAYER_INIT_LATE = 91

Fires on the first POST_PEFFECT_UPDATE_REORDERED frame for each player.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_PLAYER_INIT callback.

For initializing a player with custom items and so forth, use the POST_PLAYER_INIT_FIRST callback instead to handle the case of a Genesis room.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerInitLate(pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1711


POST_PLAYER_RENDER_REORDERED

POST_PLAYER_RENDER_REORDERED = 92

Similar to the vanilla callback of the same name, but fires after the POST_GAME_STARTED callback fires (if the player is spawning on the 0th game frame of the run).

This callback is useful for two reasons:

  1. Normally, POST_PLAYER_RENDER fires before POST_GAME_STARTED. Since mod variables are often initialized at the beginning of the POST_GAME_STARTED callback, this can cause problems.
  2. Some functions do not work (or crash the game) when called before the POST_NEW_ROOM callback. For example, since the level is not generated yet, you will not be able to access any rooms.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerRenderReordered(player: EntityPlayer, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1736


POST_PLAYER_UPDATE_REORDERED

POST_PLAYER_UPDATE_REORDERED = 93

Similar to the vanilla callback of the same name, but fires after the POST_GAME_STARTED_REORDERED callback fires (if the player is being updated on the 0th game frame of the run).

This callback is useful for two reasons:

  1. Normally, POST_PLAYER_UPDATE fires before POST_GAME_STARTED. Since mod variables are often initialized at the beginning of the POST_GAME_STARTED callback, this can cause problems.
  2. Some functions do not work (or crash the game) when called before the POST_NEW_ROOM callback. For example, since the level is not generated yet, you will not be able to access any rooms.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postPlayerUpdateReordered(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1762


POST_POOP_RENDER

POST_POOP_RENDER = 94

Fires from the POST_RENDER callback on every frame that a poop exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPoopRender(poop: GridEntityPoop): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1775


POST_POOP_UPDATE

POST_POOP_UPDATE = 95

Fires from the POST_UPDATE callback on every frame that a poop exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPoopUpdate(poop: GridEntityPoop): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1788


POST_PRESSURE_PLATE_RENDER

POST_PRESSURE_PLATE_RENDER = 96

Fires from the POST_RENDER callback on every frame that a pressure plate exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPressurePlateRender(pressurePlate: GridEntityPressurePlate): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1801


POST_PRESSURE_PLATE_UPDATE

POST_PRESSURE_PLATE_UPDATE = 97

Fires from the POST_UPDATE callback on every frame that a pressure plate exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postPressurePlateUpdate(pressurePlate: GridEntityPressurePlate): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1814


POST_PROJECTILE_INIT_FILTER

POST_PROJECTILE_INIT_FILTER = 98

The exact same thing as the vanilla POST_PROJECTILE_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postProjectileInitFilter(projectile: EntityProjectile): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1830


POST_PROJECTILE_INIT_LATE

POST_PROJECTILE_INIT_LATE = 99

Fires on the first POST_PROJECTILE_UPDATE frame for each projectile.

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_PROJECTILE_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postProjectileInitLate(projectile: EntityProjectile): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1848


POST_PROJECTILE_KILL

POST_PROJECTILE_KILL = 100

Fires when the provided projectile is removed after colliding with an entity or grid entity.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postProjectileKill(projectile: EntityProjectile): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1863


POST_PROJECTILE_RENDER_FILTER

POST_PROJECTILE_RENDER_FILTER = 101

The exact same thing as the vanilla POST_PROJECTILE_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postProjectileRenderFilter(projectile: EntityProjectile, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1879


POST_PROJECTILE_UPDATE_FILTER

POST_PROJECTILE_UPDATE_FILTER = 102

The exact same thing as the vanilla POST_PROJECTILE_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postProjectileUpdateFilter(projectile: EntityProjectile): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1895


POST_PURCHASE

POST_PURCHASE = 103

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player first picks up a new item. The pickup returned in the callback is assumed to be the first pickup that no longer exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PickupVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postPurchase(player: EntityPlayer, pickup: EntityPickup): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1912


POST_ROCK_RENDER

POST_ROCK_RENDER = 104

Fires from the POST_RENDER callback on every frame that a rock exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postRockRender(rock: GridEntityRock): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1927


POST_ROCK_UPDATE

POST_ROCK_UPDATE = 105

Fires from the POST_UPDATE callback on every frame that a rock exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the GridEntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
function postRockUpdate(rock: GridEntityRock): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1942


POST_ROOM_CLEAR_CHANGED

POST_ROOM_CLEAR_CHANGED = 106

Fires from the POST_UPDATE callback when the clear state of a room changes (as according to the Room.IsClear method).

For example, this callback fires when you defeat all the enemies in a room (clear --> not clear) or when you bomb an angel statue (not clear --> clear). This callback does not fire when you travel between a cleared room and an uncleared room.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if the room clear state matches the boolean provided.
function postRoomClearChanged(roomClear: boolean): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1960


POST_SACRIFICE

POST_SACRIFICE = 107

Fires from the ENTITY_TAKE_DMG callback when a player takes damage from spikes in a Sacrifice Room.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function postSacrifice(player: EntityPlayer, numSacrifices: int): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1976


POST_SLOT_ANIMATION_CHANGED

POST_SLOT_ANIMATION_CHANGED = 108

Fires from the POST_RENDER callback when a slot entity's animation changes.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postSlotAnimationChanged(
slot: Entity,
previousAnimation: string,
currentAnimation: string,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:1995


POST_SLOT_COLLISION

POST_SLOT_COLLISION = 109

Fires from the PRE_PLAYER_COLLISION callback when when a player collides with a slot entity. (It will not fire if any other type of entity collides with the slot entity.)

When a player runs into a slot entity, this callback will continually fire, since the player is colliding with it on every frame. Thus, you should only perform actions in this callback under certain conditions, like if the slot entity is playing the "Idle" animation, and so on.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
  • (Only players will cause this callback to fire, so there is no need for an optional argument to filter by EntityType.)
function postSlotCollision(
slot: EntitySlot,
entity: Entity,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2020


POST_SLOT_DESTROYED

POST_SLOT_DESTROYED = 110

Fires from the POST_SLOT_UPDATE or the POST_ENTITY_REMOVE callback when a slot machine is destroyed or a beggar is removed.

This callback will fire in four different kinds of situations:

  1. When slot machine entities (e.g. SlotVariant.SLOT_MACHINE and SlotVariant.BLOOD_DONATION_MACHINE) are destroyed with an explosion. When this happens, they typically stay in the room and can be pushed around. This state is detected via a change in the GridCollisionClass.
  2. When slot machine entities pay out with a collectible item. When this happens, they immediately despawn without playing any special animation.
  3. When beggar entities (e.g. SlotVariant.BEGGAR and SlotVariant.SHELL_GAME) are destroyed with an explosion. When this happens, they immediately despawn without playing any special animation.
  4. When beggar entities pay out with a collectible item. When this happens, they despawn after playing the "Teleport" animation. (This is not technically a "destruction" event, but the callback will fire for this to remain consistent with the other types of slot entities.)

Depending on the specific types of slot removal that you need to detect, you can filter using:

  1. The isSlotMachine helper function to differentiate between slot machines and beggars.
  2. The passed callback argument of SlotDestructionType to differentiate between bombed slots and slots that paid out with a collectible item.

Note that when a Crane Game explodes after paying out three collectibles, the SlotDestructionType will be equal to SlotDestructionType.NORMAL instead of SlotDestructionType.COLLECTIBLE_PAYOUT like you might expect. (This is because it only explodes after a short delay, and when doing so, it produces rewards in the same way that would happen if you bombed it.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postSlotDestroyed(slot: Entity, slotDestructionType: SlotDestructionType): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2063


POST_SLOT_INIT

POST_SLOT_INIT = 111

Fires when a new slot entity is initialized. Specifically, this is either:

  • in the POST_NEW_ROOM_REORDERED callback (firing every time a room is entered, even if the entity was previously there on a previous room entry)
  • in the POST_UPDATE callback (if the entity appeared mid-way through the room, like when a Wheel of Fortune card is used)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postSlotInit(slot: Entity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2083


POST_SLOT_RENDER

POST_SLOT_RENDER = 112

Fires from the POST_RENDER callback on every frame that a slot entity exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postSlotRender(slot: Entity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2098


POST_SLOT_UPDATE

POST_SLOT_UPDATE = 113

Fires from the POST_UPDATE callback on every frame that a slot entity exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the SlotVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postSlotUpdate(slot: Entity): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2113


POST_SPIKES_RENDER

POST_SPIKES_RENDER = 114

Fires from the POST_RENDER callback on every frame that spikes exist.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postSpikesRender(spikes: GridEntitySpikes): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2126


POST_SPIKES_UPDATE

POST_SPIKES_UPDATE = 115

Fires from the POST_UPDATE callback on every frame that spikes exist.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postSpikesUpdate(spikes: GridEntitySpikes): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2139


POST_TEAR_INIT_FILTER

POST_TEAR_INIT_FILTER = 116

The exact same thing as the vanilla POST_TEAR_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearInitFilter(tear: EntityTear): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2155


POST_TEAR_INIT_LATE

POST_TEAR_INIT_LATE = 117

Fires on the first POST_TEAR_UPDATE frame for each tear (which is when EntityTear.FrameCount is equal to 0).

This callback is useful because many attributes cannot be set or retrieved properly in the normal POST_TEAR_INIT callback.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearInitLate(tear: EntityTear): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2174


POST_TEAR_INIT_VERY_LATE

POST_TEAR_INIT_VERY_LATE = 118

Fires on the second POST_TEAR_UPDATE frame for each tear (which is when EntityTear.FrameCount is equal to 1).

This callback is useful because Incubus tears are not distinguishable until the second frame.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearInitVeryLate(tear: EntityTear): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2192


POST_TEAR_KILL

POST_TEAR_KILL = 119

Fires when the provided tear is removed after colliding with an entity or grid entity.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearKill(tear: EntityTear): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2207


POST_TEAR_RENDER_FILTER

POST_TEAR_RENDER_FILTER = 120

The exact same thing as the vanilla POST_TEAR_RENDER callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearRenderFilter(tear: EntityTear, renderOffset: Vector): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2223


POST_TEAR_UPDATE_FILTER

POST_TEAR_UPDATE_FILTER = 121

The exact same thing as the vanilla POST_TEAR_INIT callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function postTearUpdateFilter(tear: EntityTear): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2239


POST_TNT_RENDER

POST_TNT_RENDER = 122

Fires from the POST_RENDER callback on every frame that a TNT exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postTNTRender(tnt: GridEntityTNT): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2252


POST_TNT_UPDATE

POST_TNT_UPDATE = 123

Fires from the POST_UPDATE callback on every frame that a TNT exists.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the variant provided.
function postTNTUpdate(tnt: GridEntityTNT): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2265


POST_TRANSFORMATION

POST_TRANSFORMATION = 124

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when a player gains or loses a new transformation.

Note that this callback will only fire once per Forgotten/Soul pair.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerForm provided.
function postTransformation(
player: EntityPlayer,
playerForm: PlayerForm,
hasForm: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2285


POST_TRINKET_BREAK

POST_TRINKET_BREAK = 125

Fires from ENTITY_TAKE_DMG callback when a Wishbone or a Walnut breaks.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TrinketType provided.
function postTrinketBreak(
player: EntityPlayer,
trinketType: TrinketType,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2301


POST_USE_PILL_FILTER

POST_USE_PILL_FILTER = 126

The same thing as the vanilla POST_USE_PILL callback, except this callback passes the PillColor of the used pill as the final argument. It allows you to filter by the PillColor.

In order to accomplish this, this callback tracks the held pills of the player on every frame. If a matching PillColor could not be found, this callback passes PillColor.NULL (0).

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PillEffect provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PillColor provided.
function postUsePillFilter(
pillEffect: PillEffect,
pillColor: PillColor,
player: EntityPlayer,
useFlags: BitFlags<UseFlag>,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2325


PRE_BERSERK_DEATH

PRE_BERSERK_DEATH = 127

Fires from the POST_PEFFECT_UPDATE_REORDERED callback on the frame before a Berserk effect ends when the player is predicted to die (e.g. they currently have no health left or they took damage in a "Lost" form).

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function preBerserkDeath(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2342


PRE_BOMB_COLLISION_FILTER

PRE_BOMB_COLLISION_FILTER = 128

The exact same thing as the vanilla PRE_BOMB_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the BombVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function preBombCollisionFilter(
bomb: EntityBomb,
collider: Entity,
low: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2362


PRE_CUSTOM_REVIVE

PRE_CUSTOM_REVIVE = 129

Fires from the POST_PLAYER_FATAL_DAMAGE callback when a player is about to die. If you want to initiate a custom revival, return an integer that corresponds to the item or type of revival that you are doing. Otherwise, return undefined to continue the fatal damage.

This callback is useful because reviving the player after the game things that player should have died will result in the save data for the run getting deleted.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function preCustomRevive(player: EntityPlayer): int | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2382


PRE_ENTITY_SPAWN_FILTER

PRE_ENTITY_SPAWN_FILTER = 130

The exact same thing as the vanilla PRE_ENTITY_SPAWN callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function preEntitySpawnFilter(
entityType: EntityType,
variant: int,
subType: int,
position: Vector,
velocity: Vector,
spawner: Entity | undefined,
initSeed: Seed,
): [entityType: EntityType, variant: int, subType: int, initSeed: Seed] | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2408


PRE_FAMILIAR_COLLISION_FILTER

PRE_FAMILIAR_COLLISION_FILTER = 131

The exact same thing as the vanilla PRE_FAMILIAR_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the FamiliarVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function preFamiliarCollisionFilter(
familiar: EntityFamiliar,
collider: Entity,
low: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2428


PRE_GET_PEDESTAL

PRE_GET_PEDESTAL = 132

Fires from the PRE_PICKUP_COLLISION callback when a player touches a collectible pedestal and meets all of the conditions to pick it up.

The return values of this callback are the same as the PRE_PICKUP_COLLISION callback. For example, you can prevent a player from picking up the collectible by returning false. (However, note that this callback will continue to fire for every frame that the player touches the pedestal, so you would need to continue returning false.)

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the PlayerVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the PlayerType provided.
function preGetPedestal(player: EntityPlayer, collectible: EntityPickupCollectible): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2449


PRE_ITEM_PICKUP

PRE_ITEM_PICKUP = 133

Fires from the POST_PEFFECT_UPDATE_REORDERED callback when an item becomes queued (i.e. when the player begins to hold the item above their head).

Note that this callback will only fire once per Forgotten/Soul pair.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ItemType provided.
  • You can provide an optional fourth argument that will make the callback only fire if the sub-type matches the CollectibleType or the TrinketType provided.
function preItemPickup(
player: EntityPlayer,
pickingUpItem: PickingUpItem,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2470


PRE_KNIFE_COLLISION_FILTER

PRE_KNIFE_COLLISION_FILTER = 134

The exact same thing as the vanilla PRE_KNIFE_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the KnifeVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function preKnifeCollisionFilter(
knife: EntityKnife,
collider: Entity,
low: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2490


PRE_NEW_LEVEL

PRE_NEW_LEVEL = 135

Fires on the POST_RENDER frame before the player is taken to a new floor. Only fires when a player jumps into a trapdoor or enters a heaven door (beam of light). Does not fire on the first floor of the run. Does not fire when the player reloads/reseeds the current floor (i.e. Forget Me Now, 5-pip dice room).

This callback passes the EntityPlayer object for the player who jumped into the trapdoor or entered the heaven door, if needed.

function preNewLevel(player: EntityPlayer): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2505


PRE_NPC_COLLISION_FILTER

PRE_NPC_COLLISION_FILTER = 136

The exact same thing as the vanilla PRE_NPC_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function preNPCCollisionFilter(
npc: EntityNPC,
collider: Entity,
low: boolean,
): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2527


PRE_NPC_UPDATE_FILTER

PRE_NPC_UPDATE_FILTER = 137

The exact same thing as the vanilla PRE_NPC_UPDATE callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.
function preNPCUpdateFilter(entity: Entity): boolean | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2545


PRE_PROJECTILE_COLLISION_FILTER

PRE_PROJECTILE_COLLISION_FILTER = 138

The exact same thing as the vanilla PRE_PROJECTILE_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the ProjectileVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function preProjectileCollisionFilter(
tear: EntityTear,
collider: Entity,
low: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2565


PRE_ROOM_ENTITY_SPAWN_FILTER

PRE_ROOM_ENTITY_SPAWN_FILTER = 139

The exact same thing as the vanilla PRE_ROOM_ENTITY_SPAWN callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the EntityType or GridEntityXMLType provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the variant provided.
  • You can provide an optional fifth argument that will make the callback only fire if it matches the sub-type provided.

You can use the isGridEntityXMLType helper function to convert the entityTypeOrGridEntityXMLType argument to an EntityType or GridEntityXMLType, if needed.

function preRoomEntitySpawnFilter(
entityTypeOrGridEntityXMLType: EntityType | GridEntityXMLType,
variant: int,
subType: int,
gridIndex: int,
seed: Seed,
): [type: EntityType | GridEntityXMLType, variant: int, subType: int] | undefined {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2592


PRE_TEAR_COLLISION_FILTER

PRE_TEAR_COLLISION_FILTER = 140

The exact same thing as the vanilla PRE_TEAR_COLLISION callback, except this callback allows you to specify extra arguments for additional filtration.

When registering the callback with the ModUpgraded.AddCallbackCustom method:

  • You can provide an optional third argument that will make the callback only fire if it matches the TearVariant provided.
  • You can provide an optional fourth argument that will make the callback only fire if it matches the sub-type provided.
function preTearCollisionFilter(
tear: EntityTear,
collider: Entity,
low: boolean,
): void {}

Defined in

packages/isaacscript-common/src/enums/ModCallbackCustom.ts:2612