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 theTrinketType
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:
- Normally,
POST_PEFFECT_UPDATE
fires beforePOST_GAME_STARTED
. Since mod variables are often initialized at the beginning of thePOST_GAME_STARTED
callback, this can cause problems. - 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. You can optionally
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:
- Normally,
POST_PLAYER_RENDER
fires beforePOST_GAME_STARTED
. Since mod variables are often initialized at the beginning of thePOST_GAME_STARTED
callback, this can cause problems. - 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:
- Normally,
POST_PLAYER_UPDATE
fires beforePOST_GAME_STARTED
. Since mod variables are often initialized at the beginning of thePOST_GAME_STARTED
callback, this can cause problems. - 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 {}