Skip to content

Class "EntityPlayer"⚓︎

Info

你可以通过以下函数获取此类:

Example Code

local player = Isaac.GetPlayer()

Class Diagram⚓︎

    classDiagram
    class Entity:::diagramCurrentPage
    class EntityBomb
    class EntityEffect
    class EntityFamiliar
    class EntityKnife
    class EntityLaser
    class EntityNPC
    class EntityPickup
    class EntityPlayer
    class EntityProjectile
    class EntityTear
    Entity <|-- EntityBomb
    Entity <|-- EntityEffect
    Entity <|-- EntityFamiliar
    Entity <|-- EntityKnife
    Entity <|-- EntityLaser
    Entity <|-- EntityNPC
    Entity <|-- EntityPickup
    Entity <|-- EntityPlayer
    Entity <|-- EntityProjectile
    Entity <|-- EntityTear
    link Entity "Entity.html" "Go to page for 'Entity' class"
    link EntityBomb "EntityBomb.html" "Go to page for 'EntityBomb' class"
    link EntityEffect "EntityEffect.html" "Go to page for 'EntityEffect' class"
    link EntityFamiliar "EntityFamiliar.html" "Go to page for 'EntityFamiliar' class"
    link EntityKnife "EntityKnife.html" "Go to page for 'EntityKnife' class"
    link EntityLaser "EntityLaser.html" "Go to page for 'EntityLaser' class"
    link EntityNPC "EntityNPC.html" "Go to page for 'EntityNPC' class"
    link EntityPickup "EntityPickup.html" "Go to page for 'EntityPickup' class"
    link EntityPlayer "EntityPlayer.html" "Go to page for 'EntityPlayer' class"
    link EntityProjectile "EntityProjectile.html" "Go to page for 'EntityProjectile' class"
    link EntityTear "EntityTear.html" "Go to page for 'EntityTear' class"

Functions⚓︎

Add·Black·Hearts ()⚓︎

void AddBlackHearts ( int BlackHearts )⚓︎

给玩家添加黑心。1个单位是半颗心。用负数移除它们。

Example Code

This code adds 1 full black heart to the player.

1
Isaac.GetPlayer():AddBlackHearts(2)

Add·Blood·Charge ()⚓︎

void AddBloodCharge ( int Amount )⚓︎

给玩家添加血量充能。血量充能在除堕化伯大妮以外的角色上没有任何作用。


Add·Blue·Flies ()⚓︎

Entity AddBlueFlies ( int Amount, Vector Position, Entity Target )⚓︎

Amount

饰品鱼尾将始终将此函数添加的苍蝇数量加倍。


Add·Blue·Spider ()⚓︎

Entity AddBlueSpider ( Vector Position )⚓︎

Example Code

This code spawns 3 blue spiders at the player's position.

1
2
3
4
local player = Isaac.GetPlayer()
for _ = 1, 3 do
player:AddBlueSpider(player.Position)
end

Add·Bombs ()⚓︎

void AddBombs ( int Amount )⚓︎

给玩家添加炸弹。用负数移除它们。

Example Code

This code removes 1 bomb from the player.

1
Isaac.GetPlayer():AddBombs(-1)

Add·Bone·Hearts ()⚓︎

void AddBoneHearts ( int Hearts )⚓︎

给玩家添加骨心。1个单位是单颗骨心。用负数移除它们。

Example Code

This code adds 1 bone heart to the player.

1
Isaac.GetPlayer():AddBoneHearts(1)

Add·Broken·Hearts ()⚓︎

void AddBrokenHearts ( int BrokenHearts )⚓︎

给玩家添加碎心。1个单位是单颗碎心。用负数移除它们。

Example Code

This code adds 1 broken heart to the player, then takes it away.

1
2
Isaac.GetPlayer():AddBrokenHearts(1)
Isaac.GetPlayer():AddBrokenHearts(-1)

Add·Cache·Flags ()⚓︎

void AddCacheFlags ( CacheFlag CacheFlag )⚓︎

在下一次缓存重新计算中,将重新计算提供的缓存标志。

Example Code

This code will add several cacheflags.

1
Isaac.GetPlayer():AddCacheFlags(CacheFlag.CACHE_DAMAGE | CacheFlag.CACHE_FIREDELAY | CacheFlag.CACHE_LUCK)

Add·Card ()⚓︎

void AddCard ( Card ID )⚓︎


Add·Coins ()⚓︎

void AddCoins ( int Amount )⚓︎

给玩家添加金币。用负数移除它们。

Example Code

This code adds 1 coin to the player.

1
Isaac.GetPlayer():AddCoins(1)

Add·Collectible ()⚓︎

void AddCollectible ( CollectibleType Type, int Charge = 0, boolean FirstTimePickingUp = true, ActiveSlot Slot = ActiveSlot.SLOT_PRIMARY, int VarData = 0)⚓︎

void AddCollectible ( CollectibleType Type, int Charge = 0, boolean FirstTimePickingUp = true, ActiveSlot Slot = ActiveSlot.SLOT_PRIMARY, int VarData = 0, ItemPoolType PoolType )⚓︎

设置 FirstTimePickingUp 为false 将不会添加物品的消耗品(钥匙、炸弹等),并且不会计入套装。

  • Slot 0 是默认值 (normal active item)
  • Slot 1 是 Schoolbag 使用的
  • Slot 2 是用于口袋主动物品的
Notes

Slot 2 不能被用于开始时没有口袋主动物品的角色

VarData is used for the storage of a persistent context-sensitive value

Notes

这是一个使用 VarData 的所有物品的列表:

  • 魂火罐: 魂火会在下一次使用时生成 (最大12)
  • 无限骰, 空白卡, 透明符文, 安慰剂: 当前最大充能 (任何大于0的值)
  • Hold: 存储的便便
    • 便便类型:
    • [0] 无
    • [1] 普通
    • [2] 苍蝇
    • [3] 火焰
    • [4] 石化
    • [5] 有毒
    • [6] 黑色
    • [7] 神圣
    • [8] X-Lax
    • [9] Fart
    • [10] Bomb
    • [11] Explosive Diarrhea
    • [12+] Empty

Add·Controls·Cooldown ()⚓︎

void AddControlsCooldown ( int Cooldown )⚓︎


Add·Costume ()⚓︎

void AddCostume ( ItemConfigItem Item, boolean ItemStateOnly )⚓︎


Add·Curse·Mist·Effect ()⚓︎

void AddCurseMistEffect ( )⚓︎


Add·Dead·Eye·Charge ()⚓︎

void AddDeadEyeCharge ( )⚓︎


Add·Dollar·Bill·Effect ()⚓︎

void AddDollarBillEffect ( )⚓︎


Add·Eternal·Hearts ()⚓︎

void AddEternalHearts ( int EternalHearts )⚓︎

给玩家添加永恒之心。1个单位是半颗心。用负数移除它们。

(注意,当你拥有超过一个时,永恒之心会自动变为完整的心。)

Example Code

This code adds 1 eternal heart to the player.

1
Isaac.GetPlayer():AddEternalHearts(1)

Add·Friendly·Dip ()⚓︎

void AddFriendlyDip ( int Subtype, Vector Position )⚓︎

Dip Subtypes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
0: normal
1: red
2: corny
3: golden
4: rainbow
5: black
6: holy
12: stone
13: flaming
14: poison
20: brownie

Add·Giga·Bombs ()⚓︎

void AddGigaBombs ( int GigaBombs )⚓︎

Notes

巨型炸弹不会增加炸弹计数,请确保提前增加炸弹数量! 你不能添加超过玩家当前炸弹数量的巨型炸弹。


Add·Golden·Bomb ()⚓︎

void AddGoldenBomb ( )⚓︎


Add·Golden·Hearts ()⚓︎

void AddGoldenHearts ( int Hearts )⚓︎

给玩家添加金心。1个单位是单颗金心。用负数移除它们。

Example Code

This code adds 1 golden heart to the player.

1
Isaac.GetPlayer():AddGoldenHearts(1)

Add·Golden·Key ()⚓︎

void AddGoldenKey ( )⚓︎


