SpiritKnwtdaygvxz
📎 1 file 31,285 chars
📄
pasted-code-1786867835487.txt
txt 2192 lines
▶
# KODARI AI — COMPLETE PRODUCTION-READY GUILD PLUGIN

Build a **complete, production-ready Minecraft Guild/Clan plugin** designed for competitive PvP servers.

The plugin should provide a polished guild system inspired by the functionality and user experience of **BetterTeams and Stray.gg-style clan systems**, while implementing this specification as its own original system.

Do not create a basic/simplified clan plugin.

Implement the complete system, including all commands, permissions, persistence, configuration, chat, alliances, points, leaderboards, callouts, formatting, administration, tab completion, and quality-of-life features described below.

---

# 1. CORE COMMAND

Primary command:

```text
/guild
```

Alias:

```text
/g
```

`/g` must behave exactly like `/guild`.

All guild functionality must be accessible through `/guild` subcommands.

Do NOT create unnecessary standalone aliases for every subcommand.

---

# 2. GUILD DATA MODEL

Every guild must have separate persistent properties for:

```text
Guild ID
Guild Name
Guild Tag
Owner
Admins
Members
Points
Open/Closed state
Guild PvP state
Allied Guilds
Ally PvP state
Pending Guild Invitations
Pending Alliance Invitations
Creation timestamp
```

Guild Name and Guild Tag MUST be separate values.

Example:

```text
Name: Frost PvP
Tag: FROST
```

Changing the name must NOT change the tag.

Changing the tag must NOT change the name.

Persist all important guild data across:

* server restarts
* plugin reloads
* `/guildadmin reload`

Use the project's existing storage system if one exists.

If no storage system exists, implement a reliable persistent storage solution appropriate for the plugin/server.

---

# 3. GUILD CREATION

Implement:

```text
/guild create 
```

The creation command must require **ONLY the guild name**.

Example:

```text
/guild create Frost
```

Do NOT require a tag during creation.

When a guild is created:

* creator becomes OWNER
* guild starts with 0 points
* guild starts closed by default
* guild PvP uses configured default
* guild has no allies
* guild data is immediately persisted
* a default tag is generated

Default tag behavior should be configurable.

Example:

```yaml
guild:
  default-tag:
    mode: first-3-characters
```

For:

```text
/guild create Frost
```

the default tag could be:

```text
FRO
```

The exact default behavior can be implemented cleanly according to the architecture.

---

# 4. GUILD NAME

Implement:

```text
/guild name 
```

Example:

```text
/guild name FrostPvP
```

Only the OWNER can change the guild name.

The name must have configurable limits:

```yaml
guild-name:
  min-length: 3
  max-length: 16
```

Guild names should normally be plain text unless explicitly enabled.

Support configurable:

```yaml
guild-name:
  allow-colors: false
  allow-gradients: false
  allow-hex: false
```

Prevent:

* duplicate names
* empty names
* invalid characters
* excessive length
* invalid formatting
* renaming to an already existing guild

Guild name uniqueness should be case-insensitive.

For example:

```text
Frost
frost
FROST
```

must be considered the same guild name.

---

# 5. GUILD TAG

Implement:

```text
/guild tag 
```

Example:

```text
/guild tag FROST
```

Only the OWNER can change the tag.

Guild tag is completely separate from guild name.

Example:

```text
Name: Frost PvP
Tag: FROST
```

---

# 6. UNIVERSAL GUILD TAG FORMATTING

This is extremely important.

Guild tags must support multiple Minecraft formatting syntaxes simultaneously.

The system must support:

* MiniMessage
* arbitrary HEX colors
* arbitrary RGB colors
* `&#RRGGBB`
* Minecraft `&` color codes
* Minecraft `§` color codes
* legacy formatting
* gradients
* rainbow
* bold
* italic
* underline
* strikethrough
* obfuscated
* other safe formatting supported by the installed Adventure/Minecraft API

Do NOT restrict users to a predefined color list.

There must be **NO predefined color whitelist**.

---

## 6.1 Arbitrary HEX

Any valid HEX color must work.

Examples:

```text
𞉀Frost
�D9FFFrost
B5CFFFrost
&#FB0000Frost
&#C0FFEEFrost
```

No HEX color needs to be added to `config.yml`.

---

## 6.2 Per-Character HEX

This MUST work:

```text
&#FB0000M&#FB1414i&#FC2727n&#FC3B3Be&#FC4E4Ec&#FD6262r&#FD7676a&#FD8989f&#FD9D9Dt&#FEB1B1.&#FEC4C4M&#FED8D8e&#FFEBEBn&#FFFFFFu
```

Each character must retain its individual color.

Do NOT flatten the entire tag into one color.

---

## 6.3 MiniMessage

Support MiniMessage.

Examples:

```text
FROST
```

```text
<#00D9FF>FROST
```

```text
FROST
```

```text
FROST
```

```text
FROST
```

Use the Adventure MiniMessage API appropriate to the actual project/server version.

Do not create a fake MiniMessage parser.

---

## 6.4 Legacy `&` Codes

Support:

```text
&0
&1
&2
&3
&4
&5
&6
&7
&8
&9
&a
&b
&c
&d
&e
&f
```

And:

```text
&k
&l
&m
&n
&o
&r
```

Examples:

```text
&b&lFROST
```

```text
&c&lFrost &7PvP
```

---

## 6.5 Section Sign

Support:

```text
§b§lFROST
```

and valid Minecraft HEX/formatting sequences where supported.

---

## 6.6 Gradients

Gradients must accept completely arbitrary colors.

Example:

```text
FROST
```

Multi-stop gradients must work:

```text
FROST
```

Do NOT restrict gradient colors.

---

## 6.7 Mixed Formatting

Support valid combinations such as:

```text
&l�D9FFFrost PvP
```

and:

```text
FROST
```

Use a deterministic parsing pipeline.

Do not allow one parser to accidentally destroy another format.

---

# 7. TAG CONFIGURATION

Configuration should control formatting **categories**, not individual colors.

Example:

```yaml
guild-tag:
  enabled: true

  min-length: 1
  max-length: 32

  formatting:
    minimessage: true
    legacy-colors: true
    section-sign: true
    hex: true
    gradients: true
    rainbow: true
    formatting-codes: true
```

Do NOT create:

```yaml
allowed-colors:
  - red
  - blue
  - "#00D9FF"
```

That is specifically NOT wanted.

If HEX is enabled, all valid HEX colors are allowed.

