> ## Documentation Index
> Fetch the complete documentation index at: https://docs.selvut.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Packet Actionbar Filter

> Cancel actionbar packets containing configured text.

Save as `actionbar_filter.lua`.

```lua theme={null}
Script.meta({
  name = "Actionbar Filter",
  description = "Cancels matching actionbar text packets."
})

local hidden = Setting.text("Hidden Text", {
  default = "example"
})

local logMatches = Setting.bool("Log Matches", {
  default = false
})

Script.on("packet_receive", function(event)
  if event.type ~= "system_chat" or not event.overlay then return end

  local needle = string.lower(hidden.get())
  local text = string.lower(event.text or "")
  if needle == "" or string.find(text, needle, 1, true) == nil then
    return
  end

  event.cancel()
  if logMatches.get() then
    Chat.log("Filtered actionbar: " .. event.text)
  end
end)
```

Packet callbacks are non-blocking. Use cached state from `tick` callbacks if a packet filter needs player or world data.
