4RNI 13 Opublikowano 1 marca 2018 Udostępnij Opublikowano 1 marca 2018 (edytowane) Witam po wpisaniu komendy /ts3 nic sie nie dzieje (zadnych logow w konsoli). Od razu mowie ze nie jest to przez config. Kod: package pl.unixhc.tools.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import pl.unixhc.tools.Main; import pl.unixhc.tools.utils.ChatUtil; public class Ts3Command implements CommandExecutor{ Main plugin; public Ts3Command(Main plugin){ this.plugin = plugin; this.plugin.getCommand("ts3").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmnd, String string, String[] args){ for(String ts3 : this.plugin.getConfig().getStringList("Ts3Info")){ sender.sendMessage(ChatUtil.fixColor(ts3)); return true; } return false; } } Main: package pl.unixhc.tools; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import pl.unixhc.tools.commands.*; public class Main extends JavaPlugin implements Listener{ Ts3Command ts3; public void onEnable(){ saveDefaultConfig(); this.ts3 = new Ts3Command(this); } } Komenda jest zarejestrowana w plugin.yml. Edytowane 1 marca 2018 przez 4RNI Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 kerpson 533 Opublikowano 1 marca 2018 Udostępnij Opublikowano 1 marca 2018 zarejestrowales komende w plugin.yml? Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 4RNI 13 Opublikowano 1 marca 2018 Autor Udostępnij Opublikowano 1 marca 2018 Napisalem ze tak. Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
0 szedi 7 Opublikowano 3 marca 2018 Udostępnij Opublikowano 3 marca 2018 to jest dział SKRYPT a nie programowanie i błędy z pluginami !!! Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Pytanie
4RNI 13
Witam po wpisaniu komendy /ts3 nic sie nie dzieje (zadnych logow w konsoli). Od razu mowie ze nie jest to przez config.
Kod:
package pl.unixhc.tools.commands; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import pl.unixhc.tools.Main; import pl.unixhc.tools.utils.ChatUtil; public class Ts3Command implements CommandExecutor{ Main plugin; public Ts3Command(Main plugin){ this.plugin = plugin; this.plugin.getCommand("ts3").setExecutor(this); } public boolean onCommand(CommandSender sender, Command cmnd, String string, String[] args){ for(String ts3 : this.plugin.getConfig().getStringList("Ts3Info")){ sender.sendMessage(ChatUtil.fixColor(ts3)); return true; } return false; } }
Main:
package pl.unixhc.tools; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; import pl.unixhc.tools.commands.*; public class Main extends JavaPlugin implements Listener{ Ts3Command ts3; public void onEnable(){ saveDefaultConfig(); this.ts3 = new Ts3Command(this); } }
Komenda jest zarejestrowana w plugin.yml.
Edytowane przez 4RNIOdnośnik do komentarza
Udostępnij na innych stronach
3 odpowiedzi na to pytanie
Rekomendowane odpowiedzi