Binding of Isaac - Afterbirth+ Lua Reference/Guide
|
To access the debug console, mods must be enabled. If you don't have any mods to enable, download one from Steam Workshop, or create an empty folder in your mods.
To show the console, while in a run press the grave/tilde (`~) key. On english (American) keyboardlayouts, it should be below Esc.
Language | Keyboard | Key |
---|---|---|
English | QWERTY | ` or ~ |
French | AZERTY | ù |
German | QWERTZ | ö |
Spanish | QWERTY | ñ |
Italian | QWERTY | > |
Danish | QWERTY | æ |
Portuguese | QWERTY | ç |
To hide the console, just hit Enter without typing anything.
Beware of spoilers! You can easily learn things accidentally via the debug console that you might have wanted to learn from regular gameplay!
The debug console is a feature of Isaac that's been around since Rebirth, but until AB+ it's only been enabled in developer builds. Now modders can finally unleash its power! It can be a big time saver for testing your changes during development of mods.
The debug console is not completely stable, so if you enter commands like numbers outside certain ranges, it may crash. Some of the crashes are documented below, but there are likely others.
If you're testing a specific item or item combo, it's useful to enter your commands and then exit and continue so your items are reloaded when you continue and you don't need to keep retyping the same command. Also, try the clipboard! You can paste multiple commands at once or copy the last few commands you entered using the copy command.
Some commands that are still in the game aren't listed here since they're only useful for Nicalis developers, or are no longer useful. For instance, the achievement and eggs commands unlock stuff in your game save, but saving your persistent data is disabled when mods are turned on.
Syntax
Very similar names are incredibly common among entities, so you'll likely need to type the name to figure out the number, then delete it and type the number manually. The decimal syntax lets you specify: Type.Variant.Subtype.Champion. spawn 10.2.0.4
will get you a gaper(10)'s flaming variant(.2) with a blue champion type(.4).
Syntax
s is for special room types, and d is for normal room types. The rooms will be different depending on what floor you're on, so goto d.10 will take you to a different room on stage 1 than it will on stage 3.
Syntax
Move to another floor on the same seed. You can use this to skip ahead to a later floor, go backwards to an earlier floor, or reset the current floor by entering the current floor's id.
Entering nonexistent floors can crash the game.
Syntax
Spawns the grid entity with the given ID at a random place in the room. For some reason it doesn't always do something, possibly because of failing to overwrite other grid entities or trying to spawn outside the room or something. Pits won't look right until you leave the room and come back.
Various cheats that are useful for testing. Some of the ones not listed here are obsolete, not very useful, or possibly broken. Here are the ones that are still useful.
debug 3 Complete invincibility
debug 4 +40 damage. Good with Soy Milk.
debug 7 Display damage values, similar to the Spider Mod item
debug 8 Your active item always has max charge.
debug 9 Your luck is very high, so luck-based random events like random tear effects happen more often.
debug 10 All enemies take rapid damage at all times, so rooms are usually cleared in under a second.
aliases: g
Name collisions are somewhat common among items, so you'll likely need to type the name to figure out the number, then delete it and type the number manually. For items, use "c15" to give the item by number instead of name. For trinkets numbers, use "t15" Notice how it can autocomplete if you don't type the full name. It doesn't work with some odd item names like "<3" so you'll have to figure out the collectible number and use "c15" instead.
Unfortunately you can't type pills or cards by name, so you have to figure out the number. You can give yourself pills even if that pill's effect is not in the rotation. It won't subsequently appear in rotation afterwards.
Syntax
remove *
is a special version of the command that should remove all items.
Syntax
Gives Isaac a number of totally random costumes, without having the associated items.
The same as holding R. Resets the game back to the beginning of a new run.
listcollectibles Prints a list of all items in your possession, and how many of each
Syntax
The commands above will spawn one, then fifty gapers, and then give you one MEAT! and then two hundred more MEAT!s. repeat looks back up the previous console command. The last one that wasn't a repeat command is re-entered as many times as requested. You can use this to give yourself tons of items or spawn tons of enemies. Exercise restraint! Remember that an extreme number of repetitions of some commands might crash the game or leave it hanging for a long time.
Removes all easter egg effects from the current run.
Syntax
It's much easier just to exit to the character select and type the seed the normal way. Easter egg seeds won't work. It's case-sensitive (uppercase only) and doesn't replace "i" with "1," etc.
Syntax
Starts a new run on a random seed on the given challenge number. Numbers greater than the number of challenges included in the base game will cause the game to crash.
Syntax
Gives you an item combo, taking 69 random items from the specified item pool (in this case, 0 is the treasure room item pool).
This command wasn't designed for general consumption, as macros can only be added in C++ code. Sorry! If there's enough demand we can consider adding a similar feature for modder access. It just pastes a bunch of hardcoded console commands one after another using an abbrevition that's quick to type. You can use the clipboard to similar effect.
Syntax
Set a value corresponding to a sum of the desired curses. Darkness (1) + Labyrinth (2) + Lost (4) + Unknown (8) + Cursed (16) + Maze (32) + Blind (64) = 127
The stage or reseed commands are useful after adding curse of the labyrinth to force the floor to be re-generated.
Generates a new layout for the current floor with a new floor seed. This floor will no longer match other people playing the same seed.
Syntax
Copies the last three console commands to your clipboard. Paste one or more commands with ctrl+v, or command+v on mac.
Clears the console. Useful for video recording purposes or if you want to dispose of incriminating evidence.
aliases: l
Syntax
Directly runs a line of Lua code. The first example simply prints "Hello World!" to the console, while the second prints the current HP and max HP of every vulnerable enemy in the room.
Syntax
Takes a path to a lua file and runs it immediately. Paths are relative to the folder where the game is installed.
Syntax
Takes a mod folder name and runs the main.lua for it. This can be used to reload a mod without relaunching the game.
Reports memory usage for Lua