Build your own EverlookDB Bar plugin

EverlookDB Bar is our info bar for WoW Forever. Every button on it is a plugin, and you can write your own: gold per hour, a reputation tracker, your next raid night, anything you can read from the game. A plugin is a few lines of Lua in a tiny addon of your own. This guide takes you from 15 lines to a polished plugin with its own mini bar and settings.

Rather have an AI write it? This copies one self-contained brief: what the WoW Forever client is, the whole API, the rules and a complete example. Paste it into ChatGPT, Claude or any assistant; it will ask what your plugin should show, then write the addon. AI tools can also read it directly at everlookdb.com/ebar/plugins.md.

Quick start: a plugin in 15 lines

This plugin shows where your Hearthstone is bound. Make a folder MyHearth in World of Warcraft\_forever_\Interface\AddOns and put two files in it.

MyHearth/MyHearth.toc

## Interface: 16001
## Title: My Hearth
## Notes: Where my Hearthstone takes me.
## Version: 1.0.0
## Dependencies: EverlookBar

MyHearth.lua

MyHearth/MyHearth.lua

local obj = LibStub("LibDataBroker-1.1"):NewDataObject("MyHearth", {
	type = "data source",
	label = "Hearth",
	text = "?",
	icon = "Interface\\Icons\\INV_Misc_Rune_01",
	OnTooltipShow = function(tip)
		tip:AddLine("Hearthstone")
		tip:AddLine("Bound to " .. (GetBindLocation() or "?"), 1, 1, 1)
	end,
})
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("HEARTHSTONE_BOUND")
f:SetScript("OnEvent", function() obj.text = GetBindLocation() or "?" end)
  1. Restart the game (new addon folders are only read at launch) and make sure My Hearth is ticked under AddOns on the character screen.
  2. Type /ebar, open the Plugins page and press Add next to MyHearth under “Not on a bar”. Or type /ebar place myhearth 1 right.
  3. Change the code, type /reload, and see the change.

## Dependencies: EverlookBar makes sure EverlookDB Bar loads first, and EverlookDB Bar brings LibStub and LibDataBroker with it. Want your plugin to run without EverlookDB Bar too? See Publishing.

Data sources and launchers

A plugin is a LibDataBroker-1.1 (LDB) data object: the same kind of plugin Titan Panel, ChocolateBar, Bazooka and ElvUI show. EverlookDB Bar's own plugins, XP, Performance, Location and the rest, are plain LDB objects too and use the same path yours does.

There are two kinds. A data source shows a value (gold, coordinates, a timer): its icon and text are on by default. A launcher is an icon you click to open something: its icon, label and text are on by default. Either way the player decides per plugin what shows, with the Look button on the Plugins page.

AttributeWhat EverlookDB Bar does with it
type"data source" or "launcher"
textthe text on the bar. Without text: value and suffix, shown as “value suffix”
labelshown in grey before the text when Label is on
icona texture path or file ID
iconCoords{ left, right, top, bottom }; by default the icon's border is trimmed
iconR, iconG, iconBicon tint, 0 to 1
OnClick(frame, button)left, right and middle clicks
OnTooltipShow(tooltip)you fill the GameTooltip; EverlookDB Bar places and shows it
OnEnter(frame), OnLeave(frame)you show a tooltip of your own
tooltipyour own tooltip frame; EverlookDB Bar places, shows and hides it

Tooltips

The easy way is OnTooltipShow: you get the GameTooltip, add lines, and EverlookDB Bar anchors it away from the bar's edge of the screen (below a top bar, above a bottom bar) and shows it.

OnTooltipShow = function(tip)
	tip:AddLine("Hearthstone")                                   -- title
	tip:AddDoubleLine("Home", GetBindLocation() or "?", 1, 1, 1, 1, 1, 1)
	tip:AddLine("Right-click: options", 0.6, 0.6, 0.6)           -- a grey hint
end,

For a tooltip of your own (LibQTip, a custom frame), use OnEnter(frame) and OnLeave(frame), or give the data object a tooltip frame and let EverlookDB Bar place, show and hide it. Only one is used, in this order: tooltip, then OnEnter, then OnTooltipShow. OnLeave is always called.

A good tooltip is short: a title, the facts, then a grey line that says what the clicks do.

Clicks