If gradients are enabled, all valid gradient colors are allowed.

---

# 8. TAG STORAGE

Store the original formatted string.

For example:

```text
&#FB0000M&#FB1414i&#FC2727n...
```

must remain stored as the original formatting string.

Do NOT permanently convert it to a single legacy color representation.

Internally, render it into Adventure Components where appropriate.

The raw formatted tag should remain the canonical stored value.

---

# 9. GUILD ROLES

Use:

```text
OWNER
ADMIN
MEMBER
```

## OWNER

Can manage everything within their guild.

## ADMIN

Can:

* invite
* kick
* callout
* manage alliances
* open/close guild
* manage normal administrative guild functions

Admins cannot:

* disband the guild
* demote the owner
* promote themselves to owner
* transfer ownership unless ownership transfer is explicitly used

## MEMBER

Can:

* guild info
* guild list
* guild top
* guild chat
* ally chat
* leave
* other normal non-administrative features

Members MUST NOT be able to use:

```text
/guild invite
/guild open
/guild close
/guild callout
/guild ally
/guild promote
/guild demote
/guild disband
```

IMPORTANT:

Members MUST be allowed to use:

```text
/guild allychat
```

---

# 10. GUILD INVITES

Implement:

```text
/guild invite 
```

Authorized guild staff can invite a player.

The player joins using:

```text
/guild join 
```

Requirements:

* prevent duplicate invitations
* prevent inviting someone already in a guild
* prevent self-invites
* prevent invalid guilds
* configurable invitation expiration
* persistence where appropriate
* tab completion

Configuration:

```yaml
invitations:
  expiry-seconds: 300
```

---

# 11. OPEN GUILDS

Implement:

```text
/guild open
/guild close
```

Only authorized guild staff can use these.

When open:

```text
/guild join 
```

works without an invitation.

When closed:

an invitation is required.

Open guilds should appear in tab completion for `/guild join`.

Persist the state.

---

# 12. GUILD LEAVE

Implement:

```text
/guild leave
```

Requirements:

* members can leave
* owner cannot simply leave
* owner must transfer ownership or disband
* configurable confirmation if desired
* all data remains consistent

---

# 13. GUILD KICK

Implement:

```text
/guild kick 
```

OWNER/ADMIN can kick members according to role permissions.

Prevent:

* kicking owner
* kicking yourself
* kicking players outside the guild
* admin kicking owner

---

# 14. PROMOTE / DEMOTE

Implement:

```text
/guild promote 
/guild demote 
```

Only OWNER can use these.

Promotion:

```text
MEMBER -> ADMIN
```

Demotion:

```text
ADMIN -> MEMBER
```

Prevent:

* promoting yourself
* promoting someone outside guild
* demoting owner
* demoting yourself
* invalid role changes

---

# 15. OWNERSHIP TRANSFER

Add:

```text
/guild transfer 
```

Only OWNER can use it.

The target must be a guild member.

After transfer:

```text
old OWNER -> ADMIN
target ADMIN/MEMBER -> OWNER
```

Require confirmation.

---

# 16. GUILD DISBAND

Implement:

```text
/guild disband
```

Only OWNER.

Require confirmation:

```text
/guild disband confirm
```

Cleanly remove:

* guild data
* memberships
* alliances
* pending invitations
* pending alliance requests
* cached data

---

# 17. GUILD PvP

Implement:

```text
/guild pvp on
/guild pvp off
```

When OFF:

members of the same guild cannot damage one another.

When ON:

members can damage one another.

Persist the setting.

Do not interfere with unrelated PvP mechanics.

---

# 18. GUILD CALLout

Implement:

```text
/guild callout
```

When used:

* send configurable chat message to guild
* send configurable title
* send configurable subtitle
* play configurable sound

Example configuration:

```yaml
callout:
  enabled: true
  message: "&b&lGUILD CALLOUT &7» &f%player%"
  title: "&b&lGUILD CALLOUT"
  subtitle: "&fCalled by &b%player%"
  fade-in: 10
  stay: 40
  fade-out: 10
  sound: "BLOCK_NOTE_BLOCK_PLING"
  volume: 1.0
  pitch: 1.0
```

Support configurable:

* colors
* HEX
* gradients
* MiniMessage
* placeholders

---

# 19. ALLIANCE SYSTEM

Implement:

```text
/guild ally invite 
/guild ally accept 
/guild ally deny 
/guild ally unally 
/guild ally callout
/guild ally pvp on
/guild ally pvp off
```

---

## Ally Invite

```text
/guild ally invite 
```

Send an alliance request.

---

## Ally Accept

```text
/guild ally accept 
```

Accept request.

---

## Ally Deny

```text
/guild ally deny 
```

Reject request.

---

## Ally Unally

```text
/guild ally unally 
```

Remove alliance from both guilds.

Prevent:

* self-alliance
* duplicate alliance
* invalid guild
* duplicate requests

Add configurable alliance request expiry:

```yaml
alliances:
  request-expiry-seconds: 300
  max-allies: 10
```

---

# 20. ALLY PvP

Implement:

```text
/guild ally pvp on
/guild ally pvp off
```

Controls PvP between allied guilds.

Keep separate from normal guild PvP.

---

# 21. ALLY CALLOUT

Implement:

```text
/guild ally callout
```

Send to:

* player's guild
* every allied guild

Online members receive:

* chat
* title
* subtitle
* sound

Example:

```yaml
ally-callout:
  enabled: true
  message: "&d&lALLY CALLOUT &7» &f%player%"
  title: "&d&lALLY CALLOUT"
  subtitle: "&fCalled by &d%player%"
  fade-in: 10
  stay: 40
  fade-out: 10
  sound: "BLOCK_NOTE_BLOCK_PLING"
  volume: 1.0
  pitch: 1.0
```

---

# 22. GUILD CHAT

Implement:

```text
/guild chat
```

Guild chat messages are visible ONLY to members of the sender's guild.

Example:

```text
[GUILD] Player: Hello
```

Make format configurable.

---

# 23. ALLY CHAT

Implement:

```text
/guild allychat
```

Messages are visible ONLY to:

* sender's guild
* allied guilds

Members MUST be able to use this.

Example:

```text
[ALLY] Player: Enemy at spawn!
```

Make format configurable.

---

# 24. CHAT TOGGLE

`/guild chat` should optionally function as a toggle.

First use:

```text
/guild chat
```

enables guild-chat mode.

Normal chat messages then go to guild chat.

Using it again disables guild-chat mode.

Same for:

