Хостинг серверов Minecraft playvds.com
  1. Вы находитесь в русском сообществе Bukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на русский язык плагины наших собратьев из других стран.
    Скрыть объявление

Помогите [РЕШЕНО] Добавление команды

Тема в разделе "Разработка плагинов для новичков", создана пользователем Death_Cat, 4 ноя 2016.

Статус темы:
Закрыта.
  1. Reality_SC

    Reality_SC Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Reality_SC
    Где же логи?

    upload_2016-11-12_17-55-46.png

    В указанные места поставить getLogger().info(" ******* ON COMMAND #1 ********");
    (1, 2 и 3 по порядку)
    и ждать их появления в логе. Если нету, значит следует внимательно смотреть на plugin.yml (он в jar-е то лежит по факту?).

    Ждём, а дальше будет искать новые варианты.
     
  2. Хостинг MineCraft
    <
  3. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD
    Код:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
          
            getLogger().info(" ******* ON COMMAND #1 ********");
            if(sender instanceof Player){
              
                getLogger().info(" ******* ON COMMAND #2 ********");
                if(cmd.getName().equalsIgnoreCase("death")){
                    sender.sendMessage(ChatColor.AQUA + "True message");
                      
                  
                        getLogger().info(" ******* ON COMMAND #3 ********");
                        return true;
                  
                }
              
            }
          
            return false;
        }
    
    Я написал, ошибки в логах нет, команда вообще не появляется.

    Вот plugin.yml
    Код:
    name: KotFirst
    main: Kot.main.KotFirst
    version: 1.0
    commands:
      death:
        description: Write text to player!
        usage: /death
    
     
  4. stiznt

    stiznt Активный участник Пользователь

    Баллы:
    61
    Ты установил себе пермишн или опку дал?
     
  5. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD
    Да, дал себе опку на сервере.
     
  6. stiznt

    stiznt Активный участник Пользователь

    Баллы:
    61
    Просто, у тебя идёт проверка на пермишн, а если у тебя не пермишена, то у тебя не будет отображаться команда
     
  7. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD

    upload_2016-11-12_17-40-29.png
     
  8. DonDays

    DonDays Активный участник Пользователь

    Баллы:
    96
    Имя в Minecraft:
    DonDays
    Ору, у операторов есть все права на сервер (регулируется в server.properites) за исключением доступа к PermissionsEx (если таковой установлен). @Death_Cat, покажи полный код класса и полный лог
     
  9. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD
    Главный класс:
    Код:
    package Kot.main;
    
    import java.util.logging.Logger;
    
    import org.bukkit.Bukkit;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.ChatColor;
    
    public class KotFirst extends JavaPlugin {
     
        Logger log = Logger.getLogger("Minecraft");
        public void onEnable(){
         
         
         
         
            Bukkit.getPluginManager().registerEvents(new Handler(), this);
         
            getLogger().info("Plugin enable");
            log.info("OH ITS WORK!");
         
        }
     
        @Override
        public void onDisable(){
         
        }
    
     
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
         
            getLogger().info(" ******* ON COMMAND #1 ********");
            if(sender instanceof Player){
             
                getLogger().info(" ******* ON COMMAND #2 ********");
                if(cmd.getName().equalsIgnoreCase("death")){
                    sender.sendMessage(ChatColor.AQUA + "True message");
                     
                 
                        getLogger().info(" ******* ON COMMAND #3 ********");
                        return true;
                 
                }
             
            }
         
            return false;
        }
     
    }
    

    [20:18:24] [Server thread/INFO]: Starting minecraft server version 1.8.8
    [20:18:24] [Server thread/INFO]: Loading properties
    [20:18:24] [Server thread/INFO]: Default game type: CREATIVE
    [20:18:24] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-db6de12-18fbb24 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
    [20:18:25] [Server thread/INFO]: Debug logging is disabled
    [20:18:25] [Server thread/INFO]: Server Ping Player Sample Count: 12
    [20:18:25] [Server thread/INFO]: Using 4 threads for Netty based IO
    [20:18:25] [Server thread/INFO]: Generating keypair
    [20:18:25] [Server thread/INFO]: Starting Minecraft server on *:25565
    [20:18:25] [Server thread/INFO]: Using default channel type
    [20:18:25] [Server thread/INFO]: Set PluginClassLoader as parallel capable
    [20:18:25] [Server thread/INFO]: [KotFirst] Loading KotFirst v1.0
    [20:18:25] [Server thread/INFO]: [Essentials] Loading Essentials vTeamCity
    [20:18:25] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    [20:18:25] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
    [20:18:25] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
    [20:18:25] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
    [20:18:25] [Server thread/INFO]: **** Beginning UUID conversion, this may take A LONG time ****
    [20:18:25] [Server thread/INFO]: Preparing level "world"
    [20:18:25] [Server thread/INFO]: -------- World Settings For [world] --------
    [20:18:25] [Server thread/INFO]: Hopper Transfer: 24 Hopper Check: 24 Hopper Amount: 3
    [20:18:25] [Server thread/INFO]: Random Lighting Updates: false
    [20:18:25] [Server thread/INFO]: Structure Info Saving: true
    [20:18:25] [Server thread/INFO]: Sending up to 10 chunks per packet
    [20:18:25] [Server thread/INFO]: Max TNT Explosions: 100
    [20:18:25] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [20:18:25] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [20:18:25] [Server thread/INFO]: Anti X-Ray: true
    [20:18:25] [Server thread/INFO]: Engine Mode: 1
    [20:18:25] [Server thread/INFO]: Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [20:18:25] [Server thread/INFO]: Replace Blocks: [1, 5]
    [20:18:25] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Cane Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Melon Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [20:18:25] [Server thread/INFO]: Mob Spawn Range: 3
    [20:18:25] [Server thread/INFO]: Entity Activation Range: An 6 / Mo 16 / Mi 2
    [20:18:25] [Server thread/INFO]: Item Despawn Rate: 6000
    [20:18:25] [Server thread/INFO]: Item Merge Radius: 4.0
    [20:18:25] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [20:18:25] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [20:18:25] [Server thread/INFO]: Max Entity Collisions: 2
    [20:18:25] [Server thread/INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
    [20:18:25] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [20:18:25] [Server thread/INFO]: Clear tick list: false
    [20:18:25] [Server thread/INFO]: Experience Merge Radius: 6.0
    [20:18:25] [Server thread/INFO]: View Distance: 15
    [20:18:25] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [20:18:25] [Server thread/INFO]: -------- World Settings For [world_nether] --------
    [20:18:25] [Server thread/INFO]: Hopper Transfer: 24 Hopper Check: 24 Hopper Amount: 3
    [20:18:25] [Server thread/INFO]: Random Lighting Updates: false
    [20:18:25] [Server thread/INFO]: Structure Info Saving: true
    [20:18:25] [Server thread/INFO]: Sending up to 10 chunks per packet
    [20:18:25] [Server thread/INFO]: Max TNT Explosions: 100
    [20:18:25] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [20:18:25] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [20:18:25] [Server thread/INFO]: Anti X-Ray: true
    [20:18:25] [Server thread/INFO]: Engine Mode: 1
    [20:18:25] [Server thread/INFO]: Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [20:18:25] [Server thread/INFO]: Replace Blocks: [1, 5]
    [20:18:25] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Cane Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Melon Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [20:18:25] [Server thread/INFO]: Mob Spawn Range: 3
    [20:18:25] [Server thread/INFO]: Entity Activation Range: An 6 / Mo 16 / Mi 2
    [20:18:25] [Server thread/INFO]: Item Despawn Rate: 6000
    [20:18:25] [Server thread/INFO]: Item Merge Radius: 4.0
    [20:18:25] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [20:18:25] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [20:18:25] [Server thread/INFO]: Max Entity Collisions: 2
    [20:18:25] [Server thread/INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
    [20:18:25] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [20:18:25] [Server thread/INFO]: Clear tick list: false
    [20:18:25] [Server thread/INFO]: Experience Merge Radius: 6.0
    [20:18:25] [Server thread/INFO]: View Distance: 15
    [20:18:25] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [20:18:25] [Server thread/INFO]: -------- World Settings For [world_the_end] --------
    [20:18:25] [Server thread/INFO]: Hopper Transfer: 24 Hopper Check: 24 Hopper Amount: 3
    [20:18:25] [Server thread/INFO]: Random Lighting Updates: false
    [20:18:25] [Server thread/INFO]: Structure Info Saving: true
    [20:18:25] [Server thread/INFO]: Sending up to 10 chunks per packet
    [20:18:25] [Server thread/INFO]: Max TNT Explosions: 100
    [20:18:25] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [20:18:25] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [20:18:25] [Server thread/INFO]: Anti X-Ray: true
    [20:18:25] [Server thread/INFO]: Engine Mode: 1
    [20:18:25] [Server thread/INFO]: Hidden Blocks: [14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130]
    [20:18:25] [Server thread/INFO]: Replace Blocks: [1, 5]
    [20:18:25] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Cane Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Melon Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [20:18:25] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [20:18:25] [Server thread/INFO]: Mob Spawn Range: 3
    [20:18:25] [Server thread/INFO]: Entity Activation Range: An 6 / Mo 16 / Mi 2
    [20:18:25] [Server thread/INFO]: Item Despawn Rate: 6000
    [20:18:25] [Server thread/INFO]: Item Merge Radius: 4.0
    [20:18:25] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [20:18:25] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [20:18:25] [Server thread/INFO]: Max Entity Collisions: 2
    [20:18:25] [Server thread/INFO]: Custom Map Seeds: Village: 10387312 Feature: 14357617
    [20:18:25] [Server thread/INFO]: Chunks to Grow per Tick: 650
    [20:18:25] [Server thread/INFO]: Clear tick list: false
    [20:18:25] [Server thread/INFO]: Experience Merge Radius: 6.0
    [20:18:25] [Server thread/INFO]: View Distance: 15
    [20:18:25] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [20:18:25] [Server thread/INFO]: Preparing start region for level 0 (Seed: 27594263)
    [20:18:26] [Server thread/INFO]: Preparing start region for level 1 (Seed: -7112984164819568170)
    [20:18:27] [Server thread/INFO]: Preparing start region for level 2 (Seed: -7112984164819568170)
    [20:18:27] [Server thread/INFO]: [KotFirst] Enabling KotFirst v1.0
    [20:18:27] [Server thread/INFO]: [KotFirst] Plugin enable
    [20:18:27] [Server thread/INFO]: OH ITS WORK!
    [20:18:27] [Server thread/INFO]: [Essentials] Enabling Essentials vTeamCity
    [20:18:27] [Server thread/INFO]: Bukkit version format changed. Version not checked.
    [20:18:27] [Server thread/INFO]: git-Spigot-db6de12-18fbb24 (MC: 1.8.8)
    [20:18:27] [Server thread/INFO]: 1.8.8-R0.1-SNAPSHOT
    [20:18:27] [Server thread/INFO]: [Essentials] Starting Essentials ban format conversion
    [20:18:27] [Server thread/INFO]: Using locale ru_RU
    [20:18:27] [Server thread/INFO]: Using locale ru_RU
    [20:18:27] [Server thread/INFO]: [Essentials] This plugin collects minimal statistic data and sends it to http://metrics.essentials3.net.
    [20:18:27] [Server thread/INFO]: [Essentials] You can opt out, disabling metrics for all plugins, by running /essentials opt-out
    [20:18:27] [Server thread/INFO]: [Essentials] This will start 5 minutes after the first admin/op joins.
    [20:18:27] [Server thread/INFO]: Essentials: Using config file enhanced permissions.
    [20:18:27] [Server thread/INFO]: Permissions listed in as player-commands will be given to all users.
    [20:18:27] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [20:18:27] [Server thread/INFO]: Done (2,152s)! For help, type "help" or "?"
    [20:18:43] [Thread-4/INFO]: Stopping server
     
    Последнее редактирование: 12 ноя 2016
  10. Dereku

    Dereku Старожил

    Баллы:
    173
    Skype:
    derek_unavailable
    Имя в Minecraft:
    _Dereku
    Essentials убери и смотри.
     
  11. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD
    Теперь работает.
    Из-за чего несовместимость с Essetials ?
     
  12. Dereku

    Dereku Старожил

    Баллы:
    173
    Skype:
    derek_unavailable
    Имя в Minecraft:
    _Dereku
    Потому что у него тоже есть эта команда. И он её регистрирует нормально, а не заполнением.
     
  13. Reality_SC

    Reality_SC Старожил Пользователь

    Баллы:
    123
    Имя в Minecraft:
    Reality_SC
    P.S. Где-то в настройках можно вырубить всю эту простыню с загрузкой миров.
     
  14. Автор темы
    Death_Cat

    Death_Cat Участник Пользователь

    Баллы:
    31
    Имя в Minecraft:
    Death_CatHD
    Спасибо.
     
Статус темы:
Закрыта.

Поделиться этой страницей