OnClick(frame, button) gets "LeftButton", "RightButton" or "MiddleButton". EverlookDB Bar hides the tooltip first, so a menu you open isn't covered by it. A plugin without OnClick: a right-click on it opens the bar's settings.

OnClick = function(frame, button)
	if button == "RightButton" then
		showSeconds = not showSeconds   -- switch what the text shows
		update()
	elseif button == "LeftButton" then
		MyAddon:ToggleWindow()
	end
end,

Addons can't cast spells or use items from a click on the bar, and in combat many Blizzard windows can't be opened. Check InCombatLockdown() before anything that might be protected.

Updating the text

Assign the attribute and the bar follows: obj.text = "12 kills". You can also change icon, label or the icon tint the same way.

Mini bars and meters: custom widgets

LDB only knows text and an icon. To draw something of your own inside your button, a mini bar, a meter or a row of icons, register a widget with EverlookBar.API.RegisterWidget(ldbName, spec). It sits after the icon, your text follows it, and its height follows the bar's row height.

local ldb = LibStub("LibDataBroker-1.1")
local obj = ldb:NewDataObject("MyMana", { type = "data source", text = "0%" })
local pct = 0

local API = EverlookBar and EverlookBar.API
if API and API.GetVersion() >= 1 then
	API.RegisterWidget("MyMana", {
		width = 80,                        -- or function(dataobj, ldbName) return 80 end; 0 hides it
		create = function(f)               -- once: f is an empty Frame inside the button
			f.bg = f:CreateTexture(nil, "BACKGROUND")
			f.bg:SetAllPoints()
			f.bg:SetColorTexture(1, 1, 1, 0.1)
			f.fill = f:CreateTexture(nil, "ARTWORK")
			f.fill:SetPoint("TOPLEFT"); f.fill:SetPoint("BOTTOMLEFT")
			f.fill:SetColorTexture(0.2, 0.5, 1, 0.9)
		end,
		update = function(f)               -- every redraw: set sizes and colours, create nothing
			f.fill:SetWidth(math.max(0.01, 80 * pct))
		end,
	})
end

-- when the value changes, the text change redraws the widget too
pct = 0.42
obj.text = "42%"

update runs whenever your button redraws: when any attribute of your data object changes. If your widget's data changed but the text didn't, call API.Refresh("MyMana"). Titan and other displays don't know widgets and just show your text, so keep the text meaningful.

Timed updates: the shared ticker

Some values have no event: a countdown, a clock. Don't give your plugin an OnUpdate script. Use EverlookDB Bar's one shared ticker with API.Every(owner, interval, fn): it runs fn(task, now) every interval seconds (0.1 s at the finest) and catches errors, which show on the button named by owner.

local task = EverlookBar.API.Every("MyTimer", 1, function(task, now)
	obj.text = SecondsToTime(endsAt - now)
	if now >= endsAt then task:SetActive(false) end   -- done: stop ticking
end)

task:SetActive(true)    -- resume (runs on the next tick)
task:SetInterval(5)     -- slower
task:Cancel()           -- gone for good

A task starts active. Pause it whenever there is nothing to count: a paused task costs nothing. A task whose code fails 50 times is stopped until /reload.

Settings in /ebar

API.RegisterSettings(owner, title, settings) gives your plugin real settings without writing a window. They appear in /ebar on the Built-in page under your title, the window's search box finds them, they work from chat as /ebar <owner>.<key> <value>, and EverlookDB Bar saves them.

local get, set = EverlookBar.API.RegisterSettings("mykills", "My Kills", {
	{ key = "showtotal", type = "bool", label = "Show the total", default = true,
		desc = "The total since you installed it, next to today's count.",
		onChange = function(value) MyKills:Update() end },
	{ key = "decimals", type = "number", label = "Decimals", min = 0, max = 2, step = 1, default = 0 },
	{ key = "style", type = "choice", label = "Style", default = "short",
		choices = { { value = "short", text = "12" }, { value = "long", text = "12 kills" } } },
	{ key = "color", type = "color", label = "Text colour", default = { 1, 1, 1, 1 } },
})

local decimals = get("decimals")   -- the saved value, or the default
-- in chat: /ebar mykills.decimals 1

Placement

New plugins from other addons are not put on a bar by themselves: the player adds them on the Plugins page or drags them in unlock mode (/ebar unlock), unless they turned on “Put plugins from other addons on bar 1 when they appear”. You may place your plugin once, on first run, and never again after that, so a player who moved or removed it is respected.

