LibBodyguard-1.0
Every seasoned World of Warcraft addon developer knows the frustration of reinventing the wheel. When you need to interact with a specific game mechanic, a well-crafted library can save hours of coding. LibBodyguard-1.0 is exactly that kind of tool—a specialized, embeddable library designed to query information about the player's current bodyguard follower. Whether you are building a comprehensive UI suite or a simple quality-of-life tweak, this library provides a clean, consistent API to access bodyguard data without wrestling with the game's underlying systems.
What Exactly Is LibBodyguard-1.0?
At its core, LibBodyguard-1.0 is a World of Warcraft addon library. It does not provide a visual interface or direct player-facing features. Instead, it acts as a silent helper for other addons. Its sole purpose is to detect and report information about the bodyguard currently assigned to your character. In the Warlords of Draenor expansion, bodyguards were introduced as NPC followers who would physically accompany you in the open world, fighting by your side. While the system has evolved, the need to programmatically identify these companions remains for many addon authors. This library answers simple but crucial questions: Is a bodyguard active? What is their name? What is their health status? What is their unique GUID?
Key Features and Current Capabilities
LibBodyguard-1.0 is still in active development, with a clear roadmap for expansion. Currently, it reliably provides three core pieces of data about your active bodyguard:
- Name: The full name of the NPC follower.
- Health: Current and maximum health values, essential for monitoring their survival.
- Last Known GUID: The globally unique identifier, useful for precise targeting or tracking across sessions.
The developer's vision is to eventually expose any feasible information about bodyguards, making this a future-proof foundation for addon creators. The library is distributed under the permissive MIT License, encouraging widespread use and contribution.
How to Install LibBodyguard-1.0
Understanding how to install this library correctly is vital, as it differs from a typical standalone addon. Since it is a library, it is usually embedded directly within another addon's folder. If you are an addon author, you simply include the LibBodyguard-1.0 folder inside your addon's libs directory and reference the load.xml file in your TOC file. For end users, the process is often automated. When you download LibBodyguard-1.0 as a standalone package from a site like CurseForge or Wago.io, you can extract it into your World of Warcraft\_retail_\Interface\AddOns folder just like any other addon. However, it will only activate when another addon that depends on it is loaded. This design keeps your addon memory footprint lean.
Developer Usage and API Integration
Consuming the library in your own addon is straightforward, following the standard LibStub pattern. First, ensure your addon lists LibBodyguard-1.0 as a dependency. Then, in your Lua code, you can access it with a simple call:
local bodyguardLib = LibStub("LibBodyguard-1.0")
Once you have the library object, you can call its public methods to retrieve information. The API is documented with LuaDoc comments, making it easy to explore. For example, you might check if a bodyguard exists and then display their name in a custom unit frame. The library handles all the event listening and data caching internally, so your addon can focus on presentation. Full documentation is available on the project's GitHub pages, and the code itself contains helpful comments for those who want to dive deeper.
Compatibility Across World of Warcraft Versions
One of the most common questions is about version support. LibBodyguard-1.0 for World of Warcraft is primarily designed for Retail, where the bodyguard system originated and continues to be relevant through various expansions. However, the library's lightweight nature and reliance on core API functions mean it often works seamlessly on Classic-era clients, including Classic, The Burning Crusade (TBC), Wrath of the Lich King (WotLK), and even Cataclysm or Mists of Pandaria (MoP), provided those versions have the concept of a bodyguard or similar follower mechanic. Addon authors targeting these older expansions can embed the library with confidence, though they should test for any API discrepancies. The library's maintainer actively welcomes contributions to improve cross-version compatibility, so if you encounter an issue on a specific client, a pull request is always appreciated.
For players who manage dozens of addons across multiple WoW clients, keeping libraries like this updated can be a chore. The foxygame.net launcher simplifies this by offering a curated addon catalog that includes LibBodyguard-1.0, allowing you to install it with a single click and automatically receive updates whenever a new version is released, ensuring compatibility with the latest game patches without manual file hunting.
Why Addon Authors Should Adopt This Library
Using a shared library like LibBodyguard-1.0 offers several advantages. It prevents duplicate code across the community, reduces the risk of conflicts, and centralizes bug fixes. If a game patch changes how bodyguard data is accessed, only the library needs to be updated, and all dependent addons benefit instantly. This collaborative model has been the backbone of the WoW addon ecosystem for years, and LibBodyguard-1.0 continues that tradition. Its MIT License means you can freely use it in both free and commercial addon projects without restriction.
Getting Started and Contributing
Ready to integrate bodyguard functionality into your addon? The first step is to download LibBodyguard-1.0 from its official repository or a trusted addon host. Once you have the files, embed them in your addon's folder structure and add the necessary lines to your TOC file. If you are an end user, simply install it like any other addon and ensure your addon manager keeps it updated. The library's creator, Adam Hellberg, actively encourages contributions. Whether you want to add new features, improve documentation, or fix a bug, the project's GitHub page is open for pull requests. The WoW UI development community, including the helpful folks on freenode/#wowuidev, is a fantastic resource for getting started.
Practical Applications in Your UI
Imagine a custom unit frame that highlights your bodyguard's health bar, or a combat log parser that tracks your bodyguard's damage contribution. With LibBodyguard-1.0, these ideas become simple to implement. You can query the bodyguard's GUID to anchor a nameplate, monitor their health to trigger a warning when they fall low, or even create a small movable frame that shows their current target. The library handles the heavy lifting of event listening and data validation, so you can focus on the creative aspects of your addon. As the library matures and exposes more attributes, the possibilities will only expand.
Final Thoughts
LibBodyguard-1.0 may be a small, focused library, but it fills a specific niche that many addon developers encounter. By providing a reliable, standardized way to access bodyguard information, it saves time and promotes cleaner code. Whether you are building for the latest Retail patch or maintaining a legacy addon for Wrath of the Lich King Classic, this library is a valuable addition to your toolkit. Its open-source nature and active development ensure it will continue to evolve alongside World of Warcraft. So, if you are ready to enhance your addon with bodyguard awareness, give LibBodyguard-1.0 a try—your users will appreciate the extra polish it brings to their gameplay experience.