Add·Hearts ()⚓︎

void AddHearts ( int Hearts )⚓︎

给玩家添加红心。如果有空的心容器,则添加红心。1个单位是半颗心。用负数移除生命值。

Example Code

This code adds 1 full red heart to the player.

1
Isaac.GetPlayer():AddHearts(2)

Add·Item·Wisp ()⚓︎

EntityFamiliar AddItemWisp ( CollectibleType Collectible, Vector Position, boolean AdjustOrbitLayer = false )⚓︎


Add·Jar·Flies ()⚓︎

void AddJarFlies ( int Flies )⚓︎


Add·Jar·Hearts ()⚓︎

void AddJarHearts ( int Hearts )⚓︎


Add·Keys ()⚓︎

void AddKeys ( int Amount )⚓︎

给玩家添加钥匙。用负数移除它们。

Example Code

This code adds 1 key to the player.

1
Isaac.GetPlayer():AddKeys(1)

Add·Max·Hearts ()⚓︎

void AddMaxHearts ( int MaxHearts, boolean IgnoreKeeper )⚓︎

给玩家添加心容器。2个单位是一个完整的心容器。用负数移除它们。

Notes

可以添加半颗心容器到玩家身上。这将显示为常规心容器,但只能填充一半。

Example Code

This code adds 1 heart container to the player.

1
Isaac.GetPlayer():AddMaxHearts(2, true)
Bugs

对店长无效。IgnoreKeeper 参数似乎无法按预期工作。

最大心容器可以添加或移除到店长身上,而不管这个布尔值是什么。

如果店长拥有贪婪的胃袋,而这个布尔值被设置为false,则无法添加最大心容器到店长身上,但可以正常移除。

如果店长拥有贪婪的胃袋,而这个布尔值被设置为true,则可以正常添加或移除最大心容器到店长身上。


Add·Minisaac ()⚓︎

EntityFamiliar AddMinisaac ( Vector Position, boolean PlayAnim = true )⚓︎


Add·Null·Costume ()⚓︎

void AddNullCostume ( NullItemID NullId )⚓︎


Add·Pill ()⚓︎

void AddPill ( PillColor Pill )⚓︎


Add·Player·Form·Costume ()⚓︎

void AddPlayerFormCostume ( PlayerForm Form )⚓︎

添加给定变身的服装。


Add·Poop·Mana ()⚓︎

void AddPoopMana ( int Num )⚓︎

添加(或移除)粪便消耗品。


Add·Pretty·Fly ()⚓︎

void AddPrettyFly ( )⚓︎


Add·Rotten·Hearts ()⚓︎

void AddRottenHearts ( int RottenHearts )⚓︎

添加腐烂的心。1个单位是半颗心。用负数移除腐烂的心。

Example Code

This code adds 1 full rotten heart to the player.

1
Isaac.GetPlayer():AddRottenHearts(2)

Add·Soul·Charge ()⚓︎

void AddSoulCharge ( int Amount )⚓︎

添加灵魂充能到玩家身上。灵魂充能对除了伯大妮以外的角色没有任何作用。


Add·Soul·Hearts ()⚓︎

void AddSoulHearts ( int SoulHearts )⚓︎

添加魂心到玩家。1个单位是半颗心。用负数移除它们。

Example Code

This code adds 1 full soul heart to the player.

1
Isaac.GetPlayer():AddSoulHearts(2)

Add·Swarm·Fly·Orbital ()⚓︎

EntityFamiliar AddSwarmFlyOrbital ( Vector Position )⚓︎


Add·Trinket ()⚓︎

void AddTrinket ( TrinketType Type, boolean FirstTimePickingUp = true )⚓︎

  • 如果玩家没有任何空的饰品槽,这个函数将不做任何事情。

  • 如果玩家有一个空的饰品槽但已经有一个饰品,新饰品将进入第一个槽,现有饰品将被推回到第二个槽。

  • 如果提供的参数为0或其他无效的饰品ID,游戏将崩溃。

  • FirstTimePickingUp设置为false将不会为该物品生成或添加拾取物,也不会导致其计入变身。

Example Code

This code adds the golden variant of the Swallowed Penny trinket to the player.

1
Isaac.GetPlayer():AddTrinket(TrinketType.TRINKET_SWALLOWED_PENNY | TrinketType.TRINKET_GOLDEN_FLAG)

Add·Wisp ()⚓︎

EntityFamiliar AddWisp ( CollectibleType Collectible, Vector Position, boolean AdjustOrbitLayer = false, boolean DontUpdate = false )⚓︎

魂火的类型可以通过Collectible来定义。如果ID与具有特殊魂火的主动物品不对应,则默认为常规蓝色魂火。

要访问特殊魂火变体,例如Delirious形式,您需要将65536 (1 << 16)添加到ID。例如:Delirious Monstro的id = s14,因此魂火的ID为65550


Animate·Appear ()⚓︎

void AnimateAppear ( )⚓︎

播放在关卡开始时通常播放的动画。


Animate·Card ()⚓︎

void AnimateCard ( Card ID, string AnimName = "Pickup" )⚓︎


Animate·Collectible ()⚓︎

void AnimateCollectible ( CollectibleType Collectible, string AnimName = "Pickup", string SpriteAnimName = "PlayerPickupSparkle" )⚓︎

AnimName001.000_player.anm2 中的动画名称(例如 PickupUseItem)。 SpriteAnimName005.100_collectible.anm2 中的动画名称(例如 PlayerPickupPlayerPickupSparkle)。


Animate·Happy ()⚓︎

void AnimateHappy ( )⚓︎

播放高兴动画,当服用正面药丸时播放。

Example Code

This code plays the happy animation.

1
Isaac.GetPlayer():AnimateHappy()

Animate·Light·Travel ()⚓︎

void AnimateLightTravel ( )⚓︎

播放在上升时进入光柱或进入大教堂时播放的动画。

Example Code

Plays the animation.

1
Isaac.GetPlayer():AnimateLightTravel()

Animate·Pickup ()⚓︎

void AnimatePickup ( Sprite sprite, boolean HideShadow = false, string AnimName = "Pickup" )⚓︎

播放拾取动画,使用任何提供的Sprite对象

HideShadow通常在渲染具有自定义阴影层的精灵时设置为true


Animate·Pill ()⚓︎

void AnimatePill ( PillColor Pill, string AnimName = "Pickup" )⚓︎


Animate·Pitfall·In ()⚓︎

void AnimatePitfallIn ( )⚓︎

造成1/2心的伤害并播放掉入陷阱的动画。


Animate·Pitfall·Out ()⚓︎

void AnimatePitfallOut ( )⚓︎

跳出陷阱的动画。


Animate·Sad ()⚓︎

void AnimateSad ( )⚓︎

播放悲伤动画,当服用负面药丸时播放。

Example Code

Plays the sad animation.

1
Isaac.GetPlayer():AnimateSad()

Animate·Teleport ()⚓︎

void AnimateTeleport ( boolean Up )⚓︎

当传送到另一个房间时播放的动画。


Animate·Trapdoor ()⚓︎

void AnimateTrapdoor ( )⚓︎

播放跳下陷阱门的动画。

Example Code

Plays the animation of jumping down a trapdoor.

1
Isaac.GetPlayer():AnimateTrapdoor()

Animate·Trinket ()⚓︎

void AnimateTrinket ( TrinketType Trinket, string AnimName = "Pickup", string SpriteAnimName = "PlayerPickupSparkle" )⚓︎


Are·Controls·Enabled ()⚓︎

boolean AreControlsEnabled ( )⚓︎


Are·Opposing·Shoot·Directions·Pressed ()⚓︎

boolean AreOpposingShootDirectionsPressed ( )⚓︎

返回最近的移动输入中非零的摇杆方向,但在玩家停止后变为零。


Can·Add·Collectible ()⚓︎

boolean CanAddCollectible ( CollectibleType Type = CollectibleType.COLLECTIBLE_NULL )⚓︎


Can·Pick·Black·Hearts ()⚓︎

boolean CanPickBlackHearts ( )⚓︎

返回 true 如果玩家有容纳更多黑心的空间


