> For the complete documentation index, see [llms.txt](https://skript-luckperms.gitbook.io/skript-luckperms/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://skript-luckperms.gitbook.io/skript-luckperms/groups/modifying-a-group.md).

# Modifying a Group

### Weight

The weight of a group does nothing on its own, but is quite useful for a few things.\
\
Consider these examples:

{% hint style="warning" %}
This example will only work on Skript 2.16+
{% endhint %}

```genie
local function handle(p: player):
    wait 1 tick
    set {_lp} to luckperms user from {_p}
    set {_group} to 1st element out of luckperms groups of {_lp}
    set {_weight} to weight of {_group}
    set {_prefix} to prefix of user {_lp}
    set {_p}'s tab list priority to {_weight}
    set {_p}'s tab list name to formatted "%{_prefix}%%{_p}'s displayname%"
    # this will sort the player on tablist and set their tablist name to their prefix

on user lose group:
    handle(player)
on user receive group:
    handle(player)
```

<figure><img src="/files/29YnjoaQxm3LXOVD8WYM" alt=""><figcaption></figcaption></figure>

The above example will show something like this (depending on what prefix you set).\
\
If you wish to simply edit a group's weight:

```genie
edit group "admin":
    set weight of event-group to 255
broadcast weight of "admin"
```

## Prefix/Suffix

Modifying a groups prefix and/or suffix is a bit complex: You must provide the prefix value, the priority, the duration (optional) and the group to apply it to.\
\
Consider these examples:\
\
Setting a suffix:

```genie
set {_suffix} to a new suffix builder:
    value: "<#E4A361>Owl"
    priority: 25
    duration: 1 week
edit group "bird":
    set suffix of group event-group to {_suffix}
broadcast "The group 'bird' just got an 'owl' suffix for the week!"
```

Adding a prefix:

```genie
set {_prefix} to a new suffix builder:
    value: "<red>Admin"
    priority: 255
edit group "admin":
    add {_prefix} to prefixes of group event-group
```


---

# 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://skript-luckperms.gitbook.io/skript-luckperms/groups/modifying-a-group.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.
