Загрузка...

The problem with the registration of the team in the plugin on Paper 1.21.4

Thread in Minecraft server plugins and packs created by ppSnaiperPP Sep 5, 2025. 292 views

  1. ppSnaiperPP
    ppSnaiperPP Topic starter Sep 5, 2025 2 Aug 27, 2025
    Здравствуйте!

    Я создаю плагин для Paper версии 1.21.4 (ядро).
    При попытке зарегистрировать команду старым способом


    Code
    @Override
    public void onEnable() {
    getLogger().info("[Register] Plugin has been enabled!");
    getCommand("heal").setExecutor(new commandHeal());
    }
    в консоль выводится ошибка.

    ⁡[16:54:25 ERROR]: Error occurred while enabling Tester v1.0-SNAPSHOT (Is it up to date?)java.lang.UnsupportedOperationException: You are trying to call JavaPlugin#getCommand on a Paper plugin during startup:you are probably trying to get a command you tried to define in paper-plugin.yml.Paper plugins do not support YAML-based command declarations!You can use JavaPlugin#registerCommand to define commands in Paper plugins.Please check the documentation for more information on how to define commands in Paper plugins: https://docs.papermc.io/paper/dev/getting-started/paper-plugins#commands


    Подскажите, пожалуйста, как правильно зарегистрировать команду в новой версии Paper.
    Заранее спасибо за помощь!
     
  2. Nevajnoo
    Nevajnoo Sep 10, 2025 1 Apr 5, 2023
    Актуально? Напиши в тг мне
     
Loading...