|
Baldi's Basics Plus Glue API
Modding API for Baldi's Basics Plus
|
Provides discovery, lookup, registration, and spawning helpers for BB+ prefabs and runtime-authored prefab-like objects. More...
Public Member Functions | |
| void | ClearCustomPrefabs () |
| Clears all runtime-authored prefab registrations. | |
| object? | FindPrefabByName (string name) |
| Finds a prefab or prefab-like object by id/name. | |
| object? | GetCustomPrefab (string id) |
| Gets a runtime-authored prefab or prefab-like object by id. | |
| string | GetItemName (object? item) |
| Gets the best available name for a vanilla item object. | |
| object? | GetItemObject (BBPItemId id) |
| Finds a vanilla item object template by BBPGlue item id. | |
| object? | GetItemObjectByIndex (int index) |
| Gets a vanilla item object by index from the discovered item cache. | |
| object? | GetItemObjectByName (string name) |
| Finds a vanilla item object by display/localization name or item type name. | |
| object? | GetItemObjectByTypeName (string typeName) |
| Finds a vanilla item object by its internal item type name. | |
| string | GetNpcCharacter (object? npc) |
| Gets the BB+ character identifier from an NPC prefab. | |
| object? | GetNpcPrefabByCharacter (string character) |
| Finds a vanilla NPC prefab by its BB+ character identifier. | |
| object? | GetNpcPrefabByIndex (int index) |
| Gets a vanilla NPC prefab by index from the discovered NPC cache. | |
| object? | GetNpcPrefabByName (string name) |
| Finds a vanilla NPC prefab by Unity object name. | |
| object? | GetNpcPrefabByTypeName (string typeName) |
| Finds a vanilla NPC prefab by component/runtime type name. | |
| string | GetPrefabName (object? prefab) |
| Gets a best-effort readable name for a prefab or prefab-like object. | |
| void | Refresh () |
| Rebuilds the vanilla prefab cache from the current game state. | |
| bool | RegisterCustomPrefab (string id, object prefab) |
| Registers a runtime-authored prefab or prefab-like object under a stable BBPGlue id. | |
| bool | RemoveCustomPrefab (string id) |
| Removes a runtime-authored prefab registration. | |
| object? | SpawnAtPlayer (object prefab) |
| Spawns a prefab at the player's current position. | |
| object? | SpawnAtWorld (object prefab, Vector3 position) |
| Spawns a prefab at a world position. | |
| object? | SpawnByName (string name, Vector3 position) |
| Finds a prefab by id/name and spawns it at a world position. | |
Properties | |
| IReadOnlyDictionary< string, object > | CustomPrefabs [get] |
| Gets runtime-registered prefabs and prefab-like authored objects. | |
| IReadOnlyList< object > | ItemObjects [get] |
| Gets the discovered vanilla item object templates. | |
| IReadOnlyList< object > | NpcPrefabs [get] |
| Gets the discovered vanilla NPC prefabs. | |
Provides discovery, lookup, registration, and spawning helpers for BB+ prefabs and runtime-authored prefab-like objects.
| void BBPGlue.API.BBPPrefabs.ClearCustomPrefabs | ( | ) |
Clears all runtime-authored prefab registrations.
Vanilla discovered prefab caches are not affected.
| object? BBPGlue.API.BBPPrefabs.FindPrefabByName | ( | string | name | ) |
Finds a prefab or prefab-like object by id/name.
Search order: custom authored prefabs, vanilla NPC prefabs, then vanilla item objects.
| name | Custom id, NPC prefab name, or item name. |
| object? BBPGlue.API.BBPPrefabs.GetCustomPrefab | ( | string | id | ) |
Gets a runtime-authored prefab or prefab-like object by id.
| id | The id passed to RegisterCustomPrefab. |
| string BBPGlue.API.BBPPrefabs.GetItemName | ( | object? | item | ) |
Gets the best available name for a vanilla item object.
| item | The item object to inspect. |
| object? BBPGlue.API.BBPPrefabs.GetItemObject | ( | BBPItemId | id | ) |
Finds a vanilla item object template by BBPGlue item id.
| id | The vanilla item id to locate. |
| object? BBPGlue.API.BBPPrefabs.GetItemObjectByIndex | ( | int | index | ) |
Gets a vanilla item object by index from the discovered item cache.
| index | Zero-based index into ItemObjects. |
| object? BBPGlue.API.BBPPrefabs.GetItemObjectByName | ( | string | name | ) |
Finds a vanilla item object by display/localization name or item type name.
| name | The item name, localization key, or type name to search for. |
| object? BBPGlue.API.BBPPrefabs.GetItemObjectByTypeName | ( | string | typeName | ) |
Finds a vanilla item object by its internal item type name.
| typeName | The item type name to search for. |
| string BBPGlue.API.BBPPrefabs.GetNpcCharacter | ( | object? | npc | ) |
Gets the BB+ character identifier from an NPC prefab.
| npc | The NPC prefab or component to inspect. |
| object? BBPGlue.API.BBPPrefabs.GetNpcPrefabByCharacter | ( | string | character | ) |
Finds a vanilla NPC prefab by its BB+ character identifier.
| character | The character identifier to search for. |
| object? BBPGlue.API.BBPPrefabs.GetNpcPrefabByIndex | ( | int | index | ) |
Gets a vanilla NPC prefab by index from the discovered NPC cache.
| index | Zero-based index into NpcPrefabs. |
| object? BBPGlue.API.BBPPrefabs.GetNpcPrefabByName | ( | string | name | ) |
Finds a vanilla NPC prefab by Unity object name.
| name | The prefab object name to search for. |
| object? BBPGlue.API.BBPPrefabs.GetNpcPrefabByTypeName | ( | string | typeName | ) |
Finds a vanilla NPC prefab by component/runtime type name.
| typeName | The runtime type name to search for. |
| string BBPGlue.API.BBPPrefabs.GetPrefabName | ( | object? | prefab | ) |
Gets a best-effort readable name for a prefab or prefab-like object.
| prefab | The object to inspect. |
| void BBPGlue.API.BBPPrefabs.Refresh | ( | ) |
Rebuilds the vanilla prefab cache from the current game state.
Custom prefabs registered through RegisterCustomPrefab are not cleared.
| bool BBPGlue.API.BBPPrefabs.RegisterCustomPrefab | ( | string | id, |
| object | prefab ) |
Registers a runtime-authored prefab or prefab-like object under a stable BBPGlue id.
This is the general registration path used by authored NPCs, pickups, item objects, GameObjects, Components, ScriptableObjects, or other Unity objects. It does not modify BB+ resources; it only stores the object for BBPGlue lookup.
| id | Unique id used to retrieve the object later. |
| prefab | Prefab, template, component, or scriptable object to register. |
| bool BBPGlue.API.BBPPrefabs.RemoveCustomPrefab | ( | string | id | ) |
Removes a runtime-authored prefab registration.
| id | The id of the custom prefab to remove. |
| object? BBPGlue.API.BBPPrefabs.SpawnAtPlayer | ( | object | prefab | ) |
Spawns a prefab at the player's current position.
| prefab | The prefab or component to spawn. |
| object? BBPGlue.API.BBPPrefabs.SpawnAtWorld | ( | object | prefab, |
| Vector3 | position ) |
Spawns a prefab at a world position.
| prefab | The prefab or component to spawn. |
| position | World position where the prefab should be spawned. |
| object? BBPGlue.API.BBPPrefabs.SpawnByName | ( | string | name, |
| Vector3 | position ) |
Finds a prefab by id/name and spawns it at a world position.
| name | Custom id, NPC prefab name, or item name. |
| position | World position where the prefab should be spawned. |
|
get |
Gets runtime-registered prefabs and prefab-like authored objects.
|
get |
Gets the discovered vanilla item object templates.
|
get |
Gets the discovered vanilla NPC prefabs.