How to Create an AFK Zone on Your Minecraft Server (GetAfkZone)

Jak zrobić strefę AFK na serwerze Minecraft (getafkzone) How to Create an AFK Zone on Your Minecraft Server (getafkzone)

Ten poradnik pokazuje, jak zainstalować wtyczkę getafkzone i skonfigurować działającą strefę AFK z nagrodami, paskiem bossbar oraz szansami zależnymi od rangi.

This guide shows you how to install the getafkzone plugin and set up a working AFK zone with rewards, a bossbar, and rank-based chances.

Strefa AFK na serwerze Minecraft – getafkzone (PL) AFK Zone on Minecraft server – getafkzone (EN)
Ważne Pobieraj wtyczki wyłącznie z zaufanych źródeł. Nie używaj losowych mirrorów — mogą zawierać malware. Oficjalna strona: SpigotMC.

Instalacja wtyczki

  1. Pobierz najnowszą wersję z SpigotMC.
  2. Otwórz folder główny serwera i wrzuć plik .jar do /plugins.
  3. Zrestartuj serwer. Sprawdź konsolę lub użyj /plugins, aby potwierdzić załadowanie.

Utwórz strefę AFK

  1. Zaznacz dwa rogi drewnianym patykiem po uruchomieniu:
/azone selector
  1. Utwórz region AFK (zastąp <name> własną nazwą):
/azone create <name>
  1. Przeładuj wtyczkę:
/azone reload

Twoja strefa AFK powinna teraz działać na ustawieniach domyślnych.


Przykładowa konfiguracja

# plugins/getafkzone/config.yml (fragment)
afk:
  test:
    first:
      ==: org.bukkit.Location
      world: world
      x: 329.0
      y: 206.0
      z: -92.0
      pitch: 0.0
      yaw: 0.0
    second:
      ==: org.bukkit.Location
      world: world
      x: 338.0
      y: 209.0
      z: -82.0
      pitch: 0.0
      yaw: 0.0
    reward:
      commands:
      - say {player} test!
      permissions:
        '1': { permission: afk.vip, chance: 50 }
    time: 600
    p-color: GREEN
    p-style: SOLID
    bar-name: '&a✦ &7| &fNagroda za: &a{time} &8(&a{percent}%&8) &7| &fszansa: &7{chance}'

Konfiguracja nagród (komendy)

Zastąp przykładową komendę własnymi. Użyj placeholdera {player} w miejscu nicku gracza:

commands:
 - give {player} diamond 1
 - eco give {player} 250
Wskazówka Przetestuj komendy ręcznie w konsoli, zanim dodasz je do configu.

Bossbar — kolor, styl i nazwa

p-color ustawia kolor (np. GREEN), p-style styl (np. SOLID), a bar-name to tekst. Dostępne placeholdery:

  • {time} — pozostały czas do nagrody,
  • {percent} — procent postępu,
  • {chance} — szansa pobrana z warstwy permisji.
p-color: GREEN
p-style: SOLID
bar-name: '&a✦ &7| &fNagroda za: &a{time} &8(&a{percent}%&8) &7| &fszansa: &7{chance}'

Szanse według permisji (VIP/SVIP/MVIP)

Wyższe rangi mogą mieć lepsze szanse. Przykład: VIP 10%, SVIP 30%, MVIP 50%.

permissions:
 '1': { permission: afk.vip, chance: 10 }
 '2': { permission: afk.svip, chance: 30 }
 '3': { permission: afk.mvip, chance: 50 }

Jeśli gracz ma wiele z tych permisji, wtyczka zwykle wybierze najbardziej odpowiednią/najwyższą. Utrzymuj unikalne rangi, aby uniknąć niejasności.


Przełączniki globalne

Możesz wyłączyć elementy wizualne dla wszystkich, ustawiając je na false:

boss-bar: true
title: true
actionbar: true

Format czasu dla {time}

Steruj etykietami jednostek i kolejnością wyświetlania:

sec: ' {sec}s'
min: ' {min}m'
hour: ' {hour}h'
day: '{day}d'

format: "{d}{h}{m}{s}"

Przykład: ustawienie format: "{d}{h}{m}" pokaże 1d 1h 1m.


Pasek postępu w actionbarze

Dostosuj znak, długość i kolory paska postępu:

styles:
  char: "I"
  size: 100
  no-active: "&7"
  active: "&a"

