> For the complete documentation index, see [llms.txt](https://hiveminddocs.gitbook.io/hivemind/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-building-system-framework-ubs/buildable.md).

# Buildable

Subclassing the buildable class will allow you to create functionality that isn’t otherwise available, such as a crafting station. Just remember to set the Buildable Class in the Buildable Definition so the right class is being spawned for that definition.

### Callable Functions

* **`TryDestroyBuildable()`**\
  This will attempt to destroy the buildable. Always use this function when you want to destroy a buildable. Using the regular `Destroy()` function might cause issues.
* **`GetAllActions()`**\
  Get all available actions for this Buildable.
* **`GetOwnedGameplayTags()`**\
  Get all owned tags on this Buildable.
* **`GetClosestMatchingSocket()`**\
  Get the closest socket matching the Proxy Actors socket tag requirements.
* **`GetClosestSocket()`**\
  Get the closest socket to the given world location, regardless of the socket tag requirements.
* **`GetBuildableDefinition()`**\
  Get the buildable definition of this Buildable.
* **`FindSocketByName()`**\
  Find a socket by name, returns false if the socket does not exist.
* **`OccupySocket()`**\
  Makes the Buildable to Attach occupy the target socket.
* **`ReleaseSocket()`**\
  Releases the Socket which the Attached Buildable is occupying.
* **`GetAttachedBuildable()`**\
  Get the buildable which is attached to this socket.
* **`GetAttachedBuildables()`**\
  Get all buildables which are attached to this buildable.

### Delegates/Event Dispatchers

* **`OnBuildableDestruction()`**\
  You can bind to this event. Will be executed when upon Buildable Destruction.
* **`OnBuildableAttached()`**\
  You can bind to this event. Will execute upon new buildable being attached to this one.
* **`OnBuildableDetached()`**\
  You can bind to this event. Will execute upon other attached buildable being detached from this one.

### Overridable Functions

* **`OnBuildableDestroyed()`**\
  Overridable Event. This allows you to add your own logic to what should happen upon this Buildable being destroyed.