```text
/guild allychat
```

Players must always have a way to return to normal chat.

---

# 25. GUILD INFO

Implement:

```text
/guild info
/guild info 
```

Display:

* guild name
* guild tag
* owner
* admins
* members
* online members
* offline members
* member count
* online count
* points
* leaderboard position
* allies
* open/closed
* guild PvP
* ally PvP

Structure:

```text
Guild Information

Name: Frost PvP
Tag: FROST

Owner:
  Player

Admins:
  Admin1
  Admin2

Members:
  Member1
  Member2

Online:
  Player
  Admin1

Offline:
  Member1

Points: 125
Position: #4
Allies: 3
Status: Open
PvP: Disabled
```

Online names must be GREEN.

Offline names must be RED.

Everything configurable through `message.yml`.

---

# 26. GUILD LIST

Implement:

```text
/guild list
/guild list 
```

Maximum 10 guilds per page.

Display:

* name
* tag
* points
* members
* online count
* open/closed status

Example:

```text
/guild list 2
```

shows page 2.

Provide clickable previous/next navigation where supported.

---

# 27. GUILD TOP

Implement:

```text
/guild top
/guild top 
```

Leaderboard based on guild points.

10 guilds per page.

Example:

```text
#1 Frost - 250 Points
#2 Void - 201 Points
#3 Stray - 190 Points
```

At the bottom show:

```text
Your Guild: Example
Your Position: #7
Your Points: 124
```

Show the player's guild even if it isn't on the current page.

Use deterministic tie-breaking.

---

# 28. POINT SYSTEM

Default:

```yaml
points:
  kill: 1
  death: -1
```

Every guild member kill:

* add configured kill points to their guild

Every guild member death:

* add configured death value to their guild

Setting:

```text
kill: 0
```

disables kill point gain.

Setting:

```text
death: 0
```

disables death point loss.

Prevent duplicate point awards.

Handle negative points safely.

---

# 29. POINT HISTORY

Track point changes such as:

```text
+1 Kill
-1 Death
+50 Admin Adjustment
```

Keep the implementation efficient.

This can primarily be used for administration/debugging.

---

# 30. GUILD MEMBER LIMIT

Configuration:

```yaml
guild:
  max-members: 50
```

Prevent joins/invites when full.

Allow configured admin bypass if useful.

---

# 31. GUILD SEARCH

Add:

```text
/guild search 
```

Search guild names/tags.

Paginate results if necessary.

---

# 32. GUILD ADMIN

Create:

```text
/guildadmin
/gadmin
```

Permission:

```text
guild.admin
```

This system has full administrative control.

---

# 33. ADMIN RELOAD

```text
/guildadmin reload
```

Reload:

* config.yml
* message.yml
* other configurable files

No server restart required.

---

# 34. ADMIN SCORE

Implement:

```text
/guildadmin score set  
/guildadmin score add  
/guildadmin score remove  
```

Examples:

```text
/guildadmin score set 500 Frost
/guildadmin score add 50 Frost
/guildadmin score remove 25 Frost
```

---

# 35. ADMIN DISBAND

```text
/guildadmin disband 
```

Forcefully disband.

---

# 36. ADMIN ALLY

```text
/guildadmin ally  
```

Forcefully ally two guilds.

---

# 37. ADMIN INVITE

```text
/guildadmin invite  
```

Forcefully create guild invitation.

---

# 38. ADMIN PROMOTE

```text
/guildadmin promote  
```

Promote player if they are a member of the specified guild.

Reject if they are not in that guild.

---

# 39. ADDITIONAL ADMIN COMMANDS

Add:

```text
/guildadmin info 
/guildadmin list
/guildadmin kick  
/guildadmin transfer  
/guildadmin removeally  
```

Only implement logically useful commands.

---

# 40. LUCKPERMS / BUKKIT PERMISSIONS

Use standard Bukkit/Paper permission nodes compatible with LuckPerms.

Provide:

```text
guild.use
guild.create
guild.name
guild.tag
guild.info
guild.invite
guild.join
guild.leave
guild.kick
guild.chat
guild.allychat
guild.callout
guild.ally
guild.ally.callout
guild.ally.pvp
guild.pvp
guild.open
guild.close
guild.promote
guild.demote
guild.transfer
guild.disband
guild.list
guild.top
guild.search
guild.admin
```

Permissions must actually be checked.

Internal guild role checks must also apply.

---

# 41. PLACEHOLDERAPI

If PlaceholderAPI is present or can safely be integrated, provide:

```text
%guild_name%
%guild_tag%
%guild_points%
%guild_position%
%guild_members%
%guild_online%
%guild_owner%
%guild_role%
%guild_allies%
%guild_pvp%
%guild_ally_pvp%
%guild_open%
```

`%guild_name%` must return the actual guild name.

`%guild_tag%` must return the formatted guild tag in the most compatible representation possible.

Do not confuse them.

---

# 42. MESSAGE.YML

Generate:

```text
message.yml
```

automatically if missing.

ALL player-facing messages should be customizable.

Include messages for:

* creation
* name change
* tag change
* invite
* join
* leave
* kick
* promote
* demote
* transfer
* disband
* open
* close
* PvP
* callout
* ally callout
* ally invite
* ally accept
* ally deny
* unally
* ally PvP
* guild chat
* ally chat
* info
* list
* top
* search
* points
* permissions
* invalid arguments
* invalid guild
* invalid player
* guild full
* invitation expired
* alliance request expired
* reload
* admin commands
* confirmation prompts
* invalid formatting
* disabled formatting

Messages must support the plugin's formatting system.

---

# 43. CONFIG.YML

Create a clean configuration containing at least:

```yaml
guild:
  min-name-length: 3
  max-name-length: 16
  max-members: 50
  default-tag:
    mode: first-3-characters

guild-name:
  allow-colors: false
  allow-gradients: false
  allow-hex: false

guild-tag:
  enabled: true
  min-length: 1
  max-length: 32

  formatting:
    minimessage: true
    legacy-colors: true
    section-sign: true
    hex: true
    gradients: true
    rainbow: true
    formatting-codes: true

invitations:
  expiry-seconds: 300

alliances:
  request-expiry-seconds: 300
  max-allies: 10

points:
  kill: 1
  death: -1

callout:
  enabled: true
  message: "&b&lGUILD CALLOUT &7» &f%player%"
  title: "&b&lGUILD CALLOUT"
  subtitle: "&fCalled by &b%player%"
  fade-in: 10
  stay: 40
  fade-out: 10
  sound: "BLOCK_NOTE_BLOCK_PLING"
  volume: 1.0
  pitch: 1.0

ally-callout:
  enabled: true
  message: "&d&lALLY CALLOUT &7» &f%player%"
  title: "&d&lALLY CALLOUT"
  subtitle: "&fCalled by &d%player%"
  fade-in: 10
  stay: 40
  fade-out: 10
  sound: "BLOCK_NOTE_BLOCK_PLING"
  volume: 1.0
  pitch: 1.0
```

