WikiSupport

Решение проблем


🔧 Решение проблем

Руководство по устранению распространённых проблем с ScriptsLab.


Общие проблемы

Плагин не загружается

Симптомы: Плагин не отображается в списке /plugins

Причины:

  1. Неправильная версия сервера
  2. Конфликт с другим плагином
  3. Ошибка в JAR файле

Решения:

  1. Проверьте версию сервера

    /version
    

    Должна быть Paper 1.20.4+ илиSpigot 1.20.4+

  2. Проверьте логи

    logs/latest.log
    

    Ищите ошибки при загрузке

  3. Удалите плагины Отключите другие плагины и проверьте загрузку


Ошибка "Java version not supported"

Симптомы:

[ScriptsLab] ERROR: Java 17 required

Решение:

# Linux - Проверьте версию Java
java -version

# Установите Java 17
sudo apt install openjdk-17-jdk

Проверка в startup скрипте:

#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
java -Xmx4G -Xms2G -jar paper.jar --nogui

Ошибка "Plugin does not support this server type"

Симптомы:

[ScriptsLab] ERROR: Plugin requires Paper

Решение:

  • Используйте Paper, Spigot или Pufferfish
  • CraftBukkit не поддерживается!

Проблемы со скриптами

Скрипт не загружается

Симптомы: Команда из скрипта не работает

Диагностика:

  1. Проверьте загрузку скриптов

    /script list
    
  2. Проверьте логи

    logs/latest.log
    

    Ищите ошибки JavaScript

  3. Включите debug режим

    # config.yml
    general:
      debug: true
    

Распространённые причины:

ОшибкаПричинаРешение
ReferenceErrorНе-defined переменнаяПроверьте имя переменной
SyntaxErrorОшибка синтаксисаПроверьте скобки и запятые
TypeErrorНеверный типПроверьте вызов метода

Ошибка "timeout" при выполнении

Симптомы:

[ScriptsLab] ERROR: Script execution timeout

Решение:

  1. Увеличьте таймаут в config.yml:

    scripts:
      timeout: 10000  # 10 секунд
    
  2. Оптимизируйте скрипт

    • Избегайте бесконечных циклов
    • Используйте асинхронные операции

Скрипт вызывает лаги сервера

Симптомы: Сервер тормозит после загрузки скрипта

Решение:

  1. Проверьте циклы

    // Плохо
    while (true) {
        // Бесконечный цикл!
    }
    
    // Хорошо
    Scheduler.runTimer(function() {
        // Код
    }, 0, 20);
    
  2. ИспользуйтеrunLater вместопрямых вызовов

    // Плохо - блокирует сервер
    heavyFunction();
    
    // Хорошо - выполняется асинхронно
    Scheduler.runLater(function() {
        heavyFunction();
    }, 0);
    
  3. Ограничьте частоту выполнения

    // Запускайте не чаще 1 раза в секунду
    Scheduler.runTimer(function() {
        // Код
    }, 0, 20);
    

Проблемы с памятью

OutOfMemoryError

Симптомы:

java.lang.OutOfMemoryError: Java heap space

Решение:

  1. Увеличьте память в startup скрипте:

    java -Xmx6G -Xms4G -jar paper.jar --nogui
    
  2. Уменьшите max-memory в config.yml:

    scripts:
      max-memory: 64
    
  3. Проверьте утечки памяти

    • Удаляйте слушатели событий при выгрузке скрипта
    • Отменяйте задачи планировщика

Проблемы с правами

Нет доступа к команде

Симптомы: You don't have permission to do that!

Решение:

  1. Проверьте право

    # В config.yml permissions
    permissions:
      scriptslab.use: true
    
  2. Добавьте право игроку

    # LuckPerms
    lp user NickName permission set scriptslab.heal true
    
  3. Добавьте право в группу

    # PermissionsEx
    groups:
      player:
        permissions:
          - scriptslab.heal
    

Проблемы с командами

Команда не найдена

Симптомы: Unknown command

Решение:

  1. Проверьте список команд

    /script list
    
  2. Перезагрузите скрипты

    /script reload
    
  3. Проверьте название команды

    // Регистрация
    Commands.register('hello', function(...) {...});
    
    // Вызов
    /hello  // Не /heallo
    

Команда работает только для игроков

Симптомы: Only players can use this command

Решение:

Commands.register('mycommand', function(sender, args) {
    // Проверка на игрока (уже есть)
    if (!sender.isPlayer()) {
        sender.sendMessage('§cOnly for players!');
        return;
    }
    
    // Ваш код
});

Проблемы с событиями