Can·Pick·Bone·Hearts ()⚓︎

boolean CanPickBoneHearts ( )⚓︎

返回 true 如果玩家有容纳更多骨心的空间


Can·Pick·Golden·Hearts ()⚓︎

boolean CanPickGoldenHearts ( )⚓︎

返回 true 如果玩家有容纳更多金心的空间


Can·Pick·Red·Hearts ()⚓︎

boolean CanPickRedHearts ( )⚓︎


Can·Pick·Rotten·Hearts ()⚓︎

boolean CanPickRottenHearts ( )⚓︎

返回 true 如果玩家有容纳更多腐心的空间


Can·Pick·Soul·Hearts ()⚓︎

boolean CanPickSoulHearts ( )⚓︎

返回 true 如果玩家有容纳更多魂心的空间


Can·Pickup·Item ()⚓︎

boolean CanPickupItem ( )⚓︎

返回 true 如果玩家现在可以拾取物品


Can·Shoot ()⚓︎

boolean CanShoot ( )⚓︎


Can·Turn·Head ()⚓︎

boolean CanTurnHead ( )⚓︎

返回 true 如果头部应该对按键做出反应,否则返回 false


Change·Player·Type ()⚓︎

void ChangePlayerType ( PlayerType PlayerType )⚓︎

被用于改变一个玩家的类型。例如将该隐变成抹大拉。

在 MC_POST_PLAYER_INIT 中更改玩家类型将导致玩家获得该角色的默认物品。例如,抹大拉将获得她的美味的心,而无需您显式添加它。这里的例外包括可解锁物品(例如,以撒的 D6)和默认数量的心脏/钥匙/炸弹/硬币。您可以在初始化后更改玩家类型,但通常需要负责添加与该角色相关的任何物品。

将玩家类型更改为雅各布也会生成以扫。


Check·Familiar ()⚓︎

void CheckFamiliar ( FamiliarVariant FamiliarVariant, int TargetCount, RNG rng, ItemConfigItem SourceItemConfigItem = nil, int FamiliarSubType = -1 )⚓︎

访问这个方法以生成与自定义可收集物品相关的适当数量的随从。

  • 如果指定的目标数量少于当前的随从数量,它将生成更多,直到达到目标数量。

  • 如果指定的目标数量大于当前的随从数量,它将去除随从,直到达到目标数量。

这意味着它应该在 EvaluateCache 回调中调用(当缓存标志等于 CacheFlag.CACHE_FAMILIARS 时)。

在大多数情况下,IsaacScript 用户应该使用 checkFamiliarFromCollectibles 辅助函数,而不是直接使用此方法,因为它会自动计算适当的目标数量。

FamiliarVariant: 大多数情况下, 使用随从变体作为自定义随从的基础。

TargetCount: 期望该实体玩家应该拥有的此随从变体的数量。此参数可以简单地是当前实体玩家拥有的某个物品的数量。但是,如果您希望您的随从与怪物手册和朋友盒子协同作用,则此参数应为 EntityPlayer:GetCollectibleNum(collectibleType) + EntityPlayer:GetEffects():GetCollectibleEffectNum(collectibleType)

rng: 可以是生成随从的可收集物品的 EntityPlayer.GetCollectibleRNG 的 RNG 对象。

SourceItemConfigItem: 生成此随从的 ItemConfigItem。默认情况下为 nil,但应始终指定,以便祭品祭坛正常工作。(它告知游戏如果随从被标记为“cansacrifice”实体标签,则应删除哪个可收集物品。)可以通过以下方式获得:Isaac.GetItemConfig():GetCollectible(collectibleType)

FamiliarSubType: 要检查的随从子类型。-1 匹配任何子类型。

Example Code

This code spawns 3 "Sister Maggy" familiars.

1
2
3
4
5
6
local player = Isaac.GetPlayer()
local sourceCollectibleID = CollectibleType.COLLECTIBLE_SAD_ONION
local collectibleRNG = player:GetCollectibleRNG(sourceCollectibleID)
local itemConfig = Isaac.GetItemConfig():GetCollectible(sourceCollectibleID)

player:CheckFamiliar(FamiliarVariant.SISTER_MAGGY, 3, collectibleRNG, itemConfig)

Clear·Costumes ()⚓︎

void ClearCostumes ( )⚓︎

移除所有服装。


Clear·Dead·Eye·Charge ()⚓︎

void ClearDeadEyeCharge ( )⚓︎


Clear·Temporary·Effects ()⚓︎

void ClearTemporaryEffects ( )⚓︎

将在玩家退出房间时调用。


Discharge·Active·Item ()⚓︎

void DischargeActiveItem ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

设置您的主动物品的充能为 0,而不触发主动物品效果。


Donate·Luck ()⚓︎

void DonateLuck ( int Luck )⚓︎

不像Luck属性应该在MC_EVALUATE_CACHE中设置,这个方法可以在任何地方使用,并会自动记住添加的任何额外运气。


Do·Zit·Effect ()⚓︎

void DoZitEffect ( Vector Direction )⚓︎

发射一个青春痘,效果与“青春痘”物品发射的效果相同。


Drop·Pocket·Item ()⚓︎

void DropPocketItem ( int PocketNum, Vector Pos )⚓︎

扔下一个持有的口袋物品(卡片、药丸、符文……)从给定的物品槽在给定的位置。可能的口袋编号是 [0, 1, 2, 3]。扔下口袋主动物品或骰子袋骰子是无效的。


Drop·Trinket ()⚓︎

void DropTrinket ( Vector DropPos, boolean ReplaceTick )⚓︎


Evaluate·Items ()⚓︎

void EvaluateItems ( )⚓︎

触发一个缓存重新评估,将会触发 MC_EVALUATE_CACHE 回调。

在使用此函数之前,您需要先设置适当的缓存标志。请参阅下面的示例。

Example Code

This code re-evaluates all of the stats for the player.

1
2
3
local player = Isaac.GetPlayer()
player:AddCacheFlags(CacheFlag.CACHE_ALL)
player:EvaluateItems()

Fire·Bomb ()⚓︎

EntityBomb FireBomb ( Vector Position, Vector Velocity, Entity Source = nil )⚓︎


Fire·Brimstone ()⚓︎

EntityLaser FireBrimstone ( Vector Direction, Entity Source = nil, float DamageMultiplier = 1 )⚓︎


Fire·Delayed·Brimstone ()⚓︎

EntityLaser FireDelayedBrimstone ( float Angle, Entity Parent )⚓︎


Fire·Knife ()⚓︎

EntityKnife FireKnife ( Entity Parent, float RotationOffset = 0, boolean CantOverwrite = false, int SubType = 0, int Variant = 0 )⚓︎

Knife Variants
1
2
3
4
5
6
7
8
9
0: Mom's Knife
1: Bone Club
2: Bone Scythe
3: Berserk Club
4: Bag of Crafting
5: Sumptorium
9: Notched Axe
10: Spirit Sword
11: Tech Sword

Fire·Tear ()⚓︎

EntityTear FireTear ( Vector Position, Vector Velocity, boolean CanBeEye = true, boolean NoTractorBeam = false, boolean CanTriggerStreakEnd = true, Entity Source = nil, float DamageMultiplier = 1 )⚓︎

  • CanBeEye: 如果玩家拥有邪恶之眼物品,传递 true 允许泪水有机会成为眼泪。
  • NoTractorBeam: 如果玩家拥有牵引光束物品,传递 true 意味着泪水将免受光束影响。
  • CanTriggerStreakEnd: 如果玩家拥有死亡之眼物品,传递 false 意味着泪水将免于结束连击。

Fire·Tech·Laser ()⚓︎

EntityLaser FireTechLaser ( Vector Position, LaserOffset OffsetID, Vector Direction, boolean LeftEye, boolean OneHit = false, Entity Source = nil, float DamageMultiplier = 1 )⚓︎

Bugs

DamageMultiplier 变量不影响当提供 LASER_TECH2_OFFSET 作为偏移量时。


Fire·Tech·XLaser ()⚓︎

EntityLaser FireTechXLaser ( Vector Position, Vector Direction, float Radius, Entity Source = nil, float DamageMultiplier = 1 )⚓︎