Adapt configuration to the actual project.

Do not overwrite existing configuration unnecessarily.

---

# 44. TAB COMPLETION

Provide polished tab completion.

Examples:

```text
/guild 
```

shows valid commands.

```text
/guild join 
```

shows open guilds where appropriate.

```text
/guild ally invite 
```

shows valid guilds.

```text
/guild promote 
```

shows eligible guild members.

```text
/guild invite 
```

shows appropriate players.

Admin commands must also have proper tab completion.

Do not expose invalid suggestions.

---

# 45. CLICKABLE CHAT

Where useful, implement clickable chat components for:

* guild invitation accept/deny
* alliance accept/deny
* leaderboard navigation
* guild list navigation
* confirmation prompts

Use safe commands.

Do not make GUIs necessary for basic functionality.

---

# 46. AUDIT LOGGING

Log important administrative/guild events:

```text
Guild created
Guild renamed
Guild tag changed
Guild disbanded
Member invited
Member joined
Member kicked
Member promoted
Member demoted
Ownership transferred
Alliance created
Alliance removed
Points manually changed
Guild settings changed
```

Use the plugin logger.

Do not spam the console with normal guild chat.

---

# 47. EDGE CASES

Handle:

* player disconnecting during invitations
* expired invitations
* expired alliance requests
* player already belonging to a guild
* player joining another guild
* guild owner leaving
* guild owner transferring ownership
* guild being disbanded while allied
* guild being disbanded with pending invitations
* player being kicked
* duplicate guild names
* case-insensitive names
* malformed tags
* malformed configuration
* missing config files
* missing message.yml
* missing PlaceholderAPI
* missing LuckPerms
* unsupported sounds
* server restart
* plugin reload
* corrupted data
* guild member limit
* negative points
* duplicate kill/death events

Never crash the server because of guild data or configuration.

---

# 48. PERFORMANCE

This plugin is intended for a serious Minecraft PvP server.

Avoid:

* database queries every tick
* unnecessary disk writes
* scanning every player repeatedly
* expensive repeating tasks
* memory leaks
* unnecessary synchronous operations
* duplicate event listeners

Guild callouts should only iterate relevant players.

Guild chat should only send to relevant players.

Leaderboards should be efficient.

Cache appropriate data where useful.

---

# 49. GUILD DISPLAY

Expose guild information for use throughout the plugin.

Where appropriate, guild associations can appear as:

```text
[FROST] Player
```

or:

```text
[] Player
```

Do not automatically modify global server chat formatting unless the existing plugin already controls chat formatting.

Use placeholders/components so other systems can consume guild information.

---

# 50. COMMAND SUMMARY

The final command structure should include at least:

```text
/guild create 

/guild name 

/guild tag 

/guild invite 

/guild join 

/guild leave

/guild kick 

/guild promote 

/guild demote 

/guild transfer 

/guild disband

/guild open
/guild close

/guild pvp 

/guild callout

/guild chat
/guild allychat

/guild info [guild]

/guild list [page]

/guild top [page]

/guild search 

/guild ally invite 
/guild ally accept 
/guild ally deny 
/guild ally unally 
/guild ally callout
/guild ally pvp 

/guildadmin reload
/guildadmin score   
/guildadmin disband 
/guildadmin ally  
/guildadmin invite  
/guildadmin promote  
/guildadmin info 
/guildadmin list
/guildadmin kick  
/guildadmin transfer  
/guildadmin removeally  
```

`/g` is an alias of `/guild`.

`/gadmin` is an alias of `/guildadmin`.

---

# 51. IMPORTANT GUILD NAME/TAG DISTINCTION

This is mandatory.

For example:

```text
/guild create FrostPvP
```

creates:

```text
Name: FrostPvP
Tag: FRO
```

Then:

```text
/guild name Frost
```

changes:

```text
Name: Frost
Tag: FRO
```

Then:

```text
/guild tag FROST
```

changes:

```text
Name: Frost
Tag: formatted FROST
```

Changing the name must NOT automatically modify the tag.

Changing the tag must NOT modify the name.

Both are separate persistent values.

---

# 52. UNIVERSAL TAG EXAMPLES

These MUST be supported where their corresponding formatting systems are enabled:

```text
FROST
```

```text
&b&lFROST
```

```text
§b§lFROST
```

```text
�D9FFFROST
```

```text
&#FB0000F&#FB1414r&#FC2727o&#FC3B3Bs&#FC4E4Et
```

```text
<#00D9FF>FROST
```

```text
FROST
```

```text
FROST
```

```text
FROST
```

```text
&l�D9FFFrost PvP
```

The user should NOT need to register any individual color in configuration.

Any valid color supported by the enabled formatting system should work.

---

# 53. NO COLOR WHITELIST

DO NOT implement:

```java
allowedColors = Arrays.asList(
    "red",
    "blue",
    "green"
);
```

DO NOT implement a fixed HEX list.

DO NOT require:

```yaml
allowed-colors:
```

The configuration should control **formatting categories**, not individual colors.

If HEX is enabled:

ALL valid HEX colors are accepted.

If MiniMessage is enabled:

ALL valid/safe MiniMessage formatting supported by the implementation is accepted.

If legacy colors are enabled:

ALL valid legacy colors are accepted.

---

# 54. PRODUCTION QUALITY

Do not create fake/stub functionality.

Do not leave commands as:

```java
// TODO
```

or:

```java
return null;
```

or:

```text
Coming soon
```

Every listed feature must have actual functionality.

Do not unnecessarily rewrite unrelated code.

Do not duplicate existing systems.

Use clean architecture with appropriate managers/services such as:

```text
GuildManager
GuildStorage
GuildCommand
GuildAdminCommand
GuildListener
GuildChatManager
GuildAllianceManager
GuildPointManager
GuildPlaceholderExpansion
GuildConfigManager
```

Use equivalent architecture if the project already has an established structure.

---

# 55. IMPLEMENTATION ORDER

Implement in this order to keep the plugin stable:

