Baldi's Basics Plus Glue API
A high-level modding framework for Baldi's Basics Plus.
BBPGlue
BBPGlue is a modding framework built on top of BepInEx and Harmony that exposes Baldi's Basics Plus through a clean, strongly-typed API.
Instead of spending time reverse-engineering game internals, writing Harmony patches, and manually accessing private fields through reflection, modders can interact with the game through a unified API:
BBP.Player
BBP.Environment
BBP.Callbacks
BBP.Authoring
BBP.Assets
BBPGlue is designed to be the foundation for gameplay mods, custom items, custom NPCs, game mode modifications, utility tools, and larger projects.
Disclaimer
BBPGlue is a modding framework and not a crack, launcher, bypass, redistribution package, or replacement for Baldi's Basics Plus.
The project does not contain game assets and requires a legitimate copy of Baldi's Basics Plus to function.
All game content remains property of Basically Games and their respective owners.
Why BBPGlue?
Traditional BepInEx modding often requires:
- Reverse engineering game internals
- Writing Harmony patches
- Using reflection
- Maintaining version-specific hacks
- Repeating boilerplate code
With BBPGlue:
BBP.Player.Stamina = 100f;
BBP.Environment.MakeNoise(
BBP.Player.Position,
127
);
BBP.Callbacks.Items.OnItemUse += item =>
{
BBPConsole.Log(item.NameKey);
};
The framework handles most of the plumbing so you can focus on creating mods.
Features
Unified Game Access
BBP.Game
BBP.Player
BBP.Environment
BBP.Entities
BBP.Hud
BBP.Events
BBP.Prefabs
BBP.Authoring
BBP.Assets
BBP.Callbacks
BBP.Experimental
Strongly Typed Wrappers
- BBPPlayer
- BBPEntity
- BBPNpc
- BBPDoor
- BBPElevator
- BBPRoom
- BBPRandomEvent
- BBPPickup
- BBPItemObject
- BBPSoundObject
- BBPAudioManager
Callback System
No Harmony patching required for common events.
Examples:
BBP.Callbacks.Items.OnItemUse
BBP.Callbacks.Items.OnPickupCollect
BBP.Callbacks.World.OnDoorOpen
BBP.Callbacks.World.OnRoomEnter
BBP.Callbacks.Npcs.OnNpcSpawn
BBP.Callbacks.Npcs.OnNpcCatchPlayer
BBP.Callbacks.Game.OnLevelReady
Runtime Authoring
Create custom content without modifying game assets.
BBP.Authoring.CloneNpc(
"my_mod:old_principal",
"Principal",
npc =>
{
npc.MaxSpeed = 10f;
}
);
Asset Loading
Sprite sprite =
BBP.Assets.LoadSprite("icon.png");
AudioClip clip =
await BBP.Assets.LoadAudioClipAsync("sound.wav");
Debugging Tools
- Console (SHIFT + F1)
- Debug Menu (SHIFT + F2)
Installation
Requirements
- Baldi's Basics Plus
- BepInEx 5.x
- Harmony
Install BepInEx
Download:
https://github.com/BepInEx/BepInEx/releases
Extract into the Baldi's Basics Plus installation folder.
Install BBPGlue
Copy:
into:
Launch the game.
Press:
If the console appears, BBPGlue is loaded successfully.
Your First Mod
Create a normal BepInEx plugin.
using BepInEx;
[BepInPlugin(
"com.example.mymod",
"My Mod",
"1.0.0"
)]
[BepInDependency("com.wufhex.BBPGlue")]
public sealed class Plugin : BaseUnityPlugin
{
private void Awake()
{
}
}
In-game console used for logging messages to a small overlay and capturing history.
Definition BBPConsole.cs:38
static void Log(string message)
Logs an informational message to the BBPGlue console and Unity logger.
Definition BBPConsole.cs:125
Listening To Events
Most mods begin by subscribing to callbacks.
private void Awake()
{
BBP.Callbacks.Items.OnItemUse += item =>
{
$"Used: {item.NameKey}"
);
};
}
Accessing Game Systems
BBP.Player.Stamina = 100f;
127
);
void MakeNoise(Vector3 position, int value)
Creates a noise at the specified position.
Definition BBPEnvironment.cs:909
Vector3 Position
World position of the player.
Definition BBPPlayer.cs:33
Central entrypoint for the modding API providing access to common subsystems.
Definition BBP.cs:9
static BBPPlayer Player
Provides access to player-related API surfaces and utilities.
Definition BBP.cs:15
static BBPEnvironment Environment
Environment and world-related utilities and state.
Definition BBP.cs:27
BBPRoom? GetPlayerRoom()
Gets the room the player is currently in.
Definition BBPEnvironment.cs:1141
Represents a room within a level providing access to tiles, cells, pickups and other room properties.
Definition BBPRoom.cs:11
Represents a door in the environment and exposes its state and control methods.
Definition BBPDoor.cs:10
BBPDoor? GetClosestDoor()
Gets the closest door to the player.
Definition BBPEnvironment.cs:1069
Runtime Authoring
BBPGlue can clone and register content at runtime.
BBP.Callbacks.Game.OnLevelReady += () =>
{
"my_mod:old_principal",
"Principal",
npc =>
{
npc.Name = "Old Principal";
npc.MaxSpeed = 10f;
}
);
};
BBPAuthoredPrefab CloneNpc(string id, string baseCharacter, Action< BBPNpc >? configure=null)
Clones a vanilla NPC prefab by BB+ character id and registers it.
Definition BBPAuthoring.cs:36
void Refresh()
Rebuilds the vanilla prefab cache from the current game state.
Definition BBPPrefabs.cs:63
static BBPPrefabs Prefabs
Access to commonly used prefab objects exposed by the game.
Definition BBP.cs:43
static BBPAuthoring Authoring
Authoring API for cloning and creating new prefabs (used for custom pickups, items,...
Definition BBP.cs:59
Spawn later:
"my_mod:old_principal",
);
object? Spawn(string id, Vector3 position)
Finds a prefab by custom id or vanilla name and spawns it.
Definition BBPAuthoring.cs:138
Custom Behavior
Callbacks can alter or cancel built-in behavior.
BBP.Callbacks.Items.OnItemUse += item =>
{
if (item.NameKey != "Monster BSoda")
return;
);
BBP.Player.RunSpeed *= 4f;
};
Contains all callback groups exposed by BBPGlue.
Definition BBPCallbacks.cs:10
static void Cancel()
Requests cancellation of the original game method for the current cancelable callback.
Definition BBPCallbacks.cs:542
int SelectedSlot
Currently selected inventory slot index.
Definition BBPItems.cs:20
void RemoveSlot(int slot)
Removes the item from the specified inventory slot.
Definition BBPItems.cs:203
static BBPItems Items
Item management and lookup utilities.
Definition BBP.cs:39
Example Project
See:
BBPGlue/src/Tests/CustomPrefabsTest.cs
The example demonstrates:
- Custom NPC creation
- Custom item creation
- Runtime sprite replacement
- Callback-driven behavior
- Cancelable item usage
- Timed effects
Architecture
API
Public modding surface.
Examples:
- BBPPlayer
- BBPNpc
- BBPEnvironment
- BBPEvents
Core
Internal systems.
Examples:
- ReflectionUtil
- ReflectionCache
- Harmony patches
- Runtime helpers
Wrappers
Typed wrappers around BB+ classes.
Examples:
- Door
- Room
- Pickup
- ItemObject
- RandomEvent
Compatibility
BBPGlue attempts to remain compatible with future BB+ updates whenever possible.
If the game version differs from the version BBPGlue was built against, a warning may appear in the console.
This warning is informational and does not necessarily indicate a problem.
Alpha Limitations:
- API may change
- Some callbacks may be incomplete or untested
- Compatibility only tested on BB+ 0.14.2
- Advanced custom NPC behavior is experimental and might be untested
FAQ
(no one asked but someone might)
Does BBPGlue modify game files?
No.
Does BBPGlue redistribute BB+ assets?
No.
Can I create custom NPCs?
Yes, through runtime authoring.
Can I create custom items?
Yes.
Do I Need Harmony or Custom Patches?
Usually, no.
BBPGlue already uses Harmony internally and exposes most common game functionality through wrappers, callbacks, and helper APIs. For many mods, you can create custom content, listen for game events, and modify gameplay behavior without writing a single Harmony patch.
If the functionality you need is not currently exposed by BBPGlue, you have several options:
- Open an Issue and request the feature.
- Submit a Pull Request.
- Use Harmony directly in your mod.
- Use utilities from BBPGlue.Core to simplify reflection and runtime interaction.
BBPGlue is designed to reduce Harmony and reflection boilerplate, not prevent advanced users from accessing the game's internals when necessary.
License
BBPGlue is licensed under the MIT License. Attribution is appreciated but not required.