Flush·Queue·Item ()⚓︎

boolean FlushQueueItem ( )⚓︎

在动画完成后,或在特殊情况下调用以防止错误


Full·Charge ()⚓︎

boolean FullCharge ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY, int Force = false )⚓︎

完全充能当前的主动物品。如果物品被完全充能,返回 true;否则返回 false。如果玩家拥有电池,它将首先尝试填充第一个充能槽,然后是电池槽。

Force: 如果设置为 true,物品将始终充能,即使它们通常无法通过电池充能

ActiveSlot

将 ActiveSlot 参数设置为 -1 将充能所有槽中的物品。


Get·Active·Charge ()⚓︎

int GetActiveCharge ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

获取当前主动物品的充能值。


Get·Active·Item ()⚓︎

CollectibleType GetActiveItem ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

返回当前持有的主动物品。如果没有物品被持有,则返回 0


Get·Active·Sub·Charge ()⚓︎

int GetActiveSubCharge ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

获取当前主动物品的副充能值(即第二充能槽)。

Bug

这个函数似乎总是返回 0。使用 EntityPlayer:GetActiveCharge() 来获取任何类型的充能值。使用 EntityPlayer:GetBatteryCharge() 来获取第二个充能槽的充能值。


Get·Active·Weapon·Entity ()⚓︎

Entity GetActiveWeaponEntity ( )⚓︎


Get·Aim·Direction ()⚓︎

const Vector GetAimDirection ( )⚓︎


Get·Baby·Skin ()⚓︎

BabySubType GetBabySkin ( )⚓︎


Get·Battery·Charge ()⚓︎

int GetBatteryCharge ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

获取当前主动物品的第二充能槽的充能进度。该槽仅在你拥有可收集物品“电池”时处于激活状态。


Get·Black·Hearts ()⚓︎

int GetBlackHearts ( )⚓︎

这个函数并不返回黑心的数量;而是返回一个位掩码,用于表示哪些灵魂心是黑心。

Example

设想我们有以下血量的设置,其中 S 是灵魂心,B 是黑心:

1
B S S B B S S B B

Calling the function will return:

1
Isaac.GetPlayer():GetBlackHearts() -- returns 409, which is 0001 1001 1001 in binary. Therefore, the read order is right to left.

Quick code example to parse soul hearts vs black hearts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
-- if you setup your hearts as described above then you'll get the following values
-- GetSoulHearts = 18
-- GetBlackHearts = 409
local tbl = {}
local player = Isaac.GetPlayer()
-- loop over all the soul hearts
-- divide by 2 because we need to go from half to whole hearts
-- math.ceil to make sure we account for a possible half heart at the end
for i = 0, math.ceil(player:GetSoulHearts() / 2) - 1 do
  -- you can also use BitSet128 here if you want: BitSet128(player:GetBlackHearts(),0):Get(i)
  table.insert(tbl, (player:GetBlackHearts() & (1 << i)) > 0 and 'B' or 'S')
end
if player:GetSoulHearts() % 2 ~= 0 then
  tbl[#tbl] = string.lower(tbl[#tbl]) -- lowercase to indicate half heart at end
end
print(table.concat(tbl, ' ')) -- prints: B S S B B S S B B

Get·Blood·Charge ()⚓︎

int GetBloodCharge ( )⚓︎

返回玩家的血量充能值。


Get·Body·Color ()⚓︎

SkinColor GetBodyColor ( )⚓︎


Get·Bomb·Flags ()⚓︎

int GetBombFlags ( )⚓︎


Get·Bomb·Variant ()⚓︎

BombVariant GetBombVariant ( TearFlags TearFlags, boolean ForceSmallBomb )⚓︎

通过传递泪弹标签为炸弹视觉效果添加额外效果,例如燃烧 -> 炙热炸弹,即使玩家没有道具炙热炸弹。 ForceSmallBomb 将覆盖 TEAR_PERSISTENT 的大炸弹变体。


Get·Bone·Hearts ()⚓︎

int GetBoneHearts ( )⚓︎

返回玩家的骨心数量。这个值并不像 EntityPlayer.GetMaxHearts 方法那样翻倍,所以如果例如玩家有 3 个骨心,这个函数将返回 3。

另请参阅 EntityPlayer.GetEffectiveMaxHearts 方法,该方法会考虑骨心。


Get·Broken·Hearts ()⚓︎

int GetBrokenHearts ( )⚓︎

返回玩家的碎心数量。这个值并不像 EntityPlayer.GetMaxHearts 方法那样翻倍,所以如果例如玩家有 3 个碎心,这个函数将返回 3。


Get·Card ()⚓︎

Card GetCard ( int SlotId )⚓︎

获取玩家在给定物品槽中持有的卡牌的 ID(0 = 主槽,1 = 副槽,2 或 3)。当槽中没有卡牌时返回 0


Get·Card·RNG ()⚓︎

RNG GetCardRNG ( Card ID )⚓︎


Get·Collectible·Count ()⚓︎

int GetCollectibleCount ( )⚓︎


Get·Collectible·Num ()⚓︎

int GetCollectibleNum ( CollectibleType Type, boolean OnlyCountTrueItems = false )⚓︎

OnlyCountTrueItems: 如果设置为 true,函数仅计算玩家实际拥有的可收集物品,并忽略 莉莉丝的淫魔、3美元 授予的物品等。


Get·Collectible·RNG ()⚓︎

RNG GetCollectibleRNG ( CollectibleType ID )⚓︎

获取道具的 RNG 对象。

示例代码

这段代码将为你提供道具“伤心洋葱”的 RNG 对象。

1
2
local player = Isaac.GetPlayer()
local collectibleRNG = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_SAD_ONION)

Get·Costume·Null·Pos ()⚓︎

Vector GetCostumeNullPos ( string NullFrameName, boolean HeadScale, Vector Direction )⚓︎


Get·Damage·Cooldown ()⚓︎

int GetDamageCooldown ( )⚓︎

当玩家受到伤害时,他们会闪烁不同的颜色并获得无敌帧。此方法返回无敌帧的数量。通常,当玩家受到半颗心的伤害时,将获得 60 帧无敌时间;而受到一颗心的伤害时,将获得 120 帧无敌时间。此外,盲目的怒火饰品可以影响无敌帧的授予方式。

请注意,此函数返回的帧是渲染帧,而不是游戏帧。


Get·Effective·Blood·Charge ()⚓︎

int GetEffectiveBloodCharge ( )⚓︎

返回玩家的血量充能。除堕化伯大妮外将返回 0


Get·Effective·Max·Hearts ()⚓︎

int GetEffectiveMaxHearts ( )⚓︎

返回玩家在心容器和骨心中可以容纳的红心数量。1 个单位是半颗红心。

Example: 你有 3 个红心容器和 1 个骨心。6(红)+ 2(骨)= 8


Get·Effective·Soul·Charge ()⚓︎

int GetEffectiveSoulCharge ( )⚓︎

返回玩家的灵魂充能。除伯大妮外将返回 0


Get·Effects ()⚓︎

TemporaryEffects GetEffects ( )⚓︎


Get·Eternal·Hearts ()⚓︎

int GetEternalHearts ( )⚓︎

返回玩家的永恒之心数量。


Get·Extra·Lives ()⚓︎

int GetExtraLives ( )⚓︎

返回玩家当前拥有的额外生命数量。


Get·Fire·Direction ()⚓︎

Direction GetFireDirection ( )⚓︎


Get·Flying·Offset ()⚓︎

Vector GetFlyingOffset ( )⚓︎


Get·Golden·Hearts ()⚓︎

int GetGoldenHearts ( )⚓︎

返回玩家的金心数量。


Get·Greed·Donation·Break·Chance ()⚓︎

float GetGreedDonationBreakChance ( )⚓︎


Get·Head·Color ()⚓︎

SkinColor GetHeadColor ( )⚓︎


Get·Head·Direction ()⚓︎

Direction GetHeadDirection ( )⚓︎


Get·Heart·Limit ()⚓︎

int GetHeartLimit ( )⚓︎