## Phase 1 — Core

* guild data
* persistence
* guild creation
* guild name
* guild tag
* join
* leave

## Phase 2 — Members/Roles

* owner
* admin
* member
* invite
* kick
* promote
* demote
* transfer
* disband

## Phase 3 — Guild Controls

* open/close
* guild PvP
* guild chat
* ally chat
* member limits

## Phase 4 — Alliances

* ally invite
* accept
* deny
* unally
* ally PvP
* ally callout

## Phase 5 — Callouts

* guild callout
* titles
* subtitles
* sounds
* formatting
* placeholders

## Phase 6 — Points

* kill points
* death points
* point history
* leaderboard
* list

## Phase 7 — Formatting

* MiniMessage
* arbitrary HEX
* `&#RRGGBB`
* `&` codes
* `§` codes
* gradients
* rainbow
* per-character colors
* mixed formatting

## Phase 8 — Administration

* `/guildadmin`
* score
* force disband
* force ally
* force invite
* force promote
* admin utilities

## Phase 9 — Integration

* LuckPerms/Bukkit permissions
* PlaceholderAPI
* tab completion
* clickable chat

## Phase 10 — Polish

* search
* confirmations
* audit logs
* optimization
* edge cases
* final testing

---

# 56. FINAL TESTING REQUIREMENTS

Before considering the plugin complete, verify:

### Guilds

* create
* rename
* tag
* join
* leave
* kick
* promote
* demote
* transfer
* disband

### Alliances

* invite
* accept
* deny
* unally
* ally PvP
* ally callout

### PvP

* guild PvP
* ally PvP
* normal PvP

### Communication

* guild chat
* ally chat
* chat toggles
* callout
* ally callout

### Points

* kills
* deaths
* zero-value disabling
* admin modifications
* leaderboard
* ranking
* history

### Formatting

Test:

```text
&b&lFROST
```

```text
§b§lFROST
```

```text
&#FB0000FROST
```

```text
&#FB0000F&#FB1414r&#FC2727o&#FC3B3Bs&#FC4E4Et
```

```text
FROST
```

```text
FROST
```

### Permissions

Verify members cannot perform owner/admin actions.

Verify LuckPerms/Bukkit permission nodes work.

### Persistence

Restart the server and verify guild data remains intact.

### Reload

Run:

```text
/guildadmin reload
```

and verify configuration changes are applied without losing guild data.

---

# FINAL OBJECTIVE

The finished plugin should feel like a **high-quality competitive PvP server Guild/Clan system**.

It should combine:

* BetterTeams-style guild management
* Stray-style competitive clan functionality
* guild points
* leaderboards
* alliances
* ally communication
* callouts
* guild PvP controls
* customizable guild names
* highly customizable guild tags
* universal Minecraft text formatting
* LuckPerms permissions
* PlaceholderAPI
* complete staff administration
* persistent data
* optimized performance
* polished command UX

The Guild Tag system is especially important:

**Users must be able to use arbitrary HEX, RGB, gradients, MiniMessage, legacy `&` codes, `§` codes, and per-character HEX formatting without having to whitelist individual colors.**

For example, this exact tag must work:

```text
&#FB0000M&#FB1414i&#FC2727n&#FC3B3Be&#FC4E4Ec&#FD6262r&#FD7676a&#FD8989f&#FD9D9Dt&#FEB1B1.&#FEC4C4M&#FED8D8e&#FFEBEBn&#FFFFFFu
```

as well as:

```text
FROST
```

and:

```text
&b&lFROST
```

and:

```text
§b§lFROST
```

All should be supported by the same Guild Tag system.

**Do not restrict colors. Do not create a color whitelist. Do not simplify formatted tags into plain text. Preserve the original formatting and render it correctly.**

Build the plugin as a complete, stable, production-ready implementation rather than a collection of command stubs.
Kodari AI
KodariAug 16 at 8:14 am 3
GuildMaster
A comprehensive guild management plugin for competitive PvP servers. Features full guild lifecycle management including creation, naming, tagging, roles, invites, alliances, points, and leaderboards. Supports universal tag formatting with MiniMessage, arbitrary HEX, legacy codes, gradients, and per-character colors without color whitelists. Includes guild and ally chat, callouts with titles and sounds, PvP controls, PlaceholderAPI integration, and complete admin commands with tab completion and clickable chat components.
  1. Core model and YAML persistence with reload-safe guild, membership, invitation, alliance, and point data.

  2. Guild services for roles, PvP, chat modes, alliances, callouts, rankings, and administration.

  3. /guild and /guildadmin commands with permissions and tab completion.

  4. Universal tag/message formatting, events, PlaceholderAPI integration, configuration, and plugin metadata.

Implemented the new KodariGuilds project with:

  • Persistent YAML guild storage.

  • Guild creation, renaming, tags, membership, roles, invitations, ownership transfer, disbanding, and member management.

  • Open/closed guilds and guild/ally PvP controls.

  • Guild chat and ally chat toggles.

  • Guild and ally callouts with configurable titles, sounds, and formatting.

  • Alliance invitations, acceptance, denial, and removal.

  • Points, point history, rankings, guild lists, search, and admin score controls.

  • /guild and /guildadmin commands with aliases and tab completion.

  • Bukkit permissions and PlaceholderAPI placeholders.

  • Configurable config.yml and message.yml.

  • MiniMessage, legacy color, section-sign, HEX, gradient, rainbow, and formatting support.

  • PvP protection and kill/death point events.

  • Audit logging for major guild operations.

SpiritKnwtdaygvxz

Even After creating the Guild. it says You are not in any guild. and make sure the guild points, members, all the data are saved in a yml file.

Kodari AI
KodariAug 16 at 8:27 am 1
  1. Fix the post-creation guild lookup so the creator is recognized as a guild member.

  2. Add YAML persistence for guilds, points, members, and related guild data, including load/save lifecycle integration.

The membership index is corrected. Guild data is already stored in guilds.yml; I’m tightening persistence so the owner is always restored as a member and the YAML file is safely created before saving.

  1. Fixed the guild lookup bug in GuildManager: players are now resolved through the membership map, so creators are recognized immediately after /guild create.

  2. Strengthened YAML persistence in GuildStorage:

    • Guilds, owners, admins, members, points, point history, PvP settings, allies, and timestamps are saved to guilds.yml.

    • Guild owners are automatically restored as members when loading.

    • The plugin data directory is created before saving.

  3. Data continues to load on startup and save after guild changes and on plugin shutdown.

