### Get Entity Pickup Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPickup.md
Demonstrates how to obtain an EntityPickup object from the first entity in the current room.
```lua
local entity = Isaac.GetRoomEntities()[1]:ToPickup()
```
--------------------------------
### Get Card Configuration Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/ItemConfig_Card.md
Demonstrates how to retrieve the configuration for a specific card using ItemConfig.GetCard(). This is the primary way to access card-specific data.
```lua
Isaac.GetItemConfig():GetCard(Card.CARD_FOOL)
```
--------------------------------
### Get Effects List Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_Vector_EffectList.md
Demonstrates how to retrieve the EffectList object.
```APIDOC
## Get Effects List
### Description
Retrieves the list of temporary effects associated with a player.
### Usage
```lua
local player = Isaac.GetPlayer()
local tempEffects = player:GetEffects()
local effectlist = tempEffects:GetEffectsList()
```
```
--------------------------------
### Get Non-Optimized Samples Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_Vector_VectorList.md
This example demonstrates how to obtain a VectorList of non-optimized samples from an EntityLaser object. Ensure the EntityLaser class and its GetNonOptimizedSamples method are available.
```lua
local brimstoneEntity = Isaac.GetPlayer():FireBrimstone(Vector(1, 0)):GetSamples()
```
--------------------------------
### Get EffectList Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_Vector_EffectList.md
Demonstrates how to retrieve the EffectList for a player. This is typically done through the player's temporary effects.
```lua
local player = Isaac.GetPlayer()
local tempEffects = player:GetEffects()
local effectlist = tempEffects:GetEffectsList()
```
--------------------------------
### Basic Mod Structure Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/ExampleProject.md
This example shows the directory structure for a new mod. Create a subdirectory within the game's mods folder and name it after your mod.
```plaintext
C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac Rebirth\mods\customTears
```
--------------------------------
### Start ZeroBrane Debugger Server
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/ZeroBraneStudio.md
In ZeroBrane Studio, set the project directory to your current file and start the debugger server. This prepares the IDE to connect to the running game.
```lua
StartDebug()
```
--------------------------------
### Start Stage Transition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Game.md
Starts a stage transition animation. Use 'SameStage' to reseed the current stage or progress to the next. 'TransitionOverride' allows for special stage transitions like Sacrifice Room or Void teleports.
```csharp
void StartStageTransition ( boolean SameStage, int TransitionOverride, [EntityPlayer](EntityPlayer.md) Player )
```
--------------------------------
### Get ItemConfigCostume Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/ItemConfig_Costume.md
This example demonstrates how to retrieve the Costume configuration for a specific collectible item. It uses the Isaac.GetItemConfig() function to access item configurations and then specifies the collectible type.
```lua
Isaac.GetItemConfig():GetCollectible(CollectibleType.COLLECTIBLE_SAD_ONION).Costume
```
--------------------------------
### Complete Shader Example with Parameters
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/Writingscreenshaders.md
A full example of a shader named 'RandomColors' that uses custom parameters 'PlayerPos' and 'Time'. It demonstrates passing data from the vertex shader to the fragment shader and manipulating colors based on these parameters.
```xml
```
--------------------------------
### Get Projectile Entity Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityProjectile.md
Demonstrates how to obtain a projectile entity from the game's room entities. This is useful for interacting with existing projectiles.
```lua
local entity = Isaac.GetRoomEntities()[1]:ToProjectile()
```
--------------------------------
### Get Start Seed String
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Retrieves the current run's start seed as a formatted string.
```APIDOC
## Get·Start·Seed·String ()
### Description
Retrieves the current run's start seed as a formatted string, typically displayed on the pause menu. Returns "B911 99JA" if invoked in the main menu.
### Method
`GetStartSeedString`
### Response
#### Success Response (string)
The current start seed as a formatted string.
```
--------------------------------
### GetCards() - Example Usage
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_Vector_CardConfigList.md
Demonstrates how to retrieve the CardConfigList using the GetCards() function.
```APIDOC
## GetCards()
### Description
Retrieves the list of card configurations.
### Usage
```lua
local cardConfigs = Isaac.GetItemConfig():GetCards()
```
```
--------------------------------
### Use Card Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Use a card with specified ID and use flags.
```lua
player:UseCard(ID, UseFlags)
```
--------------------------------
### MC_USE_PILL Callback Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
This example demonstrates how to use the MC_USE_PILL callback to execute a function when any pill is used. It also shows how to filter for specific pill effects, like PILLEFFECT_BAD_GAS.
```lua
function mod:myFunction(pillEffectID, playerWhoUsedItem, useFlags)
print("Hello World!")
end
mod:AddCallback(ModCallbacks.MC_USE_PILL, mod.myFunction)
```
```lua
function mod:myFunction2(pillEffectID, playerWhoUsedItem, useFlags)
print("Bad Gas Pill used!")
end
mod:AddCallback(ModCallbacks.MC_USE_PILL, mod.myFunction2, PillEffect.PILLEFFECT_BAD_GAS)
```
--------------------------------
### Fire Brimstone Laser Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityLaser.md
Demonstrates how to fire a Brimstone laser using the Entity.ToLaser() function. This is a basic example of creating and initiating a laser effect.
```lua
local brimstoneEntity = Isaac.GetPlayer():FireBrimstone(Vector(1, 0))
```
--------------------------------
### Start Challenge
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/DebugConsole.md
Starts a new run with a random seed on the specified challenge number. Using a number greater than the available challenges will crash the game.
```console
challenge 20
```
--------------------------------
### Obtaining a RoomConfigEntry Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/RoomConfig_Entry.md
Demonstrates how to get an instance of RoomConfigEntry using the PickEntry function.
```APIDOC
???+ info
You can get this class by using the following function:
* [RoomConfig_Spawn.PickEntry](RoomConfig_Spawn.md#pickentry)
???+ example "Example Code"
```lua
local level = Game():GetLevel()
local roomDescriptor = level:GetCurrentRoomDesc()
local roomConfigRoom = roomDescriptor.Data
local spawnList = roomConfigRoom.Spawns
local roomConfigSpawn = spawnList:Get(0)
local roomConfigEntry = roomConfigSpawn:PickEntry(0)
```
```
--------------------------------
### Play
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Sprite.md
Starts playing a specified animation on the sprite.
```APIDOC
## Play ( string AnimationName, boolean Force )
### Description
Starts playing the animation specified by `AnimationName` from its first frame. The animation will only advance when `Sprite.Update` is called. If `Force` is true, any currently playing animation will be stopped.
### Method
Play
### Parameters
#### Path Parameters
- **AnimationName** (string) - The name of the animation to play.
- **Force** (boolean) - If true, stops the current animation before starting the new one. If false, and an animation is already playing, this call will do nothing.
### Example Code
```lua
mySprite:Play("MyAnimation", true)
```
```
--------------------------------
### Get Start Seed
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Retrieves the current run's start seed as an integer.
```APIDOC
## Get·Start·Seed ()
### Description
Retrieves the current run's start seed as an integer. This seed is used to generate random elements for the current run. Returns 0 if invoked in the main menu.
### Method
`GetStartSeed`
### Response
#### Success Response (int)
The current start seed as an integer.
```
--------------------------------
### PostInit
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GridEntity.md
Performs post-initialization tasks for the GridEntity.
```APIDOC
## PostInit
### Description
Performs post-initialization tasks for the GridEntity.
### Method
`void PostInit ( )`
```
--------------------------------
### GetStartingRoomIndex
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Retrieves the grid index of the starting room for the current level.
```APIDOC
## GetStartingRoomIndex
### Description
Returns the gridindex of the starting room of the current level.
### Method
`GetStartingRoomIndex()`
### Returns
- `int`: The grid index of the starting room.
```
--------------------------------
### Start Room Transition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Game.md
Initiates a room transition with customizable animation and player options. Avoid interrupting the PIXELATION animation to prevent buffer overflows.
```csharp
void StartRoomTransition ( int RoomIndex, [Direction](enums/Direction.md) Direction, [RoomTransitionAnim](enums/RoomTransitionAnim.md) Animation = RoomTransitionAnim.WALK, [EntityPlayer](EntityPlayer.md) Player = nil, int Dimension = -1 )
```
--------------------------------
### Get Mouse Position
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Input.md
Retrieves the current mouse position in either game or render coordinates. This example demonstrates getting the mouse position in world coordinates and then converting it to screen coordinates for rendering text.
```lua
local mousePos = Input.GetMousePosition(true) -- get mouse position in world coordinates
local screenPos = Isaac.WorldToScreen(mousePos) -- transfer game- to screen coordinates
Isaac.RenderText("Hello World!", screenPos.X, screenPos.Y, 1 ,1 ,1 ,1 )
```
--------------------------------
### Get Room Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Room.md
Obtain the current room instance from the game. This is a common starting point for room-related operations.
```lua
local room = Game():GetRoom()
```
--------------------------------
### Mod API Example: Minimap Library
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/CustomCallbacks.md
Demonstrates how a library mod can expose custom callbacks for other mods to use, enabling inter-mod communication without direct dependency checks.
```Lua
-- ... callback where the minimap is enlarged
Isaac.RunCallback("MINIMAPLIB_POST_MINIMAP_ENLARGE", nil, currentSize)
```
```Lua
MOD2:AddCallback("MINIMAPLIB_POST_MINIMAP_ENLARGE", function(_, currentSize)
print("Minimap size has changed!", currentSize)
-- do something using currentSize
end)
```
--------------------------------
### Accessing RoomConfigEntries
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_ArrayProxy_RoomConfigEntries.md
This example demonstrates how to retrieve the RoomConfigEntries object from the game's level data. It shows the path from the game instance to the specific spawn entries.
```lua
local level = Game():GetLevel()
local roomDescriptor = level:GetCurrentRoomDesc()
local roomConfigRoom = roomDescriptor.Data
local spawnList = roomConfigRoom.Spawns
local roomConfigSpawn = spawnList:Get(0)
local entries = roomConfigSpawn.Entries
```
--------------------------------
### Get Room Entities
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_EntityList.md
Retrieves all entities present in the current game room. This is a common starting point for interacting with entities.
```lua
local entities = Isaac.GetRoomEntities()
```
--------------------------------
### Get Player and TemporaryEffects
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/TemporaryEffects.md
Retrieves the current player entity and their associated TemporaryEffects object. This is a common starting point for manipulating player effects.
```lua
local player = Isaac.GetPlayer()
local tempEffects = player:GetEffects()
```
--------------------------------
### Read Isaac Modding Documentation
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/faq/Coding.md
This example demonstrates how to read the documentation for Isaac functions. It shows how to access player data and check for specific trinkets, noting optional arguments.
```lua
local player = Isaac.GetPlayer(0)
local hasTrinket = player:HasTrinket(TrinketType.TRINKET_SWALLOWED_PENNY) -- Notice how that second argument was optional, hence the equals sign.
print(hasTrinket) -- Either "true" if the player had it, or "false" if they didn't.
```
--------------------------------
### Accessing RoomConfigSpawn Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/RoomConfig_Spawn.md
Demonstrates how to get the current room's spawn configuration. This is typically used to access spawn points within a room.
```lua
local level = Game():GetLevel()
local roomDescriptor = level:GetCurrentRoomDesc()
local roomConfigRoom = roomDescriptor.Data
local spawnList = roomConfigRoom.Spawns
local roomConfigSpawn = spawnList:Get(0)
```
--------------------------------
### Obtain EntityFamiliar using AddMinisaac
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityFamiliar.md
This example demonstrates how to get a familiar entity by using the AddMinisaac function on the player. Ensure the player object is accessible.
```lua
local familiarEntity = Isaac.GetPlayer():AddMinisaac(Vector(0,0))
```
--------------------------------
### Get Entity Effect Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityEffect.md
Demonstrates how to obtain an EntityEffect object from an existing entity. This is typically used to modify or inspect the effects associated with an entity in the game.
```lua
local entity = Isaac.GetRoomEntities()[1]:ToEffect()
```
--------------------------------
### Render Text Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Isaac.md
Renders text on the screen using default font size. Coordinates are in screen space and color values should be between 0 and 1.
```lua
local player = Isaac.GetPlayer()
local pos = player.Position
Isaac.RenderText("X: "..pos.X.." Y: "..pos.Y, 50, 50, 1 ,1 ,1 ,1 )
```
--------------------------------
### Get Black Hearts Bitmask
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Returns the bitmask representing which soul hearts are black hearts. This does not return the count of black hearts directly. The example demonstrates how to parse this bitmask.
```lua
int GetBlackHearts ( )
```
```lua
-- 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
```
--------------------------------
### Give Items to Player with EntityPlayer:AddCollectible
Source: https://context7.com/wofsauge/isaacdocs/llms.txt
Grants a collectible item to a given active slot, optionally with a specific charge. This example gives the player Brimstone on game start.
```lua
local mod = RegisterMod("ItemGiver", 1)
-- Give the player Brimstone (ID 118) on game start, fully charged
mod:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, function(_, player)
-- FirstTimePickingUp = true counts toward transformations
player:AddCollectible(CollectibleType.COLLECTIBLE_BRIMSTONE, 0, true,
ActiveSlot.SLOT_PRIMARY)
Isaac.DebugString("Gave Brimstone to player: " .. player:GetName())
end)
```
--------------------------------
### Apply Null Costume in Lua
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/faq/Lua.md
This example demonstrates how to add a null costume to a player character using Lua. It registers a mod, gets a costume ID by path, and applies it during player initialization.
```Lua
local mod = RegisterMod("My Mod", 1)
local MY_NULL_COSTUME_ID = Isaac.GetCostumeIdByPath("gfx/characters/bar.anm2")
-- For EntityType.ENTITY_PLAYER (1)
local PlayerVariant = {
PLAYER = 0,
COOP_BABY = 1,
}
function mod:postPlayerInit(player)
if player.Variant == PlayerVariant.PLAYER then
player:AddNullCostume(MY_NULL_COSTUME_ID)
end
end
mod:AddCallback(ModCallbacks.MC_POST_PLAYER_INIT, mod.postPlayerInit)
```
--------------------------------
### Initialize Baby Skin
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Initializes the baby skin for the player.
```lua
void InitBabySkin ( )
```
--------------------------------
### MC_POST_LASER_INIT
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
Callback function executed after a laser entity is initialized. It receives the laser entity and an optional laser variant. Note that some entity data might be incomplete at this stage.
```APIDOC
## MC_POST_LASER_INIT
### Description
Callback function executed after a laser entity is initialized. It receives the laser entity and an optional laser variant. Note that some entity data might be incomplete at this stage.
### Method
MC_POST_LASER_INIT
### Parameters
- **entityLaser** ([EntityLaser](../EntityLaser.md)) - The laser entity being initialized.
- **laserVariant** (LaserVariant) - Optional. The variant of the laser.
### Return Type
void
```
--------------------------------
### Get Vector Angle in Degrees
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Vector.md
Calculates the angle of the vector in degrees. A vector pointing right (1,0) is 0 degrees, up is -90, left is 180, and down is 90. This example demonstrates finding the angle between two positions.
```lua
local v1 = Vector(1,0) -- has angle 0.0
local v2 = Vector(0,1) -- has angle 90.0
local v3 = v2-v1 -- subtraction of 2 points is a vector connecting the two points
print(v3:GetAngleDegrees()) -- prints 45.0
```
--------------------------------
### Example Challenge Definition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/xml/challenges.md
This XML snippet defines a custom challenge. It sets the player type, challenge name, end stage, starting items, room filter, curse filter, and disables shooting. It also specifies that treasure rooms and the curse of Darkness are disabled.
```xml
```
--------------------------------
### Install Dependencies with Pip
Source: https://github.com/wofsauge/isaacdocs/blob/main/README.md
Installs project dependencies using pip. Ensure Python 3.x is installed.
```bash
pip install -r requirements.txt
```
--------------------------------
### Basic Text Rendering
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/Tutorial-Rendertext.md
Renders the string "Sample text" at coordinates (50, 30) using the default game font. This is a basic example of how to display text on the screen.
```lua
local testmod= RegisterMod( "testmod" ,1 );
local function onRender(t)
Isaac.RenderText("Sample text", 50, 30, 1, 1, 1, 255)
end
testmod:AddCallback(ModCallbacks.MC_POST_RENDER, onRender)
```
--------------------------------
### Enable
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/MusicManager.md
Enables the music manager, allowing music playback to resume.
```APIDOC
## Enable()
### Description
Enables the music manager.
### Method
`Enable()`
### Example
```lua
MusicManager():Enable()
```
```
--------------------------------
### Clear Start Seed
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Clears the current start seed.
```APIDOC
## Clear·Start·Seed ()
### Description
Clears the current start seed.
### Method
`ClearStartSeed`
### Response
#### Success Response (void)
This function does not return a value.
```
--------------------------------
### Restart
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Re-selects a random start seed, but only if the start seed was not custom.
```APIDOC
## void Restart ( [Challenge](enums/Challenge.md) CurrentChallenge )
### Description
Re-selects a random start seed, but only if the start seed was not custom.
### Method
void
### Parameters
#### Path Parameters
- **CurrentChallenge** ([Challenge](enums/Challenge.md)) - The current challenge.
```
--------------------------------
### StartRoomTransition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Game.md
Initiates a transition between rooms with customizable animation and player settings. Note that the Direction parameter is ignored.
```APIDOC
## StartRoomTransition
### Description
Initiates a transition between rooms. Allows specifying the target room index, transition direction, animation type, player entity, and dimension.
### Method
`void StartRoomTransition(int RoomIndex, Direction Direction, RoomTransitionAnim Animation = RoomTransitionAnim.WALK, EntityPlayer Player = nil, int Dimension = -1)`
### Parameters
* **RoomIndex** (int) - The index of the room to transition to.
* **Direction** (Direction) - The direction of the transition (Note: This parameter is ignored by the game).
* **Animation** (RoomTransitionAnim) - The type of animation to use for the transition. Defaults to `RoomTransitionAnim.WALK`.
* **Player** (EntityPlayer) - The player entity involved in the transition. Defaults to nil.
* **Dimension** (int) - The dimension ID for the target room. Defaults to -1 (current dimension).
### Notes
Using `RoomTransitionAnim.PIXELATION` requires uninterrupted playback to avoid a buffer overflow bug.
### Bug
The `Direction` parameter is ignored; the game calculates direction internally. This also has no impact on doors.
```
--------------------------------
### Get () Function
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_ArrayProxy_RoomDescriptor.md
The Get function retrieves a specific RoomDescriptor from the list using its index.
```APIDOC
## Get ()
### Description
Returns a [RoomDescriptor](RoomDescriptor.md) at the index of the list provided.
### Method
Get
### Parameters
#### Path Parameters
- **idx** (int) - Required - The index of the room to retrieve.
### Response
#### Success Response ([RoomDescriptor])
- A RoomDescriptor object at the specified index.
```
--------------------------------
### Get Trinket Effect Num
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/TemporaryEffects.md
Gets the number of times a specific trinket effect has been added.
```APIDOC
## int GetTrinketEffectNum ( TrinketType TrinketType )
### Description
Gets the number of times the TrinketEffect associated with the given TrinketType has been added.
### Parameters
* **TrinketType** (TrinketType) - The type of trinket effect to count.
```
--------------------------------
### Instantiate MusicManager
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/MusicManager.md
Create an instance of the MusicManager class. This is the first step to using any of its functionalities.
```lua
local musicManager = MusicManager()
```
--------------------------------
### Get Null Effect Num
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/TemporaryEffects.md
Gets the number of times a specific null effect has been added.
```APIDOC
## int GetNullEffectNum ( NullItemID NullId )
### Description
Gets the number of times the null effect associated with the given NullItemID has been added.
### Parameters
* **NullId** (NullItemID) - The ID of the null item effect to count.
```
--------------------------------
### InitBabySkin
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Initializes the baby skin for the player.
```APIDOC
## InitBabySkin ()
### Description
Initializes the baby skin for the player.
### Method
POST (Implicit)
### Endpoint
EntityPlayer.InitBabySkin()
### Response
#### Success Response (200)
- **return value** (void) - This function does not return a value.
```
--------------------------------
### Get Collectible Effect Num
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/TemporaryEffects.md
Gets the number of times a specific collectible effect has been added.
```APIDOC
## int GetCollectibleEffectNum ( CollectibleType CollectibleType )
### Description
Gets the number of times the CollectibleEffect associated with the given CollectibleType has been added.
### Parameters
* **CollectibleType** (CollectibleType) - The type of collectible effect to count.
```
--------------------------------
### Navigate Rooms with Debug Console
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/DebugConsole.md
The 'goto' command allows you to teleport to specific room types. Use 's' for special rooms, 'd' for normal rooms, and 'x' for special rooms packed within floor files. Room layouts vary by floor.
```plaintext
goto s.boss.1010
```
```plaintext
goto s.error.21
```
```plaintext
goto d.10
```
```plaintext
goto x.boss.1
```
```plaintext
goto 9 5 1
```
--------------------------------
### Restart with Random Seed
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Re-selects a random start seed, but only if the start seed was not custom. This function is part of the DLC.
```lua
void Restart ( [Challenge](enums/Challenge.md) CurrentChallenge )
```
--------------------------------
### EntityRef Constructor
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityRef.md
Demonstrates how to create an EntityRef instance using the constructor.
```APIDOC
## Constructors
### Entity·Ref ()
#### [EntityRef](EntityRef.md) EntityRef ( [Entity](Entity.md) )
___
```
--------------------------------
### Get Number of Entries in Lua Table (No Keys)
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/MathAndLuaTips.md
Use the '#' operator to get the number of entries in a Lua table that does not have keys.
```lua
local exampleTable = {"apple", 69, 1337, -3}
print(#exampleTable) -- Result: 4
```
--------------------------------
### MC_EXECUTE_CMD Callback Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
This callback handles custom console commands. The first argument is the command string, and the second is the rest of the input parameters. Returning a string prints it to the console. Note: This is not called for default game commands. Returning any value other than nil will crash the game.
```lua
function mod.oncmd(_, command, args)
print(command)
print(args)
end
mod:AddCallback(ModCallbacks.MC_EXECUTE_CMD, mod.oncmd)
-- executing command "Test apple 1 Pear test" prints
-- Test
-- apple 1 Pear test
```
--------------------------------
### Instantiate SFXManager
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/SFXManager.md
Create a new instance of the SFXManager class.
```lua
local sfxManager = SFXManager()
```
--------------------------------
### Set Start Seed
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Sets the starting seed for a run. An empty string means a new random seed will be picked. This function is part of the DLC.
```lua
void SetStartSeed ( string StartSeed )
```
--------------------------------
### Run Lua Script from File
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/DebugConsole.md
Executes a Lua file. Paths are relative to the game installation folder.
```lua
luarun /full_path/hello.lua
luarun relative_path/hello.lua
```
--------------------------------
### Get Entity ID String
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/entities/Overview.md
Use this helper function to get a string representing an entity's Type, Variant, and SubType. This is useful for logging or debugging.
```lua
-- Helper function to get a string containing an entity's type, variant, and sub-type.
local function getEntityID(entity)
return tostring(entity.Type) .. "." .. tostring(entity.Variant) .. "." .. tostring(entity.SubType)
end
```
--------------------------------
### Initialize Font Object and Draw String
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GlobalFunctions.md
Initializes a Font object, loads a font file, and then renders a string to the screen. Ensure the font file path is correct.
```lua
local f = Font() -- init font object
f:Load("font/terminus.fnt") -- load a font into the font object
f:DrawString("Hello World!",60,50,KColor(1,1,1,1),0,true) -- render string with loaded font on position 60x50y
```
--------------------------------
### Get RoomConfigEntry Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/RoomConfig_Entry.md
Demonstrates how to retrieve a RoomConfigEntry object. This is typically done by accessing the game level, current room description, its data, spawn list, and then picking a specific entry.
```lua
local level = Game():GetLevel()
local roomDescriptor = level:GetCurrentRoomDesc()
local roomConfigRoom = roomDescriptor.Data
local spawnList = roomConfigRoom.Spawns
local roomConfigSpawn = spawnList:Get(0)
local roomConfigEntry = roomConfigSpawn:PickEntry(0)
```
--------------------------------
### Get Room Descriptor by Index
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Retrieves a RoomDescriptor for a specific room index. The 'Dimension' parameter specifies which dimension to get the room from; -1 defaults to the current dimension.
```lua
local level = Game():GetLevel()
local curRoomDesc = level:GetRoomByIdx(level:GetCurrentRoomIndex())
```
--------------------------------
### Example players.xml Structure
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/xml/players.md
This XML structure defines the root paths for character assets and lists individual player configurations with various attributes.
```xml
```
--------------------------------
### Post Initialize GridEntity
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GridEntity.md
Performs post-initialization tasks for the GridEntity. This function is called after the initial setup.
```lua
void PostInit ( )
```
--------------------------------
### Get Boss Color Index
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityNPC.md
Retrieves the boss color index for an NPC. Note that this value is reduced by 1, so you need to add 1 to get the actual color index as defined in bosscolors.xml.
```lua
local colorIndex = GetBossColorIdx()
```
--------------------------------
### AppearFast
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPickup.md
Makes the pickup appear instantly.
```APIDOC
## void AppearFast ( )
### Description
Makes the pickup appear instantly.
### Method
void
### Endpoint
AppearFast
```
--------------------------------
### Inlined Function Example (Discouraged)
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/GoodPractices.md
Shows an example of micro-optimization where function calls are inlined. This approach is discouraged as it harms readability and maintainability without guaranteed performance benefits, as compilers can often optimize this automatically.
```lua
local function main()
-- Do some stuff with foo
-- TODO
-- Do some stuff with bar
-- TODO
end
```
--------------------------------
### MC_POST_GAME_STARTED
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
Called when a game is started, either a new run or a continued one. This callback is invoked after MC_POST_NEW_ROOM and MC_POST_NEW_LEVEL.
```APIDOC
## MC_POST_GAME_STARTED
### Description
This function gets called when you start a game. The boolean value is true when you continue a run, false when you start a new one.
This callback will be called after MC_POST_NEW_ROOM and after MC_POST_NEW_LEVEL.
### Function Args
- **IsContinued** (bool) - True if the run is continued, false if it's a new run.
### Return Type
- **void** - Returning any value will have no effect on later callback executions.
### Example
```lua
local function onStart(_,bool)
print(bool)
end
mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, onStart)
```
```
--------------------------------
### Y Variable
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/RoomConfig_Spawn.md
Gets the Y coordinate of the RoomConfigSpawn.
```APIDOC
## Y Variable
### Description
Gets the Y coordinate of the RoomConfigSpawn.
### Type
int
```
--------------------------------
### Get ItemConfig Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/ItemConfig.md
Demonstrates how to obtain an instance of the ItemConfig class. This is often the first step before calling other ItemConfig methods.
```lua
Isaac.GetItemConfig()
```
--------------------------------
### SFXManager Constructor
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/SFXManager.md
Initializes a new SFXManager object. This is the entry point for interacting with the sound effect system.
```APIDOC
## SFXManager ()
### Description
Returns a SFXManager object.
### Method
Constructor
### Endpoint
SFXManager()
### Parameters
None
### Request Example
```lua
local sfxManager = SFXManager()
```
### Response
#### Success Response (Object)
- **SFXManager** (SFXManager) - A new SFXManager instance.
```
--------------------------------
### Configure Font Rendering with FontRenderSettings
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/FontRenderSettings.md
Example usage of FontRenderSettings to enable auto-wrapping and check its status. This demonstrates basic configuration and querying of settings.
```lua
local settings = FontRenderSettings()
settings:EnableAutoWrap()
--returns true if the font settings have autowrap enabled
```
--------------------------------
### Initialize a Mod with RegisterMod
Source: https://context7.com/wofsauge/isaacdocs/llms.txt
Every mod must call RegisterMod before adding callbacks or saving data. This example shows a minimal mod skeleton.
```lua
local mod = RegisterMod("MyMod", 1)
-- Add a callback that runs once per game frame
local function onUpdate()
local game = Game()
if game:IsGreedMode() then
Isaac.DebugString("Running in Greed Mode")
end
end
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, onUpdate)
```
--------------------------------
### RotationDelay
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityLaser.md
The delay before the laser starts rotating.
```APIDOC
## RotationDelay
### Description
The delay before the laser starts rotating.
### Type
int
```
--------------------------------
### GetNonCompleteRoomIndex
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Gets the index of a non-completed room.
```APIDOC
## GetNonCompleteRoomIndex
### Description
Retrieves the index of a room that has not yet been completed.
### Method
`GetNonCompleteRoomIndex()`
### Returns
- `int`: The index of a non-completed room.
```
--------------------------------
### Accessing GridEntityPit via ToPit()
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GridEntityPit.md
Demonstrates how to obtain a GridEntityPit instance using the ToPit() method on a GridEntity. This is the primary way to get an instance of this class.
```lua
Game():GetRoom():GetGridEntity(25):ToPit()
```
--------------------------------
### GetCollectibleRNG
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Gets the RNG object for a specific collectible.
```APIDOC
## GetCollectibleRNG
### Description
Gets the RNG object for a specific collectible.
### Method
`GetCollectibleRNG(CollectibleType ID)`
### Parameters
#### Path Parameters
- **ID** (CollectibleType) - Required - The type of the collectible.
### Request Example
```lua
local player = Isaac.GetPlayer()
local collectibleRNG = player:GetCollectibleRNG(CollectibleType.COLLECTIBLE_SAD_ONION)
```
### Response
#### Success Response (RNG)
- **RNG Object** (RNG) - The RNG object associated with the collectible.
```
--------------------------------
### Init Seed Info
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Initializes seed information.
```APIDOC
## Init·Seed·Info ()
### Description
Initializes seed information.
### Method
`InitSeedInfo`
### Response
#### Success Response (void)
This function does not return a value.
```
--------------------------------
### Use Pill Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Use a pill with a specified effect ID, color, and use flags.
```lua
player:UsePill(ID, PillColor, UseFlags)
```
--------------------------------
### GetDoorSlotPosition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Room.md
Gets the world position of a specified DoorSlot.
```APIDOC
## GetDoorSlotPosition
### Description
Gets the world position of a specified DoorSlot.
### Method
GetDoorSlotPosition
### Parameters
#### Path Parameters
- **Slot** ([DoorSlot](enums/DoorSlot.md)) - Required - The door slot to get the position of.
```
--------------------------------
### GetRoomCount
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Gets the total number of rooms in the level.
```APIDOC
## GetRoomCount
### Description
Returns the total number of rooms present in the current level.
### Method
`GetRoomCount()`
### Returns
- `int`: The total count of rooms.
```
--------------------------------
### Init
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GridEntity.md
Initializes the GridEntity with a given seed.
```APIDOC
## Init
### Description
Initializes the GridEntity with a given seed.
### Method
`void Init ( int Seed )`
### Parameters
#### Path Parameters
- **Seed** (int) - Required - The seed for initialization.
```
--------------------------------
### GetPreviousRoomIndex
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Gets the index of the room previously visited.
```APIDOC
## GetPreviousRoomIndex
### Description
Retrieves the index of the room visited immediately before the current one.
### Method
`GetPreviousRoomIndex()`
### Returns
- `int`: The index of the previous room.
```
--------------------------------
### Morph Pickup Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPickup.md
Shows how to change a pickup's type, variant, and subtype. Use 'IgnoreModifiers = true' to prevent unintended changes from game mechanics like Tainted Isaac's rotation.
```lua
void Morph ( [EntityType](enums/EntityType.md) Type, int Variant, int SubType, boolean KeepPrice = false, boolean KeepSeed = false, boolean IgnoreModifiers = false )
```
--------------------------------
### GetTargetDarkness
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Game.md
Gets the current target darkness value.
```APIDOC
## GetTargetDarkness
### Description
Gets the current target darkness value.
### Signature
`float GetTargetDarkness()`
```
--------------------------------
### X Variable
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/RoomConfig_Spawn.md
Gets the X coordinate of the RoomConfigSpawn.
```APIDOC
## X Variable
### Description
Gets the X coordinate of the RoomConfigSpawn.
### Type
int
```
--------------------------------
### Show Item Text Example
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/HUD.md
Demonstrates how to display custom text on the HUD, simulating item pickups or other messages. This overload is suitable for displaying arbitrary strings.
```lua
local function showHelpText()
local game = Game()
local hud = game:GetHUD()
hud:ShowItemText("Don't touch the spikes!", "It will drain your mana.")
end
```
--------------------------------
### Render
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Room.md
Renders the room.
```APIDOC
## Render
### Description
Renders the room.
### Signature
`void Render()`
```
--------------------------------
### CollisionClass
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/GridEntity.md
Gets or sets the collision class of the GridEntity.
```APIDOC
## CollisionClass
### Description
Gets or sets the collision class of the GridEntity.
### Type
- [GridCollisionClass](enums/GridCollisionClass.md)
```
--------------------------------
### GetOrbitDistance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityFamiliar.md
Gets the orbit distance for a given layer.
```APIDOC
## static [Vector](Vector.md) GetOrbitDistance ( int Layer )
### Description
Gets the orbit distance for a given layer.
### Method
static [Vector](Vector.md)
### Parameters
#### Path Parameters
- **Layer** (int) - Required - The layer to get the orbit distance for.
```
--------------------------------
### Example: Firing a Tear
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityTear.md
Demonstrates how to fire a tear using the player's FireTear function. This requires obtaining the player entity first.
```lua
local tearEntity = Isaac.GetPlayer():FireTear( Vector(0,0), Vector(1, 1) )
```
--------------------------------
### MC_POST_PICKUP_INIT
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
This callback is executed after a pickup entity has been initialized. It provides access to the initialized pickup entity, though some data may be incomplete at this stage. An optional PickupVariant can be specified.
```APIDOC
## MC_POST_PICKUP_INIT
### Description
This callback is executed after a pickup entity has been initialized. It provides access to the initialized pickup entity, though some data may be incomplete at this stage. An optional PickupVariant can be specified.
### Method
Callback
### Function Args
- **pickup** (EntityPickup) - The pickup entity that has been initialized.
### Optional Args
- **pickupVariant** (PickupVariant) - Optional. Specifies the variant of the pickup.
### Return Type
void
```
--------------------------------
### Get ()
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/CppContainer_ArrayProxy_intValues.md
Retrieves an element from the intValues list by its index.
```APIDOC
## Get ()
### Description
Retrieves an element from the intValues list by its index.
### Method
Get
### Parameters
#### Path Parameters
- **idx** (int) - Required - The index of the element to retrieve.
### Response
#### Success Response (userdata)
- Returns the element at the specified index.
```
--------------------------------
### GetFireDirection
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/EntityPlayer.md
Gets the current direction of the player's fire.
```APIDOC
## GetFireDirection
### Description
Gets the current direction of the player's fire.
### Method
`GetFireDirection()`
### Response
#### Success Response (Direction)
- **Direction** (Direction) - The current direction of the player's fire.
```
--------------------------------
### Create FontRenderSettings Instance
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/FontRenderSettings.md
Instantiate the FontRenderSettings class to begin configuring text rendering behavior.
```lua
local settings = FontRenderSettings()
```
--------------------------------
### MC_POST_KNIFE_INIT
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
Callback function executed after a knife entity is initialized. It receives the knife entity and an optional knife subtype. Similar to laser init, some data might be incomplete.
```APIDOC
## MC_POST_KNIFE_INIT
### Description
Callback function executed after a knife entity is initialized. It receives the knife entity and an optional knife subtype. Similar to laser init, some data might be incomplete.
### Method
MC_POST_KNIFE_INIT
### Parameters
- **entityKnife** ([EntityKnife](../EntityKnife.md)) - The knife entity being initialized.
- **knifeSubType** (KnifeSubType *) - Optional. The subtype of the knife.
### Return Type
void
```
--------------------------------
### GetEnterPosition
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Level.md
Gets the position where the player enters the current room.
```APIDOC
## GetEnterPosition
### Description
Retrieves the world position vector where the player entered the current room.
### Method
`GetEnterPosition()`
### Returns
- `Vector`: The entry position of the room.
```
--------------------------------
### Get Next Seed
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/Seeds.md
Retrieves the next seed in a sequence.
```APIDOC
## Get·Next·Seed ()
### Description
Retrieves the next seed in a sequence.
### Method
`GetNextSeed`
### Response
#### Success Response (int)
The next seed value.
```
--------------------------------
### Add MC_POST_GAME_STARTED Callback
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/enums/ModCallbacks.md
This callback is fired when a game is started, either a new run or a continued one. The boolean argument indicates if the run is continued.
```lua
local function onStart(_,bool)
print(bool)
end
mod:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, onStart)
```
--------------------------------
### Spawn Entities with Debug Console
Source: https://github.com/wofsauge/isaacdocs/blob/main/docs/tutorials/DebugConsole.md
Use the 'spawn' command to create entities in the game. You can specify entities by name or by a numerical ID with optional variant, subtype, and champion parameters.
```plaintext
spawn mega maw
```
```plaintext
spawn 20
```
```plaintext
spawn 10.1
```
```plaintext
spawn 10.2.0.4
```