> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hiveminddocs.gitbook.io/hivemind/code-systems/ultimate-building-system-framework-ubs/buildable.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