Guild data is stored at:

Plain Text
plugins/<YourPluginName>/guilds.yml
SpiritKnwtdaygvxz

Improve the Guild help message. or the message when typed /guild. Give a better Teams Type Feeling.

Kodari AI
KodariAug 16 at 8:30 am 1
  1. Replace the plain command list with a team-themed help panel.

  2. Organize commands into setup, team management, guild discovery, communication, and alliance sections with clearer usage examples.

Updated /guild with a team-focused help panel featuring:

  • Guild Command Center header

  • Getting Started commands

  • Team Management commands

  • Guild Network and leaderboard commands

  • Team communication commands

  • Alliance management commands

  • Clear descriptions and usage examples

  • Team-themed colors, separators, and tips

SpiritKnwtdaygvxz

Make the Tag defaultly be the color cyan and the full name like Whatever the user made the name. they can edit the tag using /guild tag later to whatever they want. gradiants, etc

Kodari AI
KodariAug 16 at 8:31 am 1
  • Set new guild tags to the complete guild name with a cyan default color.

  • Keep the guild name and tag as separate persisted values.

  • Preserve /guild tag as the later customization path, including gradients and other enabled formatting.

  1. New guilds now use the complete guild name as their default tag with cyan formatting (&b).

  2. Guild names can now contain spaces when creating or renaming:

    • /guild create The Avengers

    • /guild name The New Avengers

  3. /guild tag now supports multi-word tags and gradients:

    • /guild tag <gradient:#00ffff:#0080ff>The Avengers</gradient>

  4. The full guild name remains stored separately from the tag, so editing the tag will not rename the guild.

  5. The default color can be configured in config.yml:

YAML
guild:
  default-tag:
    color: '&b'
SpiritKnwtdaygvxz

I want it so the guild callout thing, its like /g callout <message> where in the sub title it says the message input. and in chat too it shows like "<username of the user who used callout> : Message

and when callout, a sound is played which is customizable in the config, and the Messages itself customizable. and same for ally callout, except when showing it chat it shows like [Guild of the member who called out] <username> : Message.

Kodari AI
KodariAug 16 at 8:39 am 1
  1. Trace the existing guild/ally command, messaging, title, and sound systems.

  2. Add configurable guild and ally callouts with subtitles, chat formatting, and sounds.

  3. Register the commands and preserve the existing guild/ally permission and membership rules.

Implemented guild and ally callouts with message input.

Commands

Plain Text
/g callout <message>
/g ally callout <message>

Behavior

  • The message appears in the title subtitle.

  • Guild callout chat format:

Plain Text
[GuildName] Username : Message
  • Ally callout chat format:

Plain Text
[GuildName] Username : Message

The guild name is the guild of the player who sent the callout.

  • Guild callouts reach guild members.

  • Ally callouts reach the caller’s guild and all allied guilds.

  • Configurable sound, volume, pitch, title, subtitle, and chat message are supported.

  • %player%, %guild%, and %message% placeholders are available.

Example configuration:

YAML
callout:
  enabled: true
  message: '&8[&b%guild%&8] &f%player% &7: &f%message%'
  title: '&b&lGUILD CALLOUT'
  subtitle: '&f%message%'
  sound: BLOCK_NOTE_BLOCK_PLING
  volume: 1.0
  pitch: 1.0

ally-callout:
  enabled: true
  message: '&8[&d%guild%&8] &f%player% &7: &f%message%'
  title: '&d&lALLY CALLOUT'
  subtitle: '&f%message%'
  sound: BLOCK_NOTE_BLOCK_PLING
  volume: 1.0
  pitch: 1.0
SpiritKnwtdaygvxz

Add a 3 second cooldown to all callouts.

Kodari AI
KodariAug 16 at 8:41 am 1

[Generation stopped]

SpiritKnwtdaygvxz

add a 3 second cooldown to all callouts, and Make the cooldown customizable too

Kodari AI
KodariAug 16 at 8:42 am 1
  1. Add a per-player cooldown to guild and ally callouts.

  2. Make the cooldown duration configurable in config.yml, with a default of 3 seconds and a configurable feedback message.

Added a customizable 3-second cooldown to all guild and ally callouts.

Configuration:

YAML
callout:
  enabled: true
  cooldown-seconds: 3
  cooldown-message: '&cPlease wait %remaining%s before using another callout.'

Behavior:

  • Applies to /guild callout <message>.

  • Applies to /guild ally callout <message>.

  • Cooldown is tracked separately for each player.

  • %remaining% and %seconds% can be used in the cooldown message.

  • Set cooldown-seconds: 0 to disable the cooldown.

SpiritKnwtdaygvxz

add a placeholders.yml too where all the placeholders are stored, and comment out what placeholder like %placeholder_name% like that for each of them. and the Default Placeholders of The plugin, like when a user is in no Guild. i want two place holders. one for the username and one for the Scoreboard because in scoreboard i want to show 'No Guild' but in the nametag i want it to be empty if not in any guid

Kodari AI
KodariAug 16 at 8:45 am 1
  1. Map the existing placeholder integration and every placeholder currently exposed.

  2. Add a documented placeholders.yml with configurable no-guild username and scoreboard values.

  3. Wire the defaults into the plugin’s placeholder expansion while keeping nametags empty and scoreboards as No Guild when applicable.

  • Add placeholders.yml as the central documented placeholder reference and fallback configuration.

  • Load/reload it from GuildPlugin.

  • Expose %guild_username% for nametags (guild tag, empty without a guild) and %guild_scoreboard% for scoreboards (guild name, No Guild without a guild), while retaining existing placeholders.

Added placeholders.yml with documented plugin and PlaceholderAPI placeholders.

New placeholders:

Plain Text
%guild_username%
%guild_scoreboard%

Behavior when the player is in a guild:

  • %guild_username% → formatted guild tag

  • %guild_scoreboard% → guild name

Behavior when the player has no guild:

  • %guild_username% → empty

  • %guild_scoreboard% → No Guild

The defaults are configurable in placeholders.yml:

YAML
no-guild:
  username: ''
  scoreboard: 'No Guild'

The file is automatically created on first startup and reloaded through the plugin reload process.

SpiritKnwtdaygvxz

Rename the plugin from Kodari Guilds to KnightGuilds and make it so the prefix is also KnightGuilds in Messages, and make the color theme of the messages purple

Kodari AI
KodariAug 16 at 10:32 am 2