Get·Hearts ()⚓︎

int GetHearts ( )⚓︎

返回玩家在心容器和骨心中的红心数量。1 个单位是半颗红心。


Get·Item·State ()⚓︎

CollectibleType GetItemState ( )⚓︎


Get·Jar·Flies ()⚓︎

int GetJarFlies ( )⚓︎


Get·Jar·Hearts ()⚓︎

int GetJarHearts ( )⚓︎


Get·Laser·Offset ()⚓︎

Vector GetLaserOffset ( LaserOffset ID, Vector Direction )⚓︎


Get·Last·Action·Triggers ()⚓︎

int GetLastActionTriggers ( )⚓︎


Get·Last·Damage·Flags ()⚓︎

int GetLastDamageFlags ( )⚓︎


Get·Last·Damage·Source ()⚓︎

const EntityRef GetLastDamageSource ( )⚓︎


Get·Last·Direction ()⚓︎

const Vector GetLastDirection ( )⚓︎


Get·Main·Twin ()⚓︎

EntityPlayer GetMainTwin ( )⚓︎

返回成对角色的主玩家或具有多种形态的角色的主形态。

  • 当在雅各布或以扫身上调用时,返回雅各布。
  • 当在堕化的遗骸或堕化的遗骸之魂身上调用时,返回堕化的遗骸。
  • 当在堕化拉撒路或死亡的堕化拉撒路身上调用时,返回他们自己。如果玩家拥有长子权,则返回堕化的拉撒路。
  • 当在任何其他角色上调用时,返回该角色。

Get·Max·Hearts ()⚓︎

int GetMaxHearts ( )⚓︎

返回玩家的心之容器数量。1 个单位是半颗心之容器。


Get·Max·Pocket·Items ()⚓︎

int GetMaxPocketItems ( )⚓︎

获取玩家可以携带的道具数量。(默认 1,拥有多指畸形或类似效果时为 2)

If you have a pocket active, it also increments the number by one.


Get·Max·Poop·Mana ()⚓︎

int GetMaxPoopMana ( )⚓︎

返回玩家可以持有的最大粪便消耗品数量。


Get·Max·Trinkets ()⚓︎

int GetMaxTrinkets ( )⚓︎

返回玩家可以携带的最大饰品数量。(默认 1,拥有妈妈的钱包或类似效果时为 2)


Get·Modeling·Clay·Effect ()⚓︎

CollectibleType GetModelingClayEffect ( )⚓︎


Get·Movement·Direction ()⚓︎

Direction GetMovementDirection ( )⚓︎


Get·Movement·Input ()⚓︎

const Vector GetMovementInput ( )⚓︎


Get·Movement·Joystick ()⚓︎

Vector GetMovementJoystick ( )⚓︎


Get·Movement·Vector ()⚓︎

Vector GetMovementVector ( )⚓︎


Get·Multi·Shot·Params ()⚓︎

MultiShotParams GetMultiShotParams ( WeaponType WeaponType = WeaponType.WEAPON_TEARS )⚓︎

Bug

自从它返回的 UserData 不能直接编辑,因此此函数的返回值只能与 GetMultiShotPositionVelocity() 函数结合使用。


Get·Multi·Shot·Position·Velocity ()⚓︎

PosVel GetMultiShotPositionVelocity ( int LoopIndex, WeaponType Weapon, Vector ShotDirection, float ShotSpeed, MultiShotParams params )⚓︎

调用此函数时,请在循环中使用,其中 LoopIndex 是 0 到当前 MultiShotParams 包含的泪水数量之间的数字。由于 MultiShotParams 目前无法通过 modding api 访问,因此您需要找到其他方法来获取该数量。

Removed Function

这个函数自忏悔版本 v1.7.9b.J835 以来不再存在!


Get·Name ()⚓︎

string GetName ( )⚓︎

返回玩家的名字(Isaac, Cain, Azazel,...)


Get·NPCTarget ()⚓︎

Entity GetNPCTarget ( )⚓︎

同样,这个函数通常返回玩家。然而,在某些情况下,NPC 可以被重定向攻击另一个目标,在这种情况下,这个函数将返回替代目标(例如,在使用最好的朋友之后)。


Get·Num·Blue·Flies ()⚓︎

int GetNumBlueFlies ( )⚓︎


Get·Num·Blue·Spiders ()⚓︎

int GetNumBlueSpiders ( )⚓︎


Get·Num·Bombs ()⚓︎

int GetNumBombs ( )⚓︎


Get·Num·Coins ()⚓︎

int GetNumCoins ( )⚓︎


Get·Num·Giga·Bombs ()⚓︎

int GetNumGigaBombs ( )⚓︎


Get·Num·Keys ()⚓︎

int GetNumKeys ( )⚓︎


Get·Other·Twin ()⚓︎

EntityPlayer GetOtherTwin ( )⚓︎

返回双人角色的另一个角色或具有多种形式的角色的另一种形态。

  • 当在雅各布身上调用时,返回以扫
  • 当在以扫身上调用时,返回雅各布。
  • 当在堕化遗骸身上调用时,返回堕化遗骸之魂。
  • 当在堕化遗骸之魂上调用时,返回堕化遗骸。
  • 当在堕化拉撒路身上调用时,仅当玩家拥有长子权时,它才会返回死亡的堕化拉撒路。否则,它返回 nil。
  • 当在任何其他角色上调用时,返回 nil。

Get·Pill ()⚓︎

PillColor GetPill ( int SlotId )⚓︎

获得玩家在给定物品槽中持有的药丸的 ID (0 = 主槽, 1 = 副槽, 2 或 3) 当在给定槽中没有药丸时返回 0


Get·Pill·RNG ()⚓︎

RNG GetPillRNG ( PillEffect ID )⚓︎


Get·Player·Type ()⚓︎

PlayerType GetPlayerType ( )⚓︎


Get·Pocket·Item ()⚓︎

const PlayerPocketItem GetPocketItem ( int SlotId )⚓︎

获得玩家在给定物品槽中持有的口袋物品 (卡牌、药丸、符文) 的用户数据。

Bugs

此函数返回用户数据,无法处理。因此它是损坏的,不应使用!


Get·Poop·Mana ()⚓︎

int GetPoopMana ( )⚓︎

返回玩家当前持有的粪便数量


Get·Poop·Spell ()⚓︎

PoopSpellType GetPoopSpell ( int Position )⚓︎

返回玩家粪便队列中给定位置的粪便类型


Get·Recent·Movement·Vector ()⚓︎

const Vector GetRecentMovementVector ( )⚓︎

返回驱动玩家移动的摇杆方向,同时考虑到某些修饰符,例如禁用的控制和种子效果。


Get·Rotten·Hearts ()⚓︎

int GetRottenHearts ( )⚓︎


Get·Shooting·Input ()⚓︎

Vector GetShootingInput ( )⚓︎

返回一个向量,表示该玩家正在按下的射击输入方向。

Shooting Angle diagram

GetShootingInput diagram


Get·Shooting·Joystick ()⚓︎

Vector GetShootingJoystick ( )⚓︎

返回一个向量,表示该玩家正在按下的射击输入方向。

可以查看 GetShootingInput 方法的图像。


Get·Smooth·Body·Rotation ()⚓︎

float GetSmoothBodyRotation ( )⚓︎


Get·Soul·Charge ()⚓︎

int GetSoulCharge ( )⚓︎

返回玩家当前的魂心充能的量。


Get·Soul·Hearts ()⚓︎

int GetSoulHearts ( )⚓︎

返回玩家当前的魂心数量。1 个单位是半颗心。

Notes

黑心计入此总数,因为游戏将其视为魂心。


Get·Sub·Player ()⚓︎

EntityPlayer GetSubPlayer ( )⚓︎

返回堕化遗骸的另一种形式。


Get·Tear·Hit·Params ()⚓︎

TearParams GetTearHitParams ( WeaponType WeaponType, float DamageScale = 1, int TearDisplacement = 1, Entity Source = nil )⚓︎

被用于命中时计算的眼泪参数 (例如:严厉的爱,普通感冒),DamageScale 用于基于伤害的缩放计算