Событие не срабатывает

Симптомы: Обработчик события не выполняется

Диагностика:

  1. Проверьте имя события

    // Правильно
    Events.on('PlayerJoinEvent', function(event) {...});
    
    // Неправильно
    Events.on('PlayerJoin', function(event) {...});
    
  2. Проверьте отмену события

    event.setCancelled(true);
    
  3. Включите debug

    Events.on('PlayerJoinEvent', function(event) {
        Console.debug('Событие сработало!');
    });
    

Проблемы с предметами

Кастомный предмет не создаётся

Симптомы: Команда получения предмета не работает

Решение:

  1. ПроверьтеMaterial

    // Правильно
    Material.DIAMOND_SWORD
    
    // Неправильно  
    Material.Diamond_Sword
    
  2. Проверьте ItemMeta

    var meta = item.getItemMeta();
    if (meta) {
        // Код
    }
    
  3. Проверьте логи

    Console.log('Создание предмета...');
    // Добавьте логирование
    

Проблемы с хранением

Данные не сохраняются

Симптомы: После перезагрузки данные теряются

Решение:

  1. Проверьте вызов save

    Storage.save('key', value);  // Сохранить
    
    // И загрузку
    Storage.load('key').then(function(value) {
        Console.log(value);
    });
    
  2. Проверьтеconfig.yml

    storage:
      provider: yaml
      auto-save: true
    

Проблемы с GraalVM

GraalVM не загружается

Симптомы:

[ScriptsLab] ERROR: Failed to initialize GraalVM

Решение:

  1. Проверьте JAR файл

    • Убедитесь, что используете правильный JAR
    • Попробуйте пересобрать
  2. ПроверьтеJava

    • Нужен Java 17+
    • Убедитесь, что JAVA_HOME указан правильно

Логирование проблем

Как получить полезную информацию

  1. Включите debug режим:

    general:
      debug: true
    
  2. Проверьте логи:

    logs/latest.log
    
  3. Используйте Console.log:

    Console.log('Отладка: ' + variable);
    Console.debug('Debug: ' + variable);
    

Команды диагностики

КомандаОписание
/scriptslab infoИнформация о плагине
/script listСписок скриптов
/script reloadПерезагрузить скрипты
/module listСписок модулей

Получение помощи

Где искать помощь

  1. Логи сервера - logs/latest.log
  2. GitHub Issues - сообщить об ошибке
  3. Discord - сообщество

При сообщении об ошибке

Укажите:

  • Версию ScriptsLab
  • Версию сервера (Paper/Spigot)
  • Версию Java (java -version)
  • Лог ошибки
  • Шаги воспроизведения

Следующие шаги

ШагОписание
FAQЧасто задаваемые вопросы
Script APIПолный API
ExamplesПримеры

🔧 Troubleshooting (English)

Guide to resolving common ScriptsLab issues.


General Issues

Plugin Not Loading

Symptoms: Plugin doesn't appear in /plugins list

Causes:

  1. Wrong server version
  2. Conflict with another plugin
  3. Corrupted JAR file

Solutions:

  1. Check server version

    /version
    

    Must be Paper 1.20.4+ or Spigot 1.20.4+

  2. Check logs

    logs/latest.log
    

    Look for loading errors

  3. Remove other plugins Disable other plugins and check loading


Error "Java version not supported"

Symptoms:

[ScriptsLab] ERROR: Java 17 required

Solution:

# Linux - Check Java version
java -version

# Install Java 17
sudo apt install openjdk-17-jdk

Check in startup script:

#!/bin/bash
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
java -Xmx4G -Xms2G -jar paper.jar --nogui

Error "Plugin does not support this server type"

Symptoms:

[ScriptsLab] ERROR: Plugin requires Paper

Solution:

  • Use Paper, Spigot, or Pufferfish
  • CraftBukkit is NOT supported!

Script Issues

Script Not Loading

Symptoms: Command from script doesn't work

Diagnostics:

  1. Check script loading

    /script list
    
  2. Check logs

    logs/latest.log
    

    Look for JavaScript errors

  3. Enable debug mode

    # config.yml
    general:
      debug: true
    

Common Causes:

ErrorCauseSolution
ReferenceErrorUndefined variableCheck variable name
SyntaxErrorSyntax errorCheck brackets and commas
TypeErrorWrong typeCheck method call

"timeout" Error During Execution

Symptoms:

[ScriptsLab] ERROR: Script execution timeout

Solution:

  1. Increase timeout in config.yml:

    scripts:
      timeout: 10000  # 10 seconds
    
  2. Optimize script

    • Avoid infinite loops
    • Use asynchronous operations