-- in PLAYER_LOGIN (EverlookDB Bar's settings are loaded by then)
if not get("placed") then
	if EverlookBar.API.Place("MyKills", 1, "right") then set("placed", true) end
end

API.Place(ldbName, bar, group, index): bar 1 or more, group "left", "center" or "right", index the position in the group (nil: last). API.GetPlacement(ldbName) returns bar, group, index and row, or nil. API.GetNumBars() counts the bars. API.SetHidden(ldbName, true) hides your button without taking it off its bar, the way the XP bar hides at max level.

Rules that keep the bar fast and stable

EverlookDB Bar is built to cost next to nothing. A plugin that follows these rules keeps it that way.

  1. No OnUpdate. Use game events; for timed things, API.Every, paused when idle.
  2. Event-driven. Register only the events you need, and do the least work in each.
  3. No garbage. Make tables, closures, frames and textures once and reuse them. Nothing new in an event handler, a tick or a widget's update.
  4. Secret values: show, never read. In WoW Forever some game values come back secret, often in combat. Never compare one, do maths on it, use it as a table key or measure it. Check with issecretvalue(v); then put it straight into text (EverlookDB Bar shows it as it is and keeps the button's last width) or keep your last plain value.
  5. Nothing protected in combat. Check InCombatLockdown() and wait for PLAYER_REGEN_ENABLED.
  6. A unique name. Prefix your LDB name with your addon's name. NewDataObject returns nil when the name is taken.
local issecret = issecretvalue or function() return false end
local left = 0

local start, duration = C_Container.GetItemCooldown(6948)
if start ~= nil and not issecret(start) and not issecret(duration) then
	left = math.max(0, start + duration - GetTime())   -- safe: plain numbers
end                                                    -- else: keep the last plain value

A complete plugin: Hearth Bar

Everything together: an LDB object with tooltip and right-click, a cooldown mini bar, two settings, the shared ticker running only while needed, secret-value guards and first-run placement.

HearthBar/HearthBar.toc

## Interface: 16001
## Title: Hearth Bar
## Notes: Your Hearthstone's home and cooldown on EverlookDB Bar.
## Author: you
## Version: 1.0.0
## Dependencies: EverlookBar

HearthBar.lua

HearthBar/HearthBar.lua

-- Hearth Bar: where your Hearthstone takes you, and its cooldown as text and a mini bar.
local NAME = "HearthBar"       -- the LDB name: unique across all addons
local HEARTHSTONE = 6948       -- item ID
local WIDTH = 60               -- width of the cooldown bar in pixels

local API = EverlookBar.API
local getCooldown = (C_Container and C_Container.GetItemCooldown) or GetItemCooldown
local issecret = issecretvalue or function() return false end

local left, total = 0, 1       -- seconds of cooldown left, and the whole cooldown
local obj, task, get, set

-- Read the cooldown. In combat the values may be secret: then keep the last plain ones.
local function readCooldown()
	local start, duration = getCooldown(HEARTHSTONE)
	if start == nil or duration == nil or issecret(start) or issecret(duration) then return end
	if duration > 0 then
		left = math.max(0, start + duration - GetTime())
		total = duration
	else
		left, total = 0, 1
	end
end

local function update()
	readCooldown()
	if left > 0 then
		obj.text = string.format("%d:%02d", math.floor(left / 60), math.floor(left % 60))
	elseif get("showhome") then
		obj.text = GetBindLocation() or "Ready"
	else
		obj.text = "Ready"
	end
	if task then task:SetActive(left > 0) end -- tick only while there is a cooldown
end

obj = LibStub("LibDataBroker-1.1"):NewDataObject(NAME, {
	type = "data source",
	label = "Hearth",
	text = "",
	icon = "Interface\\Icons\\INV_Misc_Rune_01",
	OnTooltipShow = function(tip)
		tip:AddLine("Hearthstone")
		tip:AddDoubleLine("Home", GetBindLocation() or "?", 1, 1, 1, 1, 1, 1)
		if left > 0 then tip:AddDoubleLine("Ready in", SecondsToTime(left), 1, 1, 1, 1, 1, 1) end
		tip:AddLine("Right-click: show the inn or just Ready", 0.6, 0.6, 0.6)
	end,
	OnClick = function(_, button)
		if button == "RightButton" then
			set("showhome", not get("showhome"))
			update()
		end
	end,
})

get, set = API.RegisterSettings("hearthbar", "Hearth Bar", {
	{ key = "showhome", type = "bool", label = "Show the inn when the Hearthstone is ready", default = true,
		onChange = function() update() end },
	{ key = "bar", type = "bool", label = "Cooldown bar", default = true,
		desc = "A small bar that fills up while the Hearthstone cools down.",
		onChange = function() API.Refresh(NAME) end },
})

API.RegisterWidget(NAME, {
	width = function() return (left > 0 and get("bar")) and WIDTH or 0 end,
	create = function(f)
		f.bg = f:CreateTexture(nil, "BACKGROUND")
		f.bg:SetAllPoints()
		f.bg:SetColorTexture(1, 1, 1, 0.1)
		f.fill = f:CreateTexture(nil, "ARTWORK")
		f.fill:SetPoint("TOPLEFT")
		f.fill:SetPoint("BOTTOMLEFT")
		f.fill:SetColorTexture(0.35, 0.66, 1, 0.9)
	end,
	update = function(f)
		f.fill:SetWidth(math.max(0.01, WIDTH * (1 - left / total)))
	end,
})

-- One shared ticker, once a second, active only while the Hearthstone cools down.
task = API.Every(NAME, 1, update)

local events = CreateFrame("Frame")
events:RegisterEvent("PLAYER_LOGIN")
events:RegisterEvent("PLAYER_ENTERING_WORLD")
events:RegisterEvent("BAG_UPDATE_COOLDOWN")
events:RegisterEvent("HEARTHSTONE_BOUND")
events:SetScript("OnEvent", function(_, event)
	if event == "PLAYER_LOGIN" and not get("placed") then
		-- first run only: put it on bar 1, right group; after that the player decides
		if API.Place(NAME, 1, "right") then set("placed", true) end
	end
	update()
end)

In game: /ebar hearthbar.bar off hides the mini bar, and searching “hearth” in the /ebar window finds both settings.

Testing and troubleshooting

Publishing

Your plugin is yours: use any licence you like. Because it is a plain LibDataBroker plugin, it also works in Titan Panel, ChocolateBar, Bazooka and ElvUI. To make it run without EverlookDB Bar:

  1. Embed LibStub, CallbackHandler-1.0 and LibDataBroker-1.1 in a Libs folder (keep their licence files) and list them in your .toc before your own file.
  2. Replace ## Dependencies: EverlookBar with ## OptionalDeps: EverlookBar, so EverlookDB Bar still loads first when it is there.
  3. Wrap every EverlookDB Bar call: local API = EverlookBar and EverlookBar.API, then if API and API.GetVersion() >= 1 then ... end, with a fallback for what you rely on (C_Timer.NewTicker instead of API.Every, your own SavedVariables instead of RegisterSettings).
  4. Upload it to CurseForge, Wago or GitHub and mark it for WoW Forever (interface 16001).

EverlookBar.API keeps a compatibility promise: API.GetVersion() only grows, and a published function keeps its name, arguments and meaning in every later version. A plugin written for version 1 keeps working.

EverlookBar.API reference (version 1)

FunctionWhat it does
API.GetVersion() → numberThe API version, currently 1.
API.RegisterWidget(ldbName, spec) → trueDraw your own widget in your button. spec.width (number or function, 0 hides), spec.create(frame, dataobj, ldbName) once, spec.update(frame, dataobj, ldbName) on every redraw.
API.Refresh(ldbName)Redraw your button on the next frame.
API.SetHidden(ldbName, hidden)Hide or show your button without taking it off its bar. false if the plugin isn't known yet.
API.Every(owner, interval, fn) → taskRun fn(task, now) every interval seconds on the shared ticker. task:SetActive(bool), task:SetInterval(s), task:Cancel().
API.RegisterSettings(owner, title, settings) → get, setSettings in the /ebar window, its search and chat (/ebar owner.key value), saved by EverlookDB Bar.
API.Place(ldbName, bar, group, index) → boolPut a plugin on a bar. For a first-run default only.
API.GetPlacement(ldbName) → bar, group, index, rowWhere a plugin is, or nil.
API.GetNumBars() → numberHow many bars there are.

EverlookDB Bar itself is licensed under GPL-3.0. This guide was checked against EverlookDB Bar 0.1.0 and API version 1.