I’ll update the plugin metadata, user-facing prefix, and message color defaults without changing command behavior.

  1. Rename the plugin display name to KnightGuilds.

  2. Change the message prefix and primary UI colors from cyan to purple.

  3. Update direct command/help and callout/chat fallback messages so the purple theme is consistent.

  • Renamed the plugin display name to KnightGuilds.

  • Updated the plugin author and PlaceholderAPI expansion author to KnightGuilds.

  • Changed the message prefix to:

Plain Text
[KnightGuilds]
  • Changed message, help, guild info, admin info, chat, and callout accents to purple.

  • Updated guild and ally callouts to use purple titles and chat prefixes.

  • Preserved configurable message values in message.yml and config.yml.

SpiritKnwtdaygvxz

The Gradiant somehow dosnt work. Whatever i try. i tried doing &#acefc4&lG&#b4e1c9&le&#bcd2cf&ln&#c4c4d4&le&#cdb6da&ls&#d5a8df&li&#dd99e5&ls&#e58bea&lA&lS and also minimessage format like <b><gradient:#ACEFC4:#E58BEA>Genesis</gradient><gradient:#E58BEA:#E58BEA>AS</gradient></b> too but none of them works. it shows "that guild tag is invalid or uses and disabled format

Kodari AI
KodariAug 16 at 11:59 am 1
  1. Validate the visible tag text instead of counting MiniMessage/hex markup toward the 32-character limit.

  2. Keep gradient, hex, legacy color, and formatting validation intact so enabled formats are accepted and disabled formats remain blocked.

Fixed guild tag validation so gradients and hex colors work correctly.

The issue was that formatting markup counted toward the 32-character limit. For example, the visible text GenesisAS was rejected because the MiniMessage and hex formatting made the raw input much longer.

Now:

  • /guild tag <gradient:#ACEFC4:#E58BEA>GenesisAS</gradient> works.

  • Hex formatting such as &#acefc4&lG&#b4e1c9&le... works.

  • Tag length is measured using the visible text only.

  • Configured formatting restrictions still apply.

  • Gradients remain enabled through:

YAML
guild-tag:
  formatting:
    gradients: true
    hex: true
    minimessage: true
SpiritKnwtdaygvxz

Not working

Kodari AI
KodariAug 16 at 12:10 pm 1

The failure is in the tag parser/validator path, not the command syntax. I’m checking the exact stored/display pipeline and will make both hex-legacy and MiniMessage gradient formats normalize safely before validation and rendering.

The current visible-text cleanup is still relying on MiniMessage’s tag stripper, which can leave markup counted as tag text in this validation path. I’m replacing that with deterministic stripping and adding explicit MiniMessage-format handling, while keeping the renderer’s gradient support.

Fixed the gradient handling.

The issue was that:

  • &#abcdef hex colors were converted to an invalid MiniMessage tag.

  • <b> formatting was not normalized to MiniMessage’s <bold>.

  • MiniMessage tags could still interfere with visible-length validation.

These formats should now work:

Plain Text
/guild tag <gradient:#ACEFC4:#E58BEA>GenesisAS</gradient>
Plain Text
/guild tag <b><gradient:#ACEFC4:#E58BEA>Genesis</gradient><gradient:#E58BEA:#E58BEA>AS</gradient></b>
Plain Text
/guild tag &#acefc4&lG&#b4e1c9&le&#bcd2cf&ln&#c4c4d4&le&#cdb6da&ls&#d5a8df&li&#dd99e5&ls&#e58bea&lA&lS

The visible tag length is now calculated without formatting markup, and MiniMessage aliases such as <b>, <i>, <u>, and <s> are supported.

SpiritKnwtdaygvxz

When doing /guild info. The offline members are shown as some random strings. fix that

Kodari AI
KodariSep 7 at 7:34 am 1
  1. Trace the /guild info member-list rendering for online and offline members.

  2. Replace offline UUID/string fallbacks with stored player names, preserving live names for online members.

Fixed /guild info so offline members now display their saved Minecraft username instead of a UUID fragment. If no name is available, it shows Unknown.

SpiritKnwtdaygvxz

Add Support for Leaderboards feature like so i can use it with ajlb type plugins When i tried to add it using the placeholder the error was

The placeholder 'guild_position' does not give a numerical value. Make sure that the placeholder returns a number that is not formatted.

same for guild_points

Kodari AI
KodariSep 19 at 10:54 am 1
  1. Inspect the existing PlaceholderAPI expansion and guild scoring data.

  2. Add raw numeric %guild_position% and %guild_points% values suitable for leaderboard plugins.

  3. Document the new placeholders and ensure they never include color codes or other formatting.

[Generation stopped]

SpiritKnwtdaygvxz

Not Position, Position returns number. its fine. I want you to make something like

%guild_position_name% so it shows the name of the Clan in that position.

&71. &a%betterteams_position_name_1% &8- &a%betterteams_position_score_1%' '&72. &a%betterteams_position_name_2% &8- &a%betterteams_position_score_2%' '&73. &a%betterteams_position_name_3% &8- &a%betterteams_position_score_3%' '&74. &a%betterteams_position_name_4% &8- &a%betterteams_position_score_4%' '&75. &a%betterteams_position_name_5% &8- &a%betterteams_position_score_5%' '&76. &a%betterteams_position_name_6% &8- &a%betterteams_position_score_6%' '&77. &a%betterteams_position_name_7% &8- &a%betterteams_position_score_7%' '&78. &a%betterteams_position_name_8% &8- &a%betterteams_position_score_8%' '&79. &a%betterteams_position_name_9% &8- &a%betterteams_position_score_9%' '&710. &a%betterteams_position_name_10% &8- &a%betterteams_position_score_10%' '&r'

so i can use it on a hologram for a leaderboard like this using the ajlb plugin

Kodari AI
KodariSep 19 at 10:59 am 1
  1. Add indexed leaderboard placeholders for guild names and scores.

  2. Use the existing ranking order and return plain, hologram-safe values for AJLB.

  3. Document the new placeholders in placeholders.yml.

Added indexed leaderboard placeholders for AJLB:

Plain Text
%guild_position_name_1%
%guild_position_score_1%

Replace 1 with any leaderboard position:

Plain Text
&71. &a%guild_position_name_1% &8- &a%guild_position_score_1%
&72. &a%guild_position_name_2% &8- &a%guild_position_score_2%
&73. &a%guild_position_name_3% &8- &a%guild_position_score_3%