Script Causes Server Lag

Symptoms: Server slows down after loading script

Solution:

  1. Check loops

    // Bad
    while (true) {
        // Infinite loop!
    }
    
    // Good
    Scheduler.runTimer(function() {
        // Code
    }, 0, 20);
    
  2. Use runLater instead of direct calls

    // Bad - blocks server
    heavyFunction();
    
    // Good - executes asynchronously
    Scheduler.runLater(function() {
        heavyFunction();
    }, 0);
    
  3. Limit execution frequency

    // Run no more than once per second
    Scheduler.runTimer(function() {
        // Code
    }, 0, 20);
    

Memory Issues

OutOfMemoryError

Symptoms:

java.lang.OutOfMemoryError: Java heap space

Solution:

  1. Increase memory in startup script:

    java -Xmx6G -Xms4G -jar paper.jar --nogui
    
  2. Decrease max-memory in config.yml:

    scripts:
      max-memory: 64
    
  3. Check for memory leaks

    • Remove event listeners on script unload
    • Cancel scheduler tasks

Permission Issues

No Access to Command

Symptoms: You don't have permission to do that!

Solution:

  1. Check permission

    # In config.yml permissions
    permissions:
      scriptslab.use: true
    
  2. Add permission to player

    # LuckPerms
    lp user NickName permission set scriptslab.heal true
    
  3. Add permission to group

    # PermissionsEx
    groups:
      player:
        permissions:
          - scriptslab.heal
    

Command Issues

Command Not Found

Symptoms: Unknown command

Solution:

  1. Check command list

    /script list
    
  2. Reload scripts

    /script reload
    
  3. Check command name

    // Registration
    Commands.register('hello', function(...) {...});
    
    // Call
    /hello  // Not /heallo
    

Command Works Only for Players

Symptoms: Only players can use this command

Solution:

Commands.register('mycommand', function(sender, args) {
    // Player check (already there)
    if (!sender.isPlayer()) {
        sender.sendMessage('§cOnly for players!');
        return;
    }
    
    // Your code
});

Event Issues

Event Not Triggering

Symptoms: Event handler doesn't execute

Diagnostics:

  1. Check event name

    // Correct
    Events.on('PlayerJoinEvent', function(event) {...});
    
    // Incorrect
    Events.on('PlayerJoin', function(event) {...});
    
  2. Check event cancellation

    event.setCancelled(true);
    
  3. Enable debug

    Events.on('PlayerJoinEvent', function(event) {
        Console.debug('Event triggered!');
    });
    

Item Issues

Custom Item Not Creating

Symptoms: Item get command doesn't work

Solution:

  1. Check Material

    // Correct
    Material.DIAMOND_SWORD
    
    // Incorrect  
    Material.Diamond_Sword
    
  2. Check ItemMeta

    var meta = item.getItemMeta();
    if (meta) {
        // Code
    }
    
  3. Check logs

    Console.log('Creating item...');
    // Add logging
    

Storage Issues

Data Not Saving

Symptoms: Data lost after restart

Solution:

  1. Check save call

    Storage.save('key', value);  // Save
    
    // And load
    Storage.load('key').then(function(value) {
        Console.log(value);
    });
    
  2. Check config.yml

    storage:
      provider: yaml
      auto-save: true
    

GraalVM Issues

GraalVM Not Loading

Symptoms:

[ScriptsLab] ERROR: Failed to initialize GraalVM

Solution:

  1. Check JAR file

    • Make sure you're using the correct JAR
    • Try rebuilding
  2. Check Java

    • Need Java 17+
    • Make sure JAVA_HOME is set correctly

Logging Issues

How to Get Useful Information

  1. Enable debug mode:

    general:
      debug: true
    
  2. Check logs:

    logs/latest.log
    
  3. Use Console.log:

    Console.log('Debug: ' + variable);
    Console.debug('Debug: ' + variable);
    

Diagnostic Commands

CommandDescription
/scriptslab infoPlugin information
/script listScript list
/script reloadReload scripts
/module listModule list

Getting Help

Where to Find Help

  1. Server logs - logs/latest.log
  2. GitHub Issues - report a bug
  3. Discord - community

When Reporting a Bug

Specify:

  • ScriptsLab version
  • Server version (Paper/Spigot)
  • Java version (java -version)
  • Error log
  • Reproduction steps

Next Steps

StepDescription
FAQFrequently asked questions
Script APIFull API
ExamplesExamples

Last updated May 1, 2026, 9:52 AM
Edit