Spróbuj kwadratu lub kropki dla char i dopasuj size do 10/20/50 itd.


Rozwiązywanie problemów

Wtyczka się nie włączyła

  • Po restarcie sprawdź błędy w konsoli startowej.
  • Upewnij się, że plik .jar jest w /plugins i nie jest uszkodzony.
  • Zweryfikuj zgodność wersji serwera (Paper/Spigot) z wersją wtyczki.

Strefa AFK nie działa po utworzeniu

  • Sprawdź, czy poprawnie zaznaczyłeś dwa rogi (/azone selector → patyk → PPM/LPM).
  • Uruchom /azone create <name>, a następnie /azone reload.
  • Upewnij się, że gracz faktycznie stoi wewnątrz zdefiniowanego prostopadłościanu.

Important Only download plugins from trusted sources. Do not use random mirrors — they may contain malware. Official page: SpigotMC.

Install the Plugin

  1. Download the latest version from SpigotMC.
  2. Open your server’s root folder and drop the .jar into /plugins.
  3. Restart the server. Check the console or run /plugins to confirm it loaded.

Create an AFK Zone

  1. Select two corners with a wooden stick after running:
/azone selector
  1. Create the AFK region (replace <name> with your own):
/azone create <name>
  1. Reload the plugin:
/azone reload

Your AFK zone should now be active with default settings.


Example Configuration

# plugins/getafkzone/config.yml (excerpt)
afk:
  test:
    first:
      ==: org.bukkit.Location
      world: world
      x: 329.0
      y: 206.0
      z: -92.0
      pitch: 0.0
      yaw: 0.0
    second:
      ==: org.bukkit.Location
      world: world
      x: 338.0
      y: 209.0
      z: -82.0
      pitch: 0.0
      yaw: 0.0
    reward:
      commands:
      - say {player} test!
      permissions:
        '1': { permission: afk.vip, chance: 50 }
    time: 600
    p-color: GREEN
    p-style: SOLID
    bar-name: '&a✦ &7| &fYou get the basic reward in: &a{time} &8(&a{percent}%&8) &7| &fchance: &7{chance}'

Configure Rewards (commands)

Replace the sample command with your own. Use the {player} placeholder where the player name should be:

commands:
 - give {player} diamond 1
 - eco give {player} 250
Tip Test commands manually in console before adding them to the config.

Bossbar — color, style, and name

p-color controls color (e.g., GREEN), p-style is the style (e.g., SOLID), and bar-name is the text. Placeholders:

  • {time} — time remaining to the reward,
  • {percent} — progress percentage,
  • {chance} — chance pulled from the permission tier.
p-color: GREEN
p-style: SOLID
bar-name: '&a✦ &7| &fReward in: &a{time} &8(&a{percent}%&8) &7| &fchance: &7{chance}'

Chances by Permission (VIP/SVIP/MVIP)

Give higher ranks better chances. Example: VIP 10%, SVIP 30%, MVIP 50%.

permissions:
 '1': { permission: afk.vip, chance: 10 }
 '2': { permission: afk.svip, chance: 30 }
 '3': { permission: afk.mvip, chance: 50 }

If a player has multiple of these permissions, the plugin will typically use the most relevant/highest one. Keep ranks unique to avoid ambiguity.


Global Toggles

You can disable visual elements for everyone by switching them to false:

boss-bar: true
title: true
actionbar: true

Time Format for {time}

Control unit labels and output order:

sec: ' {sec}s'
min: ' {min}m'
hour: ' {hour}h'
day: '{day}d'

format: "{d}{h}{m}{s}"

For example, changing to format: "{d}{h}{m}" will show 1d 1h 1m.


Actionbar Progress Bar

Customize the character, length, and colors of the progress bar:

styles:
  char: "I"
  size: 100
  no-active: "&7"
  active: "&a"

Try a square or dot for char, and adjust size to 10/20/50/etc. as you like.


Troubleshooting

The plugin didn’t load

  • Check the startup console for errors after restart.
  • Make sure the .jar is in /plugins and not corrupted.
  • Verify your server (Paper/Spigot) version is compatible with the plugin release.

The AFK zone doesn’t work after creation

  • Ensure you selected two corners properly (/azone selector → stick → right/left click).
  • Run /azone create <name> and then /azone reload.
  • Confirm the player is actually standing inside the defined cuboid.