Behavior:

  • Names use the existing guild ranking order.

  • Scores return raw numerical points without formatting.

  • Positions start at 1.

  • Empty string is returned when a position does not exist.

  • These placeholders work even when the requesting player is not in a guild.

  • Added documentation to placeholders.yml.

SpiritKnwtdaygvxz

No. AJLB adds the _1,_2 themselfs. They want that the placeholder returns a number thats not formatted

Kodari AI
KodariSep 19 at 11:03 am 1

The indexed placeholders were implemented in the wrong layer. I’ll keep the base placeholders AJLB registers (%guild_position_name% / %guild_position_score%), keep the numeric score unformatted, and return 0 for %guild_points% when the validation player has no guild so AJLB accepts it.

Fixed the AJLB integration.

Use these base placeholders in AJLB:

Plain Text
%guild_position_name%
%guild_position_score%

AJLB will append _1, _2, _3, etc. itself.

Behavior:

  • %guild_position_name_1% → name of the guild in position 1

  • %guild_position_score_1% → raw numeric score of the guild in position 1

  • %guild_position_score% → unformatted numeric score for AJLB validation

  • %guild_points% remains a raw number

  • %guild_position% remains unchanged

The previous documentation incorrectly suggested manually configuring %guild_position_name_1% and %guild_position_score_1%; that has been corrected.

SpiritKnwtdaygvxz

I am Stupid. It's actually going to be custom placeholders for each position, but make it so it is unlimited, so whatever number I add, like

"%guild_position_points_x%" shows me that position's value. Same for the names.

Kodari AI
KodariSep 19 at 11:09 am 1
  1. Add dynamic %guild_position_points_<number>% and %guild_position_name_<number>% placeholders.

  2. Resolve any positive leaderboard position without a hardcoded limit, returning raw numeric points for AJLB.

  3. Update the placeholder documentation and remove the misleading fixed-format guidance.

[Generation stopped]

SpiritKnwtdaygvxz

also add a option in config which lets us configure default prefix color. currently if i want to change the message colors i have to do each one manually

Kodari AI
KodariSep 19 at 11:11 am 1
  1. Add a configurable default message-prefix color.

  2. Apply it through the existing message formatting path so individual messages can still override their own colors.

  3. Add the setting to the config with a sensible default.

Added a configurable default message color.

In config.yml:

YAML
messages:
  default-prefix-color: '&5'

Change it to any legacy color, for example:

YAML
messages:
  default-prefix-color: '&a'

All default &5 message colors and the prefix will use the configured color automatically. Individual colors such as &c, &f, and &7 remain unchanged. Reload with:

Plain Text
/guild reload
SpiritKnwtdaygvxz

and the Leaderboards?

Kodari AI
KodariSep 19 at 11:14 am 1
  1. Add unlimited %guild_position_name_<number>% and %guild_position_points_<number>% resolution.

  2. Keep points as a plain numeric string for AJLB and preserve the existing score aliases for compatibility.

  3. Update the placeholder documentation to show the correct per-position format.

Added the leaderboard placeholders you need:

Plain Text
%guild_position_name_1%
%guild_position_points_1%

Use any position number:

Plain Text
%guild_position_name_10%
%guild_position_points_10%
  • guild_position_name_<number> returns the guild name.

  • guild_position_points_<number> returns unformatted numeric points.

  • %guild_position_score_<number>% remains supported as an alias.

  • There is no hardcoded position limit; any valid rank is supported.

SpiritKnwtdaygvxz

No its our own placeholder we dont need AJLB so you can also add options in config to edit how the placeholder looks. like Colors. Etc

Kodari AI
KodariSep 19 at 11:15 am 1
  1. Inspect the current leaderboard placeholder implementation and guild ranking flow.

  2. Add unlimited position-based placeholders owned by this plugin.

  3. Add configurable leaderboard line formatting/colors and document the settings.

The position placeholders already support any numeric suffix; I’m adding configurable formats for their returned values, including a configurable empty-position value.

Added configurable leaderboard placeholders.

Use:

Plain Text
%guild_position_name_1%
%guild_position_points_1%
%guild_position_name_10%
%guild_position_points_10%

Any position number is supported.

Added to config.yml:

YAML
leaderboards:
  name-format: '&a%name%'
  points-format: '&e%points%'
  empty-value: '&7-'

Available format variables:

  • name-format: %name% or %value%

  • points-format: %points% or %value%

  • empty-value: used when the requested position does not exist

For example:

YAML
leaderboards:
  name-format: '&b&l%name%'
  points-format: '&6%points% &7points'
  empty-value: '&8None'

The existing %guild_position_score_<number>% alias remains supported.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
22 1,290
src/main/java/com/kodari/guilds/GuildPlugin.java
package com.kodari.guilds;

import com.kodari.guilds.command.GuildAdminCommand;
import com.kodari.guilds.command.GuildCommand;
import com.kodari.guilds.listener.GuildListener;
import com.kodari.guilds.service.GuildManager;
import com.kodari.guilds.service.MessageService;
import com.kodari.guilds.integration.GuildExpansion;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public class GuildPlugin extends JavaPlugin {
    private GuildManager guildManager;
    private MessageService messageService;
    private YamlConfiguration messages;
    private YamlConfiguration placeholders;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("message.yml", false);
        saveResource("placeholders.yml", false);
        reloadMessages();
        reloadPlaceholders();
        guildManager = new GuildManager(this);
        messageService = new MessageService(this);
        GuildCommand guildCommand = new GuildCommand(this);
        GuildAdminCommand adminCommand = new GuildAdminCommand(this);
        getCommand("guild").setExecutor(guildCommand);
        getCommand("guild").setTabCompleter(guildCommand);
        getCommand("guildadmin").setExecutor(adminCommand);
        getCommand("guildadmin").setTabCompleter(adminCommand);
        getServer().getPluginManager().registerEvents(new GuildListener(this), this);
        if (getServer().getPluginManager().isPluginEnabled("PlaceholderAPI")) new GuildExpansion(this).register();
    }

    @Override
    public void onDisable() { if (guildManager != null) guildManager.save(); }

    public void reloadPlugin() { reloadConfig(); reloadMessages(); reloadPlaceholders(); }
    public void reloadMessages() { messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "message.yml")); }
    public void reloadPlaceholders() { placeholders = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "placeholders.yml")); }
    public GuildManager getGuildManager() { return guildManager; }
    public MessageService messages() { return messageService; }
    public YamlConfiguration getMessages() { return messages; }
    public YamlConfiguration getPlaceholders() { return placeholders; }
}