Get·Tear·Movement·Inheritance ()⚓︎

Vector GetTearMovementInheritance ( Vector ShotDirection )⚓︎


Get·Tear·Poison·Damage ()⚓︎

float GetTearPoisonDamage ( )⚓︎


Get·Tear·Range·Modifier ()⚓︎

int GetTearRangeModifier ( )⚓︎

对于实验性疗法,返回 -101,具体取决于范围的掷骰结果。


Get·Total·Damage·Taken ()⚓︎

int GetTotalDamageTaken ( )⚓︎


Get·Tractor·Beam ()⚓︎

Entity GetTractorBeam ( )⚓︎


Get·Trinket ()⚓︎

TrinketType GetTrinket ( int TrinketIndex )⚓︎

获取玩家在指定饰品槽(0 或 1)中持有的饰品 ID。当指定槽位没有饰品时,返回 0


Get·Trinket·Multiplier ()⚓︎

int GetTrinketMultiplier ( TrinketType TrinketID )⚓︎

Gets the multiplier of a given Trinket effect. This is analog to the number of times the trinket effect is applied.

Multiplier Breakdown
  • Per normal trinket of this type equipped / gulped : +1
  • Per golden trinket of this type equipped / gulped : +2
  • Mom's Box equipped : +1 (does not stack)

Get·Trinket·RNG ()⚓︎

RNG GetTrinketRNG ( TrinketType TrinketID )⚓︎


Get·Velocity·Before·Update ()⚓︎

const Vector GetVelocityBeforeUpdate ( )⚓︎


Get·Zodiac·Effect ()⚓︎

CollectibleType GetZodiacEffect ( )⚓︎


Has·Collectible ()⚓︎

boolean HasCollectible ( CollectibleType Type, boolean IgnoreModifiers = false )⚓︎

IgnoreModifiers: If set to true, only counts collectibles the player actually owns and ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton


Has·Curse·Mist·Effect ()⚓︎

boolean HasCurseMistEffect ( )⚓︎


Has·Full·Hearts ()⚓︎

boolean HasFullHearts ( )⚓︎


Has·Full·Hearts·And·Soul·Hearts ()⚓︎

boolean HasFullHeartsAndSoulHearts ( )⚓︎


Has·Golden·Bomb ()⚓︎

boolean HasGoldenBomb ( )⚓︎


Has·Golden·Key ()⚓︎

boolean HasGoldenKey ( )⚓︎


Has·Invincibility ()⚓︎

boolean HasInvincibility ( DamageFlag Flags = 0 )⚓︎

returns true when player is in an invincibility state


Has·Player·Form ()⚓︎

boolean HasPlayerForm ( PlayerForm Form )⚓︎


Has·Timed·Item ()⚓︎

boolean HasTimedItem ( )⚓︎

Returns true if you have a timed active item (such as Brown Nugget) in the first active slot


Has·Trinket ()⚓︎

boolean HasTrinket ( TrinketType Type, boolean IgnoreModifiers = false )⚓︎

IgnoreModifiers: If set to true, only counts trinkets the player actually holds and ignores effects granted by other items


Has·Weapon·Type ()⚓︎

boolean HasWeaponType ( WeaponType WeaponType )⚓︎


Init·Baby·Skin ()⚓︎

void InitBabySkin ( )⚓︎


Is·Black·Heart ()⚓︎

boolean IsBlackHeart ( int Heart )⚓︎

This can be used instead of GetBlackHearts to figure out which soul hearts are black hearts.

Example

Imagine we have the following setup of hearts, where S is a soul heart and B is a black heart:

1
B S S B B S S B B

Each soul heart is composed of two halves. Only the odd numbers seem to trigger this function. Even numbers always return false. The following assumes that the indexing starts at 1 rather than 0, but regardless, it's the odd numbers that work here. The indexing here only applies to your soul/black hearts. It doesn't matter if you have other red/bone/etc hearts.

1
B(1,2) S(3,4) S(5,6) B(7,8) B(9,10) S(11,12) S(13,14) B(15,16) B(17,18)
1
2
3
4
Isaac.GetPlayer():IsBlackHeart(1) -- returns true (black heart)
Isaac.GetPlayer():IsBlackHeart(2) -- returns false (not useful)
Isaac.GetPlayer():IsBlackHeart(3) -- returns false (soul heart)
-- 1,7,9,15,17 all return true (black hearts)

Quick code example to parse soul hearts vs black hearts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
-- if you setup your hearts as described above then you'll get the following value
-- GetSoulHearts = 18
local tbl = {}
local player = Isaac.GetPlayer()
-- loop over all the soul heart odd indexes
for i = 1, player:GetSoulHearts(), 2 do
  table.insert(tbl, player:IsBlackHeart(i) and 'B' or 'S')
