Skip to main content

LuckPerms Integration

BetterTeams can hook into the LuckPerms permission plugin to provide dynamic contexts.
This is an extremely powerful feature that allows you to grant permissions to players based on their live team data.


What are Contexts?

Contexts are extra conditions that must be met for a permission to apply.
For example, you could create a permission that only applies if a player is the owner of their team, or if their team's level is 5.


Available Contexts

BetterTeams provides the following contexts (all keys start with bt_):

Context KeyDescriptionExample Value(s)
bt_inteamChecks if a player is in any team.true, false
bt_pvpChecks if the team has friendly-fire enabled.true, false
bt_openChecks if the team is open for anyone to join.true, false
bt_hashomeChecks if the team has set a home.true, false
bt_rankThe player's rank within their team.From Language file (e.g., owner)
bt_teamchatCurrent chat mode the player is using.From Language file (e.g., Team Chat)
bt_levelThe current level of the player's team.1, 2, 3, ...
bt_positionscoreThe team's rank on the score leaderboard.1, 2, 3, …
bt_positionbalThe team's rank on the balance leaderboard.1, 2, 3, …
bt_positionmembersThe team's rank on the member-count leaderboard.1, 2, 3, …

Usage Examples

Team Membership Permission

To give the kits.member permission only if the player is in any team:

/lp group default permission set kits.member true bt_inteam=true
note

Some context values are configurable in your language files. The values are sourced from the following placeholder keys:

  • bt_rank: placeholder.owner, placeholder.admin, placeholder.default
  • bt_teamchat: placeholder.teamChat, placeholder.allyChat, placeholder.globalChat

If you customize these placeholder values, the contexts will use your new values.