end
if player:GetSoulHearts() % 2 ~= 0 then
  tbl[#tbl] = string.lower(tbl[#tbl]) -- lowercase to indicate half heart at end
end
print(table.concat(tbl, ' ')) -- prints: B S S B B S S B B

Is·Bone·Heart ()⚓︎

boolean IsBoneHeart ( int heart )⚓︎

This can be used to figure out the ordering of bone hearts amongst soul/black hearts.

Example

Imagine we have the following setup of hearts:

1
BONE SOUL BONE BLACK BONE

The indexing here is for whole hearts, and the index starts at 0. The indexing takes into account bone/soul/black hearts. It doesn't matter if you have other heart types (e.g. red hearts).

1
2
3
4
Isaac.GetPlayer():IsBoneHeart(0) -- returns true (bone heart)
Isaac.GetPlayer():IsBoneHeart(1) -- returns false (soul heart)
Isaac.GetPlayer():IsBoneHeart(3) -- returns false (black heart)
-- 0,2,4 all return true (bone hearts)

Quick code example to parse soul hearts vs black hearts vs bone hearts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
-- if you setup your hearts as described above then you'll get the following values
-- GetSoulHearts = 4
-- GetBoneHearts = 3
local tbl = {}
local player = Isaac.GetPlayer()
-- first, figure out the soul/black heart order
for i = 1, player:GetSoulHearts(), 2 do
  table.insert(tbl, player:IsBlackHeart(i) and 'BLACK' or 'SOUL')
end
if player:GetSoulHearts() % 2 ~= 0 then
  tbl[#tbl] = string.lower(tbl[#tbl]) -- lowercase to indicate half heart at end
end
-- second, figure out where bone hearts fit into the soul/black/bone heart order
-- divide soul hearts by 2 to get whole hearts, bone hearts are already in whole heart increments
for i = 0, math.ceil(player:GetSoulHearts() / 2) + player:GetBoneHearts() - 1 do
  if player:IsBoneHeart(i) then
    table.insert(tbl, i + 1, 'BONE')
  end
end
print(table.concat(tbl, ' ')) -- prints: BONE SOUL BONE BLACK BONE

Is·Coop·Ghost ()⚓︎

boolean IsCoopGhost ( )⚓︎

In a multiplayer game, if a player dies, they will return as a tiny ghost. This method returns true if the player is a co-op ghost.


Is·Extra·Animation·Finished ()⚓︎

boolean IsExtraAnimationFinished ( )⚓︎


Is·Full·Sprite·Rendering ()⚓︎

boolean IsFullSpriteRendering ( )⚓︎


Is·Held·Item·Visible ()⚓︎

boolean IsHeldItemVisible ( )⚓︎


Is·Holding·Item ()⚓︎

boolean IsHoldingItem ( )⚓︎

Is Player holding up an item (card/collectible/etc)


Is·Item·Queue·Empty ()⚓︎

boolean IsItemQueueEmpty ( )⚓︎


Is·P2Appearing ()⚓︎

boolean IsP2Appearing ( )⚓︎


Is·Pos·In·Spot·Light ()⚓︎

boolean IsPosInSpotLight ( Vector Position )⚓︎

Returns true if the position is in the AOE of the Night Light item.


Is·Sub·Player ()⚓︎

boolean IsSubPlayer ( )⚓︎

Returns true if the player object was returned from the EntityPlayer.GetSubPlayer method. (This method is not related to multiplayer.)

Additionally, this also returns true for the player object representing Dead Tainted Lazarus that fires at the beginning of the run in the PostPlayerInit callback. (The PostPlayerInit callback fires first for Dead Tainted Lazarus before firing for the normal Tainted Lazarus.)


Needs·Charge ()⚓︎

boolean NeedsCharge ( ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎

This will always return false for active items that have chargetype="special" set in the items.xml file, even if they are not fully charged.


Play·Extra·Animation ()⚓︎

void PlayExtraAnimation ( string Animation )⚓︎


Queue·Extra·Animation ()⚓︎

void QueueExtraAnimation ( string Animation )⚓︎


Queue·Item ()⚓︎

void QueueItem ( ItemConfigItem Item, int Charge = 0, boolean Touched = false, boolean Golden = false, int VarData = 0 )⚓︎

When the player touches a collectible or trinket, they are not granted it immediately. Instead, the item is queued for the duration of the animation where the player holds the item above their head. When the animation is finished, the item in the queue will be granted. This method adds a new item to the item queue. If the player is not currently playing an animation, then the queued item will simply be awarded instantly.

Also see FlushQueueItem(), IsItemQueueEmpty(), and QueuedItem.


Remove·Black·Heart ()⚓︎

void RemoveBlackHeart ( int BlackHeart )⚓︎


Remove·Blue·Fly ()⚓︎

void RemoveBlueFly ( )⚓︎


Remove·Blue·Spider ()⚓︎

void RemoveBlueSpider ( )⚓︎


Remove·Collectible ()⚓︎

void RemoveCollectible ( CollectibleType Type, boolean IgnoreModifiers = false, ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY, boolean RemoveFromPlayerForm = true )⚓︎

IgnoreModifiers: Ignores collectible effects granted by other items (i.e. Void)

Slot: Sets the active slot this collectible should be removed from

RemoveFromPlayerForm: If successfully removed and part of a transformation, decrease that transformation's counter by 1


Remove·Costume ()⚓︎

void RemoveCostume ( ItemConfigItem Item )⚓︎

Removes a given costume based on its item config entry.

Example code

This code removes the costume of the Spoon Bender collectible.

1
2
3
4
local player = Isaac.GetPlayer()
local itemConfig = Isaac.GetItemConfig()
local itemConfigItem = itemConfig:GetCollectible(CollectibleType.COLLECTIBLE_SPOON_BENDER)
player:RemoveCostume(itemConfigItem)


Remove·Curse·Mist·Effect ()⚓︎

void RemoveCurseMistEffect ( )⚓︎


Remove·Golden·Bomb ()⚓︎

void RemoveGoldenBomb ( )⚓︎


Remove·Golden·Key ()⚓︎

void RemoveGoldenKey ( )⚓︎


Remove·Skin·Costume ()⚓︎

void RemoveSkinCostume ( )⚓︎

Removes player-specific costumes like Magdalene's hair or Cain's eyepatch.


Render·Body ()⚓︎

void RenderBody ( Vector position )⚓︎


Render·Glow ()⚓︎

void RenderGlow ( Vector position )⚓︎


Render·Head ()⚓︎

void RenderHead ( Vector position )⚓︎


Render·Top ()⚓︎

void RenderTop ( Vector position )⚓︎


Replace·Costume·Sprite ()⚓︎

void ReplaceCostumeSprite ( ItemConfigItem Item, string SpritePath, int SpriteId )⚓︎


Reset·Damage·Cooldown ()⚓︎

void ResetDamageCooldown ( )⚓︎


Reset·Item·State ()⚓︎

void ResetItemState ( )⚓︎

Room transitions call this to prevent lock ups.


Respawn·Familiars ()⚓︎

void RespawnFamiliars ( )⚓︎

Respawns all familiars associated to the player.


Revive ()⚓︎

void Revive ( )⚓︎

Revives the player.

Bugs

Exiting the run at any point after this function is called will make it so that the run can't be continued.


Set·Active·Charge ()⚓︎

void SetActiveCharge ( int Charge, ActiveSlot ActiveSlot = ActiveSlot.SLOT_PRIMARY )⚓︎


Set·Blood·Charge ()⚓︎

void SetBloodCharge ( int Amount )⚓︎

Sets the amount of Blood Charge the player has. Blood Charge does not do anything on characters besides Tainted Bethany.


Set·Card ()⚓︎

void SetCard ( int SlotId, Card ID )⚓︎

Change the card/rune the player is holding in the given itemslot (0 or 1).


Set·Full·Hearts ()⚓︎

void SetFullHearts ( )⚓︎


Set·Min·Damage·Cooldown ()⚓︎

void SetMinDamageCooldown ( int DamageCooldown )⚓︎


Set·Pill ()⚓︎

void SetPill ( int SlotId, PillColor Pill )⚓︎

Change the pill the player is holding in the given itemslot (0 or 1).


Set·Pocket·Active·Item()⚓︎

void SetPocketActiveItem ( CollectibleType Type, ActiveSlot Slot, boolean KeepInPools )⚓︎

Sets the player's pocket active item to the given active item. Slot can be either SLOT_POCKET or SLOT_POCKET2. Items added to SLOT_POCKET2 will always be removed upon being used. If KeepInPools is set to true, the item will not be removed from the item pools. Use this to let the player start with a custom active item in their pocket active slot right away.

Bugs

Calling this function inside PostPlayerInit callback causes a crash when continuing a saved run after closing and reopening the game, unless KeepInPools argument is set to true.


Set·Shooting·Cooldown ()⚓︎

void SetShootingCooldown ( int Cooldown )⚓︎


Set·Soul·Charge ()⚓︎

void SetSoulCharge ( int Amount )⚓︎

Sets the amount of Soul Charge the player has. Soul Charge does not do anything on characters besides Bethany.


Set·Target·Trap·Door ()⚓︎

void SetTargetTrapDoor ( GridEntity TrapDoor )⚓︎

This function got removed with Repentance.


Shoot·Red·Candle ()⚓︎

void ShootRedCandle ( Vector Direction )⚓︎

for ghost pepper item + poop and farts


Spawn·Maw·Of·Void ()⚓︎

EntityLaser SpawnMawOfVoid ( int Timeout )⚓︎


Stop·Extra·Animation ()⚓︎

void StopExtraAnimation ( )⚓︎


Swap·Active·Items ()⚓︎

void SwapActiveItems ( )⚓︎

Swaps active items in the Schoolbag activeslot


Throw·Blue·Spider ()⚓︎

Entity ThrowBlueSpider ( Vector Position, Vector Target )⚓︎


Throw·Friendly·Dip ()⚓︎

EntityFamiliar ThrowFriendlyDip ( int Subtype, Vector Position, Vector Target )⚓︎

Dip Subtypes
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
0: normal
1: red
2: corny
3: golden
4: rainbow
5: black
6: holy
12: stone
13: flaming
14: poison
20: brownie

Throw·Held·Entity ()⚓︎

Entity ThrowHeldEntity ( Vector Velocity )⚓︎


Trigger·Book·Of·Virtues ()⚓︎

void TriggerBookOfVirtues ( CollectibleType Type = CollectibleType.COLLECTIBLE_NULL, int Charge = 0 )⚓︎

Works only if the player has the Book of Virtues item, otherwise does nothing


Try·Hold·Entity ()⚓︎

boolean TryHoldEntity ( Entity Entity )⚓︎


Try·Hold·Trinket ()⚓︎

boolean TryHoldTrinket ( TrinketType Type )⚓︎

Returns true if an active item pickup cooldown is over. returns true if trinket can be added, else false


Try·Remove·Collectible·Costume ()⚓︎

void TryRemoveCollectibleCostume ( CollectibleType Collectible, boolean KeepPersistent )⚓︎

Tries to remove a costume of the given collectible. KeepPersistent is used to define if persistent costumes should be removed. If its set to false, it will only remove temporary costumes.

Example code

This code removes the costume of the Spoon Bender collectible.

1
2
local player = Isaac.GetPlayer()
player:TryRemoveCollectibleCostume(CollectibleType.COLLECTIBLE_SPOON_BENDER, false)


Try·Remove·Null·Costume ()⚓︎

void TryRemoveNullCostume ( NullItemID NullId )⚓︎


Try·Remove·Trinket ()⚓︎

boolean TryRemoveTrinket ( TrinketType Type )⚓︎


Try·Remove·Trinket·Costume ()⚓︎

void TryRemoveTrinketCostume ( TrinketType Trinket )⚓︎

Tries to remove a trinket costume


Try·Use·Key ()⚓︎

boolean TryUseKey ( )⚓︎


Update·Can·Shoot ()⚓︎

void UpdateCanShoot ( )⚓︎


Use·Active·Item ()⚓︎

void UseActiveItem ( CollectibleType Item, UseFlags UseFlags = 0, ActiveSlot Slot = -1, int CustomVarData = 0 )⚓︎

void UseActiveItem ( CollectibleType Item, boolean ShowAnim = false, boolean KeepActiveItem = false, boolean AllowNonMainPlayer = true, boolean ToAddCostume = false, ActiveSlot Slot = -1, int CustomVarData = 0 )⚓︎

Slot: The active slot this item was used from (set to -1 if this item wasn't triggered by any active slot)

CustomVarData: UseFlag.USE_CUSTOMVARDATA needs to be provided in UseFlags otherwise this field is ignored

Notes

This method will increment the number of CollectibleEffects (see Temporary Effects) of the passed item by 1 for the current room, and will trigger any associated MC_USE_ITEM callbacks. As of Repentance, this method can also be used on Passive and Familiar ItemTypes.


Use·Card ()⚓︎

void UseCard ( Card ID, UseFlags UseFlags = 0 )⚓︎


Use·Pill ()⚓︎

void UsePill ( PillEffect ID, PillColor PillColor, UseFlags UseFlags = 0 )⚓︎


Use·Poop·Spell ()⚓︎

void UsePoopSpell ( PoopSpellType type )⚓︎

Triggers one of Tainted ???'s poop spells (see PoopSpellType enum)


Will·Player·Revive ()⚓︎

boolean WillPlayerRevive ( )⚓︎

This function will return true if the player has one or more extra lives or if a conditional revival item will work on the next death.

Right now, there are 3 items that grant conditional extra lives:

  • Guppy's Collar - This function will successfully predict whether or not the next revive from Guppy's Collar will work or not. (50% chance)
  • Broken Ankh - This function will successfully predict whether or not the next revive from Broken Ankh will work or not. (22.22% chance)
  • Mysterious Paper - This function will only successfully predict the revive from Missing Poster every 4 frames, because it evaluates only one of its 4 possible item effects each frame.

Variables⚓︎

Baby·Skin⚓︎

BabySubType BabySkin⚓︎

P2 Skin section Used to hold the selected skin (in case of glitched baby it will pick a random one)

Bugs

This variable actually contains userdata and is not usable within API. Attempt to change it will results in a crash.


Can·Fly⚓︎

boolean CanFly⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. Can the player fly over rocks and pits?


Controller·Index⚓︎

const int ControllerIndex⚓︎


Controls·Cooldown⚓︎

int ControlsCooldown⚓︎

Specifies the number of frames the player's controls should be disabled. Decrements by 1 every frame, until it reaches 0. Used by the paralysis pill effect.

At 0 or less, does not block player control.


Controls·Enabled⚓︎

boolean ControlsEnabled⚓︎


Damage⚓︎

float Damage⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. This is equal to the Damage Stat. How much damage do the players tears or other main weapons do?


Fire·Delay⚓︎

float FireDelay⚓︎

How long until the player can spawn their next tear?

Version Difference

In the Afterbirth+ version of the modding api, this variable is an integer


Friend·Ball·Enemy⚓︎

const EntityDesc FriendBallEnemy⚓︎

Bugs

This function returns userdata that cant be edited or accessed.


Head·Frame·Delay⚓︎

int HeadFrameDelay⚓︎

Specifies the number of frames the player's head should be playing the shooting animation. Decrements by 1 every frame, until it reaches -1.

At negative values, the player's head does not play the shooting animation.


IBS·Charge⚓︎

float IBSCharge⚓︎

Internally used by IBS, increases based on damage dealt, range is 0-1


Item·Hold·Cooldown⚓︎

int ItemHoldCooldown⚓︎

Used for avoiding player get stucked between rocks when switching a flying item with other active item.


Laser·Color⚓︎

Color LaserColor⚓︎


Luck⚓︎

float Luck⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. This is equal to the Luck Stat. Better luck generally means better random events.


Max·Fire·Delay⚓︎

float MaxFireDelay⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. This is equal to the Tears Stat. How long between each tear can spawn?

Version Difference

In the Afterbirth+ version of the modding api, this variable is an integer


Move·Speed⚓︎

float MoveSpeed⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. This is equal to the Speed Stat. How fast can the player move?


Queued·Item⚓︎

QueueItemData QueuedItem⚓︎

  • When Isaac picks up a collectible or a trinket, he holds it above his head for a while. At this point, the collectible/trinket is not actually put into his inventory yet.
  • In other words, the item is queued for insertion until the animation completes, at which point the queue is processed and the item is inserted.
  • QueuedItem holds a object of type QueueItemData that describes the item that a player is currently holding above their head.
  • QueuedItem is never nil, even if the player is not currently holding up any item. (However, player.QueuedItem.Item will be nil if they are not currently holding up any item.)
  • This only stores data for collectibles and trinkets. It does not store any data for pocket items (even though Isaac plays a similar "holding above head" animation for pocket items).
  • Also see FlushQueueItem(), IsItemQueueEmpty(), and QueueItem().

Samson·Berserk·Charge⚓︎

int SamsonBerserkCharge⚓︎

Internally used by Tainted Samson, increases based on damage dealt, range is 0-100000


Secondary·Active·Item⚓︎

ActiveItemDesc SecondaryActiveItem⚓︎

Bug

This function does not exist anymore in Repentance. As of right now, there is no other function to get the ActiveItemDesc of any active item the player holds. Until this is fixed, this info will stay here.


Shot·Speed⚓︎

float ShotSpeed⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. This is equal to the ShotSpeed Stat.

Defines how fast the tear travel when spawned.

The default velocity of a tear shot is 10 times the players ShotSpeed.


Tear·Color⚓︎

Color TearColor⚓︎


Tear·Falling·Acceleration⚓︎

float TearFallingAcceleration⚓︎


Tear·Falling·Speed⚓︎

float TearFallingSpeed⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. How fast is the tear moving up or down when it spawns? Affects range.


Tear·Flags⚓︎

TearFlags TearFlags⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. Various TearFlags.

Example Code

This code makes Isaac's tears spectral.

1
2
3
4
function mod:OnEvaluateTearFlags(player, flag)
    player.TearFlags = player.TearFlags | TearFlags.TEAR_SPECTRAL
end
mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, mod.OnEvaluateTearFlags, CacheFlag.CACHE_TEARFLAG)


Tear·Height⚓︎

float TearHeight⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. How high above the ground is the tear when it spawns?

Example Code

This code gives Isaac a +5 range up.

1
2
3
4
5
function mod:OnEvaluateRange(player, flag)
    -- we give -5 because the TearHeight stat is always negative; the lower the number - the further the tear travels
    player.TearHeight = player.TearHeight - 5
end
mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, mod.OnEvaluateRange, CacheFlag.CACHE_RANGE)

Tear·Range⚓︎

float TearRange⚓︎

Player stat - Only change this in a callback to MC_EVALUATE_CACHE. How far should a tear go when it spawns?

Info

This stat needs to be multiplied by 40, because it calculates the range based on tile length.

Example Code

This code gives Isaac a +2 range up.

1
2
3
4
function mod:OnEvaluateRange(player, flag)
    player.TearRange = player.TearRange + (2 * 40)
end
mod:AddCallback(ModCallbacks.MC_EVALUATE_CACHE, mod.OnEvaluateRange, CacheFlag.CACHE_RANGE)

Tears·Offset⚓︎

Vector TearsOffset⚓︎


Last update